MODX Cloud

The Most Productive MODX Learning Playground Ever

Claim Free Lab Account

xPDO.newQuery

Skip to end of metadata
Go to start of metadata


xPDO::newQuery

Creates an new xPDOQuery for a specified xPDOObject class.

Syntax

API Docs: http://api.modxcms.com/xpdo/xPDO.html#newQuery

xPDOQuery newQuery (string $class, [mixed $criteria = null], [boolean|integer $cacheFlag = true])

Examples

Create a new Query for the Box object:

$xpdo->newQuery('Box');

Create a new Query for the Box object, but already add a WHERE clause limiting to Boxes with width greater than 10:

$xpdo->newQuery('Box',array(
   'width:>' => 10,
));

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.