/**
  * 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 you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by find*()
  * and findPk*() calls.
  *
  * @param \Thelia\Model\FolderVersion $obj A \Thelia\Model\FolderVersion 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 (null === $key) {
             $key = serialize(array((string) $obj->getId(), (string) $obj->getVersion()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Example #2
0
 /**
  * Filter the query by a related \Thelia\Model\FolderVersion object
  *
  * @param \Thelia\Model\FolderVersion|ObjectCollection $folderVersion  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildFolderQuery The current query, for fluid interface
  */
 public function filterByFolderVersion($folderVersion, $comparison = null)
 {
     if ($folderVersion instanceof \Thelia\Model\FolderVersion) {
         return $this->addUsingAlias(FolderTableMap::ID, $folderVersion->getId(), $comparison);
     } elseif ($folderVersion instanceof ObjectCollection) {
         return $this->useFolderVersionQuery()->filterByPrimaryKeys($folderVersion->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByFolderVersion() only accepts arguments of type \\Thelia\\Model\\FolderVersion or Collection');
     }
 }
Example #3
0
 /**
  * Sets the properties of the current object to the value they had at a specific version
  *
  * @param ChildFolderVersion $version The version object to use
  * @param ConnectionInterface   $con the connection to use
  * @param array                 $loadedObjects objects that been loaded in a chain of populateFromVersion calls on referrer or fk objects.
  *
  * @return ChildFolder The current object (for fluent API support)
  */
 public function populateFromVersion($version, $con = null, &$loadedObjects = array())
 {
     $loadedObjects['ChildFolder'][$version->getId()][$version->getVersion()] = $this;
     $this->setId($version->getId());
     $this->setParent($version->getParent());
     $this->setVisible($version->getVisible());
     $this->setPosition($version->getPosition());
     $this->setCreatedAt($version->getCreatedAt());
     $this->setUpdatedAt($version->getUpdatedAt());
     $this->setVersion($version->getVersion());
     $this->setVersionCreatedAt($version->getVersionCreatedAt());
     $this->setVersionCreatedBy($version->getVersionCreatedBy());
     return $this;
 }
Example #4
0
 /**
  * Exclude object from result
  *
  * @param   ChildFolderVersion $folderVersion Object to remove from the list of results
  *
  * @return ChildFolderVersionQuery The current query, for fluid interface
  */
 public function prune($folderVersion = null)
 {
     if ($folderVersion) {
         $this->addCond('pruneCond0', $this->getAliasedColName(FolderVersionTableMap::ID), $folderVersion->getId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(FolderVersionTableMap::VERSION), $folderVersion->getVersion(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }