mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-05 22:36:26 +02:00
Update all controllers get_model
This commit is contained in:
parent
bc622285a4
commit
27d2a6c5b2
14 changed files with 69 additions and 40 deletions
|
@ -25,20 +25,6 @@ namespace controllers\internals;
|
|||
abstract protected function get_model () : \descartes\Model;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new entry
|
||||
* @return mixed bool|int : False if cannot create entry, id of the new entry else
|
||||
*/
|
||||
abstract public function create();
|
||||
|
||||
|
||||
/**
|
||||
* Update a entry
|
||||
* @return mixed bool|int : False if cannot update entry, number of modified rows else
|
||||
*/
|
||||
abstract public function update_for_user();
|
||||
|
||||
|
||||
/**
|
||||
* Return a entry by his id
|
||||
* @param int $id : Entry id
|
||||
|
@ -75,18 +61,6 @@ namespace controllers\internals;
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert a entry
|
||||
* @param
|
||||
* @param array $entry : Entry to insert
|
||||
* @return mixed bool|int : false on error, new entry id else
|
||||
*/
|
||||
public function create ($entry)
|
||||
{
|
||||
$result = $this->get_model()->insert($entry);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a entry by his id for a user
|
||||
* @param int $id_user : User id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue