Esempio n. 1
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 \gossi\trixionary\model\SkillGroup $obj A \gossi\trixionary\model\SkillGroup 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->getSkillId(), (string) $obj->getGroupId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Esempio n. 2
0
 /**
  * Filter the query by a related \gossi\trixionary\model\SkillGroup object
  *
  * @param \gossi\trixionary\model\SkillGroup|ObjectCollection $skillGroup the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildGroupQuery The current query, for fluid interface
  */
 public function filterBySkillGroup($skillGroup, $comparison = null)
 {
     if ($skillGroup instanceof \gossi\trixionary\model\SkillGroup) {
         return $this->addUsingAlias(GroupTableMap::COL_ID, $skillGroup->getGroupId(), $comparison);
     } elseif ($skillGroup instanceof ObjectCollection) {
         return $this->useSkillGroupQuery()->filterByPrimaryKeys($skillGroup->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySkillGroup() only accepts arguments of type \\gossi\\trixionary\\model\\SkillGroup or Collection');
     }
 }
Esempio n. 3
0
 /**
  * Exclude object from result
  *
  * @param   ChildSkillGroup $skillGroup Object to remove from the list of results
  *
  * @return $this|ChildSkillGroupQuery The current query, for fluid interface
  */
 public function prune($skillGroup = null)
 {
     if ($skillGroup) {
         $this->addCond('pruneCond0', $this->getAliasedColName(SkillGroupTableMap::COL_SKILL_ID), $skillGroup->getSkillId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(SkillGroupTableMap::COL_GROUP_ID), $skillGroup->getGroupId(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }