Exemple #1
0
 /**
  * @param	PageProperty $pageProperty The pageProperty object to add.
  */
 protected function doAddPageProperty($pageProperty)
 {
     $this->collPagePropertys[] = $pageProperty;
     $pageProperty->setPage($this);
 }
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'id', 'type' => TType::STRUCT, 'class' => 'PageID'), 2 => array('var' => 'property', 'type' => TType::STRUCT, 'class' => 'PagePropertyValue'));
     }
     if (is_array($vals)) {
         if (isset($vals['id'])) {
             $this->id = $vals['id'];
         }
         if (isset($vals['property'])) {
             $this->property = $vals['property'];
         }
     }
 }
Exemple #3
0
 /**
  * Filter the query by a related PageProperty object
  *
  * @param   PageProperty|PropelObjectCollection $pageProperty  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 PageQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByPageProperty($pageProperty, $comparison = null)
 {
     if ($pageProperty instanceof PageProperty) {
         return $this->addUsingAlias(PagePeer::ID, $pageProperty->getPageId(), $comparison);
     } elseif ($pageProperty instanceof PropelObjectCollection) {
         return $this->usePagePropertyQuery()->filterByPrimaryKeys($pageProperty->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPageProperty() only accepts arguments of type PageProperty or PropelCollection');
     }
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param PageProperty $obj A PageProperty object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         PagePropertyPeer::$instances[$key] = $obj;
     }
 }
 /**
  * Exclude object from result
  *
  * @param   PageProperty $pageProperty Object to remove from the list of results
  *
  * @return PagePropertyQuery The current query, for fluid interface
  */
 public function prune($pageProperty = null)
 {
     if ($pageProperty) {
         $this->addUsingAlias(PagePropertyPeer::ID, $pageProperty->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Exemple #6
0
 /**
  * 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);
             }
         }
     }
 }