refactoring création fonction select, ajout test pour le order by et group by, ajout group by, ne pas pouvoir sauver si la clef primaire n'est pas définie
This commit is contained in:
@@ -64,16 +64,18 @@ class Model
|
||||
$ret = true;
|
||||
}
|
||||
} else {
|
||||
if (count($this->updated) > 0) {
|
||||
$data = [];
|
||||
$data[$this->pk] = $this->values[$this->pk];
|
||||
foreach ($this->updated as $updatecol) {
|
||||
$data[$updatecol] = $this->values[$updatecol];
|
||||
}
|
||||
$query = $qb->getPreparedQuery($data, false);
|
||||
$ret = $this->db->updateQuery($query);
|
||||
if ($ret) {
|
||||
$this->updated = [];
|
||||
if (isset($this->values[$this->pk])) {
|
||||
if (count($this->updated) > 0) {
|
||||
$data = [];
|
||||
$data[$this->pk] = $this->values[$this->pk];
|
||||
foreach ($this->updated as $updatecol) {
|
||||
$data[$updatecol] = $this->values[$updatecol];
|
||||
}
|
||||
$query = $qb->getPreparedQuery($data, false);
|
||||
$ret = $this->db->updateQuery($query);
|
||||
if ($ret) {
|
||||
$this->updated = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user