You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found one thing that I really miss, is the max function, instead of using a raw query it could be already in your ORM… so I implemented it quickly:
/**
* Tell the ORM that you wish to execute a MAX query.
* Will return the max value of the choosen column.
*/
public function max($column) {
$this->select_expr('MAX('.$column.')', 'maxvalue');
$result = $this->find_one();
return ($result !== false && isset($result->maxvalue)) ? (int) $result->maxvalue : 0;
}
I only tested it in MySQL…
The text was updated successfully, but these errors were encountered:
From Sérgio Diniz (by email):
The text was updated successfully, but these errors were encountered: