xPDO.getCount

xPDO::getCount

Retrieves a count of xPDOObjects by the specified array or xPDOCriteria.

Syntax

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

integer getCount (string $className, [mixed $criteria = null])

Example

Get a count of all the Box objects with width 20.

$total = $xpdo->getCount('Box',array(
   'width' => 20,
));

See Also

Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab) or become an editor of the MODX Documentation.