Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * [getResourceChildren description]
- * @param integer $id Container ID
- * @return array An array of container children
- */
- function getResourceChildren($id) {
- $result = array();
- $success = false;
- $q = $modx->newQuery('modResource');
- $q->where(array('parent' => $id, 'deleted' => false, 'published' => true));
- $q->select(array('id','pagetitle','uri'));
- $q->sortby('pagetitle','ASC');
- if ($q->prepare() && $q->stmt->execute()) {
- $result = $q->stmt->fetchAll(PDO::FETCH_ASSOC);
- if (count($result)) $success = true;
- }
- return $success ? $result : $success;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement