function modcategory_populate_category_children(modCategory &$object) { $children = $object->getMany('Children', null, false); if ($children) { foreach ($children as &$child) { if ($child->get('id') == $object->get('id')) { continue; } modcategory_populate_category_children($child); } } }
/** * @param modCategory $category * * @return array */ protected function _prepareCategoryRow(modCategory $category) { $type = $this->getProperty('type'); $row = array('id' => $category->get('id'), 'name' => $category->get('category'), 'categories' => (int) $category->get('categories'), 'elements' => (int) $category->get('elements')); $row['type'] = 'category'; $row['permissions'] = $this->_permissions; return $row; }