__construct()
__construct()
Class Constructor
Admins_Model Class
Handles the database actions for admin users management.
Data Structure:
'fist_name'
'last_name' (required)
'email' (required)
'mobile_number'
'phone_number' (required)
'address'
'city'
'state'
'zip_code'
'notes'
'id_roles'
'settings' >>> array that contains user settings (username, password etc)
exists(array $admin) : boolean
Check whether a particular admin record exists in the database.
array | $admin | Contains the admin data. The 'email' value is required to be present at the moment. |
When the 'email' value is not present on the $admin argument.
Returns whether the record exists or not.
find_record_id(array $admin) : integer
Find the database record id of an admin user.
array | $admin | Contains the admin data. The 'email' value is required in order to find the record id. |
When the 'email' value is not present on the $admin array.
Returns the record id
delete(\numeric $admin_id) : boolean
Delete an existing admin record from the database.
\numeric | $admin_id | The admin record id to be deleted. |
When the $admin_id is not a valid numeric value.
When the record to be deleted is the only one admin user left on the system.
Returns the delete operation result.
get_value(string $field_name, \numeric $admin_id) : string
Get a specific field value from the database.
string | $field_name | The field name of the value to be returned. |
\numeric | $admin_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(string|array $where_clause = '') : array
Get all, or specific admin records from database.
string|array | $where_clause | (OPTIONAL) The WHERE clause of the query to be executed. Use this to get specific admin records. |
Returns an array with admin records.