2019-12-04 03:04:45 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of RaspiSMS.
|
|
|
|
*
|
|
|
|
* (c) Pierre-Lin Bonnemaison <plebwebsas@gmail.com>
|
|
|
|
*
|
|
|
|
* This source file is subject to the GPL-3.0 license that is bundled
|
|
|
|
* with this source code in the file LICENSE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace models;
|
|
|
|
|
|
|
|
class Webhook extends StandardModel
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Return table name
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
protected function get_table_name() : string { return 'webhook'; }
|
2020-01-06 23:39:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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]);
|
|
|
|
}
|
2019-12-04 03:04:45 +01:00
|
|
|
}
|