mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
use correct model and fix style
This commit is contained in:
parent
e21b89cc7c
commit
e957c9feb7
29 changed files with 105 additions and 111 deletions
|
@ -136,7 +136,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Call
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Call($this->bdd);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Command
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Command($this->bdd);
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\ConditionalGroup
|
||||
{
|
||||
$this->model = $this->model ?? new \models\ConditionalGroup($this->bdd);
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Contact
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Contact($this->bdd);
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Event
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Event($this->bdd);
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Group
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Group($this->bdd);
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ class Media extends StandardController
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Media
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Media($this->bdd);
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Phone
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Phone($this->bdd);
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ class Quota extends StandardController
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Quota
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Quota($this->bdd);
|
||||
|
||||
|
|
|
@ -18,15 +18,15 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Return the list of entries for a user.
|
||||
*
|
||||
* @param int $id_user : User id
|
||||
* @param ?int $limit : Number of entry to return
|
||||
* @param ?int $offset : Number of entry to avoid
|
||||
* @param ?string $search : String to search for
|
||||
* @param ?array $search_columns : List of columns to search on
|
||||
* @param ?string $order_column : Name of the column to order by
|
||||
* @param bool $order_desc : Should result be ordered DESC, if false order ASC
|
||||
* @param bool $count : Should the query only count results
|
||||
* @param bool $unread : Should only unread messages be returned
|
||||
* @param int $id_user : User id
|
||||
* @param ?int $limit : Number of entry to return
|
||||
* @param ?int $offset : Number of entry to avoid
|
||||
* @param ?string $search : String to search for
|
||||
* @param ?array $search_columns : List of columns to search on
|
||||
* @param ?string $order_column : Name of the column to order by
|
||||
* @param bool $order_desc : Should result be ordered DESC, if false order ASC
|
||||
* @param bool $count : Should the query only count results
|
||||
* @param bool $unread : Should only unread messages be returned
|
||||
*
|
||||
* @return array : Entrys list
|
||||
*/
|
||||
|
@ -375,7 +375,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Received
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Received($this->bdd);
|
||||
|
||||
|
|
|
@ -544,7 +544,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Scheduled
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Scheduled($this->bdd);
|
||||
|
||||
|
|
|
@ -14,17 +14,16 @@ namespace controllers\internals;
|
|||
class Sended extends StandardController
|
||||
{
|
||||
protected $model;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $id_user : User id
|
||||
* @param ?int $limit : Number of entry to return
|
||||
* @param ?int $offset : Number of entry to avoid
|
||||
* @param ?string $search : String to search for
|
||||
* @param ?array $search_columns : List of columns to search on
|
||||
* @param ?string $order_column : Name of the column to order by
|
||||
* @param bool $order_desc : Should result be ordered DESC, if false order ASC
|
||||
* @param bool $count : Should the query only count results
|
||||
* @param int $id_user : User id
|
||||
* @param ?int $limit : Number of entry to return
|
||||
* @param ?int $offset : Number of entry to avoid
|
||||
* @param ?string $search : String to search for
|
||||
* @param ?array $search_columns : List of columns to search on
|
||||
* @param ?string $order_column : Name of the column to order by
|
||||
* @param bool $order_desc : Should result be ordered DESC, if false order ASC
|
||||
* @param bool $count : Should the query only count results
|
||||
*
|
||||
* @return array : Entries list
|
||||
*/
|
||||
|
@ -307,7 +306,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Sended
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Sended($this->bdd);
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Setting
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Setting($this->bdd);
|
||||
|
||||
|
|
|
@ -64,24 +64,25 @@ namespace controllers\internals;
|
|||
return $this->get_model()->get_by_number_for_user($id_user, $number);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a string to check if its a SMS stop.
|
||||
*
|
||||
* @param string $str : The string to check
|
||||
*
|
||||
* @return bool : true if sms stop, false else
|
||||
*/
|
||||
public function check_for_stop(string $str)
|
||||
{
|
||||
return 'stop' == trim(mb_strtolower($str));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\SmsStop
|
||||
{
|
||||
$this->model = $this->model ?? new \models\SmsStop($this->bdd);
|
||||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a string to check if its a SMS stop
|
||||
*
|
||||
* @param string $str : The string to check
|
||||
* @return bool : true if sms stop, false else
|
||||
*/
|
||||
public function check_for_stop (string $str)
|
||||
{
|
||||
return trim(mb_strtolower($str)) == 'stop';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,5 +138,5 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
abstract protected function get_model(): \descartes\Model;
|
||||
abstract protected function get_model(): \models\StandardModel;
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ class Webhook extends StandardController
|
|||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
protected function get_model(): \descartes\Model
|
||||
protected function get_model(): \models\Webhook
|
||||
{
|
||||
$this->model = $this->model ?? new \models\Webhook($this->bdd);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue