use correct model and fix style

This commit is contained in:
osaajani 2021-07-19 17:32:23 +02:00
parent e21b89cc7c
commit e957c9feb7
29 changed files with 105 additions and 111 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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';
}
}

View file

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

View file

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