xPDO.expression
Last updated not available | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn morexPDO::expression¶
Creates an xPDO\Om\xPDOExpression that wraps a raw SQL fragment. The fragment is inlined verbatim wherever the expression is accepted by xPDOQuery, bypassing parameter binding and the injection check applied to plain strings.
[!WARNING] The expression is embedded into the generated SQL without quoting or escaping. Never pass user-supplied input to this method.
Syntax¶
xPDO\Om\xPDOExpression expression (string $expr)
Example¶
$now = $xpdo->expression('NOW()');
$query = $xpdo->newQuery('modResource');
$query->where(array(
'createdon:<=' => $now,
));
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn more










