modResource.hasChildren
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
$194 per month—let's make that $500!
Learn moremodResource.hasChildren¶
Counts the Resources whose parent is this Resource. Despite the name, the return value is the number of children, not a boolean.
The query is separate from the Children relation, so it always reflects the current database state.
Syntax¶
integer hasChildren ()
Example¶
$resource = $modx->getObject('modResource', array('id' => 5));
if ($resource->hasChildren() > 0) {
echo 'container';
}
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
$194 per month—let's make that $500!
Learn more










