mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 09:26:27 +02:00
update command and contact controller to user standard
This commit is contained in:
parent
155a048834
commit
35b74c9458
4 changed files with 58 additions and 109 deletions
|
@ -18,4 +18,28 @@ namespace models;
|
|||
* @return string
|
||||
*/
|
||||
protected function get_table_name() : string { return 'contact'; }
|
||||
|
||||
|
||||
/**
|
||||
* Return a contact by his number for a user
|
||||
* @param int $id_user : User id
|
||||
* @param string $number : Contact number
|
||||
* @return array
|
||||
*/
|
||||
public function get_by_number_and_user (int $id_user, string $number)
|
||||
{
|
||||
return $this->_select($this->get_table_name(), ['id_user' => $id_user, 'number' => $number]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a contact by his name for a user
|
||||
* @param int $id_user : User id
|
||||
* @param string $name : Contact name
|
||||
* @return array
|
||||
*/
|
||||
public function get_by_name_and_user (int $id_user, string $name)
|
||||
{
|
||||
return $this->_select($this->get_table_name(), ['id_user' => $id_user, 'name' => $name]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue