/** * Add a temporary page property to the page for the duration of the request. */ public function addTempPageProperty($sName, $sValue) { // Make sure the page properties are loaded so we won’t override them later on $this->getPageProperties(); $oTempProperty = new PageProperty(); $oTempProperty->setName($sName); $oTempProperty->setValue($sValue); $oTempProperty->bIsTemp = true; $this->addPageProperty($oTempProperty); }
private function handlePageProperties($aPageData) { foreach ($this->oPage->getPagePropertyQuery()->byNamespace(false)->find() as $oProperty) { $oProperty->delete(); } // set valid posted page properties if (!isset($aPageData['page_properties']['page_identifier'])) { $this->oPage->setIdentifier(null); } foreach ($aPageData['page_properties'] as $sName => $sValue) { if ($sName === 'page_identifier') { $this->oPage->setIdentifier($sValue ? $sValue : null); } else { if (trim($sValue) !== '') { $oPageProperty = new PageProperty(); $oPageProperty->setName($sName); $oPageProperty->setValue($sValue); $this->oPage->addPageProperty($oPageProperty); } } } }