mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Add api key to user, add status update support, add other things i dont remember at 2am...
This commit is contained in:
parent
193dd00c1e
commit
fb6abb4d91
14 changed files with 323 additions and 8 deletions
|
@ -241,7 +241,18 @@ namespace models;
|
|||
|
||||
return $this->_run_query($query, $params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return sended for an uid and an adapter
|
||||
* @param string $uid : Uid of the sended
|
||||
* @param string $adapter : Adapter used to send the message
|
||||
* @return array
|
||||
*/
|
||||
public function get_by_uid_and_adapter(string $uid, string $adapter)
|
||||
{
|
||||
return $this->_select_one('sended', ['uid' => $uid, 'adapter' => $adapter]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of sended SMS for every date since a date for a specific user
|
||||
|
|
|
@ -158,6 +158,19 @@ namespace models;
|
|||
{
|
||||
return $this->_update($this->get_table_name(), $entry, ['id_user' => $id_user, 'id' => $id]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a entry by his id
|
||||
* @param int $id : Entry id
|
||||
* @param array $datas : datas to update
|
||||
*
|
||||
* @return int : number of modified rows
|
||||
*/
|
||||
public function update(int $id, array $entry)
|
||||
{
|
||||
return $this->_update($this->get_table_name(), $entry, ['id' => $id]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,6 +25,18 @@ namespace models;
|
|||
{
|
||||
return $this->_select_one('user', ['email' => $email]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a user by his api_key address
|
||||
* @param string $api_key : User api key
|
||||
*
|
||||
* @return mixed boolean | array : false if cannot find user for this api key, the user else
|
||||
*/
|
||||
public function get_by_api_key(string $api_key)
|
||||
{
|
||||
return $this->_select_one('user', ['api_key' => $api_key]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue