Add create() and delete() to configuration model
This commit is contained in:
@@ -7,6 +7,25 @@
|
|||||||
*/
|
*/
|
||||||
class Configuration extends CI_Model {
|
class Configuration extends CI_Model {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new configuration.
|
||||||
|
*
|
||||||
|
* @param array $data the data of the new configuration
|
||||||
|
* @return bool was the insert successful
|
||||||
|
*/
|
||||||
|
public function create($data) {
|
||||||
|
return $this->db->insert('configurations', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a configuration.
|
||||||
|
* @param string the configuration id to delete
|
||||||
|
* @return bool was the deletion successful
|
||||||
|
*/
|
||||||
|
public function delete($configuration_id) {
|
||||||
|
return $this->db->delete('configurations', array('id' => $configuration_id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a configuration by id.
|
* Get a configuration by id.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user