mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Add api for create and delete phone
This commit is contained in:
parent
df7c66f91c
commit
14cd233d92
5 changed files with 183 additions and 9 deletions
|
@ -60,9 +60,9 @@ namespace controllers\internals;
|
|||
* @param string $adapter : The adapter to use the phone
|
||||
* @param string json $adapter_datas : A JSON string representing adapter's datas (for example credentials for an api)
|
||||
*
|
||||
* @return bool : false on error, true on success
|
||||
* @return int|bool : false on error, new id on success
|
||||
*/
|
||||
public function create(int $id_user, string $name, string $adapter, string $adapter_datas): bool
|
||||
public function create(int $id_user, string $name, string $adapter, string $adapter_datas)
|
||||
{
|
||||
$phone = [
|
||||
'id_user' => $id_user,
|
||||
|
@ -71,7 +71,7 @@ namespace controllers\internals;
|
|||
'adapter_datas' => $adapter_datas,
|
||||
];
|
||||
|
||||
return (bool) $this->get_model()->insert($phone);
|
||||
return $this->get_model()->insert($phone);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue