/** * @param PageProperty $pageProperty The pageProperty object to add. */ protected function doAddPageProperty($pageProperty) { $this->collPagePropertys[] = $pageProperty; $pageProperty->setPage($this); }
/** * Updated page properties: changes them if they exist and creates them otherwise. * @param $sPropertyName the property name * @param $sPropertyValue the new value. Set null if you wish to remove the property */ public function updatePageProperty($sPropertyName, $sPropertyValue) { $oTempProperty = $this->getPagePropertyByName($sPropertyName); if ($oTempProperty !== null) { if ($sPropertyValue === null || $sPropertyValue === '') { $oTempProperty->delete(); return; } $oTempProperty->setValue($sPropertyValue); $oTempProperty->save(); return; } else { if ($sPropertyValue === null || $sPropertyValue === '') { return; } } $oTempProperty = new PageProperty(); $oTempProperty->setName($sPropertyName); $oTempProperty->setValue($sPropertyValue); $oTempProperty->setPage($this); $this->addPageProperty($oTempProperty); $oTempProperty->save(); }