__construct()
__construct()
Class Constructor
Providers_Model Class
Contains the database operations for the service provider users of Easy!Appointmenst.
Data Structure:
'fist_name'
'last_name' (required)
'email' (required)
'mobile_number'
'phone_number' (required)
'address'
'city'
'state'
'zip_code'
'notes'
'id_roles'
'services' >> array that contains the ids that the provider can provide
'settings'
'username'
'password'
'notifications'
'working_plan'
'google_sync'
'google_token'
'google_calendar'
'sync_past_days'
'sync_future_days'
add(array $provider) : integer
Add (insert - update) a service provider record.
If the record already exists (id value provided) then it is going to be updated, otherwise inserted into the database.
array | $provider | Contains the service provider data. |
When the record data validation fails.
Returns the record id.
exists(array $provider) : boolean
Check whether a particular provider record already exists in the database.
array | $provider | Contains the provider data. The 'email' value is required in order to check for a provider. |
When the 'email' value is not provided.
Returns whether the provider record exists or not.
find_record_id(array $provider) : integer
Find the database record id of a provider.
array | $provider | Contains the provider data. The 'email' value is required in order to find the record id. |
When the provider's email value is not provided.
Returns the record id.
get_row(integer $provider_id) : array
Get a specific provider record from the database.
integer | $provider_id | The id of the record to be returned. |
When the selected record does not exist in database.
Returns an associative array with the selected record's data. Each key has the same name as the database field names.
get_value(string $field_name, \numeric $provider_id) : string
Get a specific field value from the database.
string | $field_name | The field name of the value to be returned. |
\numeric | $provider_id | Record id of the value to be returned. |
When the $field_name argument is not a valid string.
When the $admin_id is not a valid numeric.
When the admin 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(mixed $where_clause = '') : array
Get all, or specific records from provider's table.
mixed | $where_clause | (OPTIONAL) The WHERE clause of the query to be executed. NOTICE: DO NOT INCLUDE 'WHERE' KEYWORD. |
Returns the rows from the database.
** File not found : $this->Model->get_batch('id **
get_providers_role_id() : integer
Get the providers role id from the database.
Returns the role id for the provider records.
None found |
get_setting(string $setting_name, integer $provider_id) : string
Get a providers setting from the database.
string | $setting_name | The setting name that is going to be returned. |
integer | $provider_id | The selected provider id. |
Returs the value of the selected user setting.
None found |
set_setting(string $setting_name, string $value, \numeric $provider_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 | $provider_id | The selected provider id. |
None found |
validate_username(string $username, \numeric $user_id) : boolean
Validate Records Username
string | $username | The provider records username. |
\numeric | $user_id | The user record id. |
Returns the validation result.
None found |
save_settings(array $settings, \numeric $provider_id)
Save the provider settings (used from insert or update operation).
array | $settings | Contains the setting values. |
\numeric | $provider_id | Record id of the provider. |
None found |
save_services(array $services, \numeric $provider_id)
Save the provider services in the database (use on both insert and update operation).
array | $services | Contains the service ids that the selected provider can provide. |
\numeric | $provider_id | The selected provider record id. |
When the $services argument type is not array.
When the $provider_id argumetn type is not numeric.
None found |