/** * Initializes the leaf * Passes the Parameters to its child leafs * * @param int $index Index of this leaf * @param array $parentIndices Array with parent indices * * @return void */ public function init($index, array $parentIndices = array()) { if (!is_numeric($index) || !is_array($parentIndices)) { if (TYPO3_DLOG) { \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('init (Tx_Commerce_Tree_Leaf_Slave) gets passed invalid parameters.', COMMERCE_EXTKEY, 3); } return; } // Initialize the Tx_Commerce_Tree_Leaf_Data $this->data->init(); $this->data->initRecords($index, $parentIndices, $this->parentLeaf->data); parent::init($index, $parentIndices); }
/** * Returns whether or not a node has Children * * @param array $row Row Item * * @return bool */ public function hasChildren(array $row) { if (!is_array($row)) { if (TYPO3_DLOG) { GeneralUtility::devLog('hasChildren (Tx_Commerce_Tree_Leaf_Master) gets passed invalid parameters.', COMMERCE_EXTKEY, 3); } return FALSE; } $hasChildren = $this->data->getChildrenByPid($row['uid']); // if current item doesn't have subchildren, look in slaveLeafs if (!$hasChildren) { $hasChildren = parent::hasChildren($row); } return $hasChildren; }