|
|
|
|
@ -131,8 +131,8 @@ class Model |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Saves an element into the DB |
|
|
|
|
* |
|
|
|
|
* @param array $values |
|
|
|
|
* @param array $params |
|
|
|
|
* @param bool $show_query Whether to show the query in logs or not (passed to Database::insert()) |
|
|
|
|
* @return bool |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
@ -148,9 +148,9 @@ class Model |
|
|
|
|
|
|
|
|
|
if (!empty($this->required)) { |
|
|
|
|
$require_ok = true; |
|
|
|
|
$kay_params = array_keys($params); |
|
|
|
|
$key_params = array_keys($params); |
|
|
|
|
foreach ($this->required as $field) { |
|
|
|
|
if (!in_array($field, $kay_params)) { |
|
|
|
|
if (!in_array($field, $key_params)) { |
|
|
|
|
$require_ok = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -175,8 +175,7 @@ class Model |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Updates the obj in the database. The $params['id'] must exist in order to update a record |
|
|
|
|
* @param array $values |
|
|
|
|
* |
|
|
|
|
* @param array $params |
|
|
|
|
* @return bool |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
|