mirror of
https://codeberg.org/vlw/scaffold.git
synced 2026-01-12 06:26:01 +01:00
fix: return passed value when setting db row value
This commit is contained in:
parent
2f6e24b0a1
commit
509500fff8
1 changed files with 5 additions and 3 deletions
|
|
@ -97,14 +97,16 @@
|
||||||
*
|
*
|
||||||
* @param string $key Target column to update
|
* @param string $key Target column to update
|
||||||
* @param mixed $value New value of target column
|
* @param mixed $value New value of target column
|
||||||
* @return bool Update was successful
|
* @return mixed The value that was sent to $value
|
||||||
*/
|
*/
|
||||||
public function set(string $key, mixed $value): bool {
|
public function set(string $key, mixed $value): mixed {
|
||||||
$this->_row[$key] = $value;
|
$this->_row[$key] = $value;
|
||||||
|
|
||||||
return $this->db
|
$this->db
|
||||||
->from($this->table)
|
->from($this->table)
|
||||||
->where($this->where)
|
->where($this->where)
|
||||||
->update([$key => $value]);
|
->update([$key => $value]);
|
||||||
|
|
||||||
|
return $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue