Expression shorthands
experiment k !21 (comment 87753)
// expr() shorthand
$year = static fn(Expression $e) => expr(new IntType(), "EXTRACT('year' FROM ?)", $e);
$table–>findBy([
$table->value()->is(greaterThanOrEqualTo(42)),
$year($table->issuedAt())->is(equalTo(2021)), // all expressions have is() method
], orderBy: [
$table->value()->descending(), // all expressions have ascending()/descending() methods
]);
Edited by Jiří Pudil