Example #1
0
 /**
  * Exclude object from result
  *
  * @param   ChildProfileModule $profileModule Object to remove from the list of results
  *
  * @return ChildProfileModuleQuery The current query, for fluid interface
  */
 public function prune($profileModule = null)
 {
     if ($profileModule) {
         $this->addCond('pruneCond0', $this->getAliasedColName(ProfileModuleTableMap::PROFILE_ID), $profileModule->getProfileId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(ProfileModuleTableMap::MODULE_ID), $profileModule->getModuleId(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Example #2
0
 /**
  * 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\ProfileModule $obj A \Thelia\Model\ProfileModule 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->getProfileId(), (string) $obj->getModuleId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Example #3
0
 /**
  * Filter the query by a related \Thelia\Model\ProfileModule object
  *
  * @param \Thelia\Model\ProfileModule|ObjectCollection $profileModule  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildModuleQuery The current query, for fluid interface
  */
 public function filterByProfileModule($profileModule, $comparison = null)
 {
     if ($profileModule instanceof \Thelia\Model\ProfileModule) {
         return $this->addUsingAlias(ModuleTableMap::ID, $profileModule->getModuleId(), $comparison);
     } elseif ($profileModule instanceof ObjectCollection) {
         return $this->useProfileModuleQuery()->filterByPrimaryKeys($profileModule->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByProfileModule() only accepts arguments of type \\Thelia\\Model\\ProfileModule or Collection');
     }
 }