/** * Add row * * @param Core_Categories_Row $row * @return self */ public function addRow(Core_Categories_Row $row) { $this->_data[] = $row->toArray(); if ($this->_count == count($this->_rows)) { $this->_rows[] = $row; } // set the count of rows $this->_count = count($this->_data); return $this; }
/** * Add child * * @param \Core_Categories_Row|self $row * @throws Zend_Db_Table_Row_Exception * @return self */ public function addChild(Core_Categories_Row $row) { if (empty($this->_cleanData)) { throw new Zend_Db_Table_Row_Exception('Parent category is not created yet'); } if ($row->getParentNodeId() != $this->getNodeId()) { $row->setParentNode($this->getNodeId()); } $this->getChildren()->addRow($row); return $this; }
/** * Add child * * @param Core_Categories_Row $row * @throws Zend_Db_Table_Row_Exception * @return Categories_Model_Category */ public function addChild(Core_Categories_Row $row) { if (!$this->_children) { $data = array('table' => $this->getTable(), 'data' => array(), 'readOnly' => false, 'rowClass' => __CLASS__, 'stored' => true); $rowsetClass = $this->getTable()->getRowsetClass(); $this->_children = new $rowsetClass($data); } parent::addChild($row); return $this; }