/** * Return the current junction row. * * Similar to the current() function for arrays in PHP * Required by interface Iterator. * * @return Zend_Db_Table_Row_Abstract current element from the collection */ public function currentJunction() { // the following block ensures that the order returned by the junction look does not matter $curMatch = $this->current(); $value = $curMatch[$this->_referenceMap['refColumns'][0]]; // @todo: compound keys $index = array_search($value, $this->_junctionRowsetIndex); $this->_junctionRowset->seek($index); return $this->_junctionRowset->current(); }
/** * moveSubtree * @param integer $intNodeId * @param integer $intDestination * @param integer $intDestinationDepth * @author Thomas Schedler <*****@*****.**> * @version 1.0 */ private function moveSubtree($intNodeId, $intDestination, $intDestinationDepth) { try { $this->intNodeId = $intNodeId; $this->loadNodeData(); if ($this->objNodeData instanceof Zend_Db_Table_Rowset_Abstract && count($this->objNodeData) > 0) { $arrNode = $this->objNodeData->current()->toArray(); $intTreeSize = $arrNode[$this->strDBFRgt] - $arrNode[$this->strDBFLft] + 1; $this->shiftLRValues($intDestination, $intTreeSize); if ($arrNode[$this->strDBFLft] >= $intDestination) { $arrNode[$this->strDBFLft] += $intTreeSize; $arrNode[$this->strDBFRgt] += $intTreeSize; } $intDepthDiff = $intDestinationDepth - $arrNode[$this->strDBFDepth]; $this->shiftLRRange($arrNode[$this->strDBFLft], $arrNode[$this->strDBFRgt], $intDestination - $arrNode[$this->strDBFLft], $intDepthDiff); $this->shiftLRValues($arrNode[$this->strDBFRgt] + 1, -$intTreeSize); } } catch (Exception $exc) { $this->core->logger->err($exc); } }