mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-24 17:03:27 +03:00
Added API resource mapping
This commit is contained in:
parent
226111e170
commit
6eaa6e52a5
1 changed files with 21 additions and 1 deletions
|
@ -27,6 +27,26 @@ class Admins_model extends EA_Model {
|
|||
'id_roles' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $api_resource = [
|
||||
'id' => 'id',
|
||||
'firstName' => 'first_name',
|
||||
'lastName' => 'last_name',
|
||||
'email' => 'email',
|
||||
'mobile' => 'mobile_number',
|
||||
'phone' => 'phone_number',
|
||||
'address' => 'address',
|
||||
'city' => 'city',
|
||||
'state' => 'state',
|
||||
'zip' => 'zip_code',
|
||||
'notes' => 'notes',
|
||||
'timezone' => 'timezone',
|
||||
'language' => 'language',
|
||||
'roleId' => 'id_roles',
|
||||
];
|
||||
|
||||
/**
|
||||
* Save (insert or update) an admin.
|
||||
*
|
||||
|
@ -560,7 +580,7 @@ class Admins_model extends EA_Model {
|
|||
* @param array &$admin API resource.
|
||||
* @param array|null $base Base admin data to be overwritten with the provided values (useful for updates).
|
||||
*/
|
||||
public function decode(array &$admin, array $base = NULL)
|
||||
public function api_decode(array &$admin, array $base = NULL)
|
||||
{
|
||||
$decoded_response = $base ?? [];
|
||||
|
||||
|
|
Loading…
Reference in a new issue