mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-06 06:46:25 +02:00
add a get for user in default model
This commit is contained in:
parent
35b74c9458
commit
25b461d611
3 changed files with 58 additions and 1 deletions
|
@ -29,7 +29,19 @@ namespace models;
|
|||
* @param int $id : entry id
|
||||
* @return array
|
||||
*/
|
||||
public function get($id)
|
||||
public function get(int $id)
|
||||
{
|
||||
return $this->_select_one($this->get_table_name(), ['id' => $id]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an entry by his id for a user
|
||||
* @param int $id_user : user id
|
||||
* @param int $id : entry id
|
||||
* @return array
|
||||
*/
|
||||
public function get_for_user(int $id_user, int $id)
|
||||
{
|
||||
return $this->_select_one($this->get_table_name(), ['id' => $id]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue