示例#1
0
 /**
  * Remove skill of this object
  * through the kk_trixionary_skill_group cross reference table.
  *
  * @param ChildSkill $skill
  * @return ChildGroup The current object (for fluent API support)
  */
 public function removeSkill(ChildSkill $skill)
 {
     if ($this->getSkills()->contains($skill)) {
         $skillGroup = new ChildSkillGroup();
         $skillGroup->setSkill($skill);
         if ($skill->isGroupsLoaded()) {
             //remove the back reference if available
             $skill->getGroups()->removeObject($this);
         }
         $skillGroup->setGroup($this);
         $this->removeSkillGroup(clone $skillGroup);
         $skillGroup->clear();
         $this->collSkills->remove($this->collSkills->search($skill));
         if (null === $this->skillsScheduledForDeletion) {
             $this->skillsScheduledForDeletion = clone $this->collSkills;
             $this->skillsScheduledForDeletion->clear();
         }
         $this->skillsScheduledForDeletion->push($skill);
     }
     return $this;
 }
示例#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 \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;
     }
 }
示例#3
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 ChildSkillQuery The current query, for fluid interface
  */
 public function filterBySkillGroup($skillGroup, $comparison = null)
 {
     if ($skillGroup instanceof \gossi\trixionary\model\SkillGroup) {
         return $this->addUsingAlias(SkillTableMap::COL_ID, $skillGroup->getSkillId(), $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');
     }
 }
示例#4
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;
 }