public function add($aData) { $oModelNavigationResource = new Admin_Model_NavigationResource(); $oModelNavigationOption = new Admin_Model_NavigationOption(); $oGenereteSessionId = new AppCms2_GenereteSessionId(); try { $this->_db->beginTransaction(); $aGenereteSessionId = $oGenereteSessionId->generatePassword(); $sNavigationResource = "menu_resource_{$aData["navigation_module_id"]}_{$aData["navigation_controller_id"]}_{$aData["navigation_action_id"]}_{$aGenereteSessionId["user_password"]}"; $nNavigationResourceId = $oModelNavigationResource->add($sNavigationResource); if (isset($nNavigationResourceId)) { $aData["navigation_resource_id"] = $nNavigationResourceId; $nNavigatinOptionId = $oModelNavigationOption->add($aData); if (isset($nNavigatinOptionId)) { $aData["id"] = (int) $this->getMaxId(); $aData["navigation_option_id"] = $nNavigatinOptionId; $oRow = $this->createRow(); if ($oRow instanceof Zend_Db_Table_Row_Abstract) { $oRow->setFromArray($aData); if ($oRow->save()) { $this->_db->commit(); return $nNavigatinOptionId; } } } } $this->_db->rollBack(); return null; } catch (Zend_Exception $e) { $this->_db->rollBack(); return null; } }