/** * Gets all the node content items that sit under a parent ID. * * @param int $parent * @return DataObjectSet */ public function getItemsByParentId($parentID = null) { $result = new ArrayList(); if (!$this->isValid()) { return $result; } if ($parentID == null) { $items = $this->getMenu(); } else { $menuLink = $this->getMenuLink($this->parseID($parentID)); $items = $menuLink['children']; } if ($items) { foreach ($items as $item) { $result->push(DrupalMenuLinkContentItem::factory($this, $item)); } } // TODO: load children if path is a taxonomy node return $result; }
protected function createContentItem($item) { if (!isset($item['link'])) { return NULL; } $linkData = $item['link']; $menuLinkID = $linkData['mlid']; if (isset($linkData['path']) && strlen($linkData['path']) > 5 && substr($linkData['path'], 0, 5) == 'node/') { $nodeId = substr($linkData['path'], 5); $nodeData = $this->getNode($this->encodeId($nodeId)); return DrupalNodeContentItem::factory($this, array('link' => $linkData, 'node' => $nodeData)); } else { return DrupalMenuLinkContentItem::factory($this, array('link' => $linkData)); } }