update command and contact controller to user standard

This commit is contained in:
osaajani 2019-11-13 06:13:55 +01:00
parent 155a048834
commit 35b74c9458
4 changed files with 58 additions and 109 deletions

View file

@ -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]);
}
}