mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-21 08:56:27 +02:00
Add method to find all webhooks of a certain type for a user
This commit is contained in:
parent
03f29b2225
commit
b6755dcc95
2 changed files with 24 additions and 0 deletions
|
@ -18,4 +18,16 @@ namespace models;
|
|||
* @return string
|
||||
*/
|
||||
protected function get_table_name() : string { return 'webhook'; }
|
||||
|
||||
|
||||
/**
|
||||
* Find all webhooks for a user and for a type of webhook
|
||||
* @param int $id_user : User id
|
||||
* @param string $type : Webhook type
|
||||
* @return array
|
||||
*/
|
||||
public function gets_for_type_and_user (int $id_user, string $type)
|
||||
{
|
||||
return $this->_select($this->get_table_name(), ['id_user' => $id_user, 'type' => $type]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue