__construct()
__construct()
Class Constructor
Secretaries Model
Handles the db actions that have to do with secretaries.
Data Structure
'first_name'
'last_name'
'email'
'mobile_number'
'phone_number'
'address'
'city'
'state'
'zip_code'
'notes'
'id_roles'
'providers' >> array with provider ids that the secretary handles
'settings' >> array with the secretary settings
exists(array $secretary) : boolean
Check whether a particular secretary record exists in the database.
array | $secretary | Contains the secretary data. The 'email' value is required to be present at the moment. |
When the 'email' value is not present on the $secretary argument.
Returns whether the record exists or not.
find_record_id(array $secretary) : integer
Find the database record id of a secretary.
array | $secretary | Contains the secretary data. The 'email' value is required in order to find the record id. |
When the 'email' value is not present on the $secretary array.
Returns the record id
delete(\numeric $secretary_id) : boolean
Delete an existing secretary record from the database.
\numeric | $secretary_id | The secretary record id to be deleted. |
When the $secretary_id is not a valid numeric value.
Returns the delete operation result.
get_row(\numeric $secretary_id) : array
Get a specific secretary record from the database.
\numeric | $secretary_id | The id of the record to be returned. |
When the $secretary_id is not a valid numeric value.
When given record id does not exist in the database.
Returns an array with the secretary user data.
get_value(string $field_name, \numeric $secretary_id) : string
Get a specific field value from the database.
string | $field_name | The field name of the value to be returned. |
\numeric | $secretary_id | Record id of the value to be returned. |
When the $field_name argument is not a valid string.
When the $secretary_id is not a valid numeric.
When the secretary record does not exist in the database.
When the selected field value is not present on database.
Returns the selected record value from the database.
get_batch(string|array $where_clause = '') : array
Get all, or specific secretary records from database.
string|array | $where_clause | (OPTIONAL) The WHERE clause of the query to be executed. Use this to get specific secretary records. |
Returns an array with secretary records.
get_setting(string $setting_name, integer $secretary_id) : string
Get a providers setting from the database.
string | $setting_name | The setting name that is going to be returned. |
integer | $secretary_id | The selected provider id. |
Returs the value of the selected user setting.
set_setting(string $setting_name, string $value, \numeric $secretary_id)
Set a provider's setting value in the database.
The provider and settings record must already exist.
string | $setting_name | The setting's name. |
string | $value | The setting's value. |
\numeric | $secretary_id | The selected provider id. |