mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Update all controllers to standard behavior
This commit is contained in:
parent
18c7cb019d
commit
ccfc69baca
25 changed files with 112 additions and 125 deletions
|
@ -28,7 +28,7 @@ namespace models;
|
|||
*/
|
||||
public function get_by_number_and_user (int $id_user, string $number)
|
||||
{
|
||||
return $this->_select($this->get_table_name(), ['id_user' => $id_user, 'number' => $number]);
|
||||
return $this->_select_one($this->get_table_name(), ['id_user' => $id_user, 'number' => $number]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace models;
|
|||
*/
|
||||
public function delete_group_contact_relations (int $id_group)
|
||||
{
|
||||
return $this->delete('group_contact', ['id_group' => $id_group]);
|
||||
return $this->_delete('group_contact', ['id_group' => $id_group]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -225,10 +225,8 @@ namespace models;
|
|||
* @param string $origin : Number who sent the message
|
||||
* @return array
|
||||
*/
|
||||
public function gets_by_origin_for_user(int $id_user, string $origin)
|
||||
public function gets_by_origin_and_user(int $id_user, string $origin)
|
||||
{
|
||||
$nb_entry = (int) $nb_entry;
|
||||
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM received
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace models;
|
|||
* @param string $number : Number for which we want messages
|
||||
* @return array
|
||||
*/
|
||||
public function get_before_date_for_number_and_user (int $id_user, $date, string $number)
|
||||
public function gets_before_date_for_number_and_user (int $id_user, $date, string $number)
|
||||
{
|
||||
$query = '
|
||||
SELECT *
|
||||
|
|
|
@ -225,10 +225,8 @@ namespace models;
|
|||
* @param string $destination : Number who sent the message
|
||||
* @return array
|
||||
*/
|
||||
public function gets_by_destination_for_user(int $id_user, string $destination)
|
||||
public function gets_by_destination_and_user(int $id_user, string $destination)
|
||||
{
|
||||
$nb_entry = (int) $nb_entry;
|
||||
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM sended
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace models;
|
|||
*/
|
||||
public function get_for_user(int $id_user, int $id)
|
||||
{
|
||||
return $this->_select_one($this->get_table_name(), ['id' => $id]);
|
||||
return $this->_select_one($this->get_table_name(), ['id' => $id, 'id_user' => $id_user]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace models;
|
|||
public function gets_in_for_user(int $id_user, $ids)
|
||||
{
|
||||
$query = '
|
||||
SELECT * FROM ' . $this->get_table_name() . '
|
||||
SELECT * FROM `' . $this->get_table_name() . '`
|
||||
WHERE id_user = :id_user
|
||||
AND id ';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue