예제 #1
0
 /**
  * @param	PageProperty $pageProperty The pageProperty object to add.
  */
 protected function doAddPageProperty($pageProperty)
 {
     $this->collPagePropertys[] = $pageProperty;
     $pageProperty->setPage($this);
 }
예제 #2
0
파일: Page.php 프로젝트: rapila/cms-base
 /**
  * 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();
 }