Esempio n. 1
0
 /**
  * Filter the query by a related \keeko\core\model\GroupAction object
  *
  * @param \keeko\core\model\GroupAction|ObjectCollection $groupAction the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildActionQuery The current query, for fluid interface
  */
 public function filterByGroupAction($groupAction, $comparison = null)
 {
     if ($groupAction instanceof \keeko\core\model\GroupAction) {
         return $this->addUsingAlias(ActionTableMap::COL_ID, $groupAction->getActionId(), $comparison);
     } elseif ($groupAction instanceof ObjectCollection) {
         return $this->useGroupActionQuery()->filterByPrimaryKeys($groupAction->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByGroupAction() only accepts arguments of type \\keeko\\core\\model\\GroupAction or Collection');
     }
 }
Esempio n. 2
0
 /**
  * Remove group of this object
  * through the kk_group_action cross reference table.
  *
  * @param ChildGroup $group
  * @return ChildAction The current object (for fluent API support)
  */
 public function removeGroup(ChildGroup $group)
 {
     if ($this->getGroups()->contains($group)) {
         $groupAction = new ChildGroupAction();
         $groupAction->setGroup($group);
         if ($group->isActionsLoaded()) {
             //remove the back reference if available
             $group->getActions()->removeObject($this);
         }
         $groupAction->setAction($this);
         $this->removeGroupAction(clone $groupAction);
         $groupAction->clear();
         $this->collGroups->remove($this->collGroups->search($group));
         if (null === $this->groupsScheduledForDeletion) {
             $this->groupsScheduledForDeletion = clone $this->collGroups;
             $this->groupsScheduledForDeletion->clear();
         }
         $this->groupsScheduledForDeletion->push($group);
     }
     return $this;
 }
Esempio n. 3
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 \keeko\core\model\GroupAction $obj A \keeko\core\model\GroupAction 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->getGroupId(), (string) $obj->getActionId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Esempio n. 4
0
 /**
  * Exclude object from result
  *
  * @param   ChildGroupAction $groupAction Object to remove from the list of results
  *
  * @return $this|ChildGroupActionQuery The current query, for fluid interface
  */
 public function prune($groupAction = null)
 {
     if ($groupAction) {
         $this->addCond('pruneCond0', $this->getAliasedColName(GroupActionTableMap::COL_GROUP_ID), $groupAction->getGroupId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(GroupActionTableMap::COL_ACTION_ID), $groupAction->getActionId(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }