/** * Updates the record * * @return bool */ protected function updateStateToDb() { $bitReturn = parent::updateStateToDb(); if ($this->bitOnReadTrigger && $this->getStrMessageProvider() != "") { $this->bitOnReadTrigger = false; $strHandler = $this->getStrMessageProvider(); /** @var $objHandler interface_messageprovider */ $objHandler = new $strHandler(); $objHandler->onSetRead($this); } return $bitReturn; }
protected function updateStateToDb() { //check if its a valid package if (uniSubstr($this->getStrFilename(), -4) == ".zip") { $this->updatePackageInformation(); } return parent::updateStateToDb(); }
/** * Updates the current object to the database * * @return bool */ protected function updateStateToDb() { //Make texts db-safe $strName = $this->generateNonexistingPagename($this->getStrName()); $this->setStrName($strName); //create change-logs $objChanges = new class_module_system_changelog(); $objChanges->createLogEntry($this, class_module_system_changelog::$STR_ACTION_EDIT); $this->updatePath(); //Update the baserecord $bitBaseUpdate = parent::updateStateToDb(); //and the properties record //properties for this language already existing? $strCountQuery = "SELECT COUNT(*)\n FROM " . _dbprefix_ . "page_properties\n\t\t WHERE pageproperties_id= ?\n\t\t AND pageproperties_language= ?"; $arrCountRow = $this->objDB->getPRow($strCountQuery, array($this->getSystemid(), $this->getStrLanguage()), 0, false); if ((int) $arrCountRow["COUNT(*)"] >= 1) { //Already existing, updating properties $strQuery2 = "UPDATE " . _dbprefix_ . "page_properties\n \t\t\t\t\tSET pageproperties_description=?,\n \t\t\t\t\t\tpageproperties_template=?,\n \t\t\t\t\t\tpageproperties_keywords=?,\n \t\t\t\t\t\tpageproperties_browsername=?,\n \t\t\t\t\t\tpageproperties_seostring=?,\n \t\t\t\t\t\tpageproperties_alias=?,\n \t\t\t\t\t\tpageproperties_target=?,\n pageproperties_path=?\n \t\t\t\t WHERE pageproperties_id=?\n \t\t\t\t AND pageproperties_language=?"; $arrParams = array($this->getStrDesc(), $this->getStrTemplate(), $this->getStrKeywords(), $this->getStrBrowsername(), $this->getStrSeostring(), $this->getStrAlias(), $this->getStrTarget(), $this->getStrPath(), $this->getSystemid(), $this->getStrLanguage()); } else { //Not existing, create one $strQuery2 = "INSERT INTO " . _dbprefix_ . "page_properties\n\t\t\t\t\t\t(pageproperties_id, pageproperties_keywords, pageproperties_description, pageproperties_template, pageproperties_browsername,\n\t\t\t\t\t\t pageproperties_seostring, pageproperties_alias, pageproperties_target, pageproperties_language, pageproperties_path) VALUES\n\t\t\t\t\t\t(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $arrParams = array($this->getSystemid(), $this->getStrKeywords(), $this->getStrDesc(), $this->getStrTemplate(), $this->getStrBrowsername(), $this->getStrSeostring(), $this->getStrAlias(), $this->getStrTarget(), $this->getStrLanguage(), $this->getStrPath()); } $bitBaseUpdate = $bitBaseUpdate && $this->objDB->_pQuery($strQuery2, $arrParams); $arrChildIds = $this->getChildNodesAsIdArray(); foreach ($arrChildIds as $strChildId) { $objInstance = class_objectfactory::getInstance()->getObject($strChildId); $objInstance->updateObjectToDb(); } return $bitBaseUpdate; }
/** * saves the current object with all its params back to the database * * @return bool */ protected function updateStateToDb() { //if no other aspect exists, we have a new default aspect if (class_module_system_aspect::getObjectCount() == 0) { $this->setBitDefault(1); } if ($this->getBitDefault() == 1) { self::resetDefaultAspect(); } return parent::updateStateToDb(); }
/** * saves the current object with all its params back to the database * * @return bool */ protected function updateStateToDb() { //if no other language exists, we have a new default language $arrObjLanguages = class_module_languages_language::getObjectList(); if (count($arrObjLanguages) == 0) { $this->setBitDefault(1); } if ($this->getBitDefault() == 1) { self::resetAllDefaultLanguages(); } return parent::updateStateToDb(); }