mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
revert unwanted change to publics/User, fix errors phone & Settings
This commit is contained in:
parent
6d9b1289fd
commit
18c7cb019d
7 changed files with 47 additions and 11 deletions
|
@ -24,6 +24,18 @@ namespace controllers\internals;
|
|||
$this->model = $this->model ?? new \models\Phone($this->bdd);
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a phone by his number
|
||||
* @param string $number : Phone number
|
||||
* @return array
|
||||
*/
|
||||
public function get_by_number(string $number)
|
||||
{
|
||||
return $this->get_model()->get_by_number($number);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a phone for a user by a number
|
||||
|
@ -33,7 +45,7 @@ namespace controllers\internals;
|
|||
*/
|
||||
public function get_by_number_and_user(int $id_user, string $number)
|
||||
{
|
||||
return $this->model_phone->get_by_number_and_user($id_user, $number);
|
||||
return $this->get_model()->get_by_number_and_user($id_user, $number);
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,7 +66,7 @@ namespace controllers\internals;
|
|||
'adapter_datas' => $adapter_datas,
|
||||
];
|
||||
|
||||
return (bool) $this->model_phone->insert($phone);
|
||||
return (bool) $this->get_model()->insert($phone);
|
||||
}
|
||||
|
||||
|
||||
|
@ -76,6 +88,6 @@ namespace controllers\internals;
|
|||
'adapter_datas' => json_encode($adapter_datas),
|
||||
];
|
||||
|
||||
return (bool) $this->model_phone->update_for_user($id_user, $id, $phone);
|
||||
return (bool) $this->get_model()->update_for_user($id_user, $id, $phone);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,9 +54,9 @@ namespace controllers\internals;
|
|||
*/
|
||||
public function update_for_user (int $id_user, string $name, $value) : bool
|
||||
{
|
||||
return (bool) $this->get_model()->update($id_user, $name, $value);
|
||||
return (bool) $this->get_model()->update_by_name_for_user($id_user, $name, $value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a new setting
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue