Пример #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 \keeko\core\model\UserGroup $obj A \keeko\core\model\UserGroup 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->getUserId(), (string) $obj->getGroupId()));
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Пример #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildUserGroup $userGroup Object to remove from the list of results
  *
  * @return $this|ChildUserGroupQuery The current query, for fluid interface
  */
 public function prune($userGroup = null)
 {
     if ($userGroup) {
         $this->addCond('pruneCond0', $this->getAliasedColName(UserGroupTableMap::COL_USER_ID), $userGroup->getUserId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(UserGroupTableMap::COL_GROUP_ID), $userGroup->getGroupId(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Пример #3
0
 /**
  * Filter the query by a related \keeko\core\model\UserGroup object
  *
  * @param \keeko\core\model\UserGroup|ObjectCollection $userGroup the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildUserQuery The current query, for fluid interface
  */
 public function filterByUserGroup($userGroup, $comparison = null)
 {
     if ($userGroup instanceof \keeko\core\model\UserGroup) {
         return $this->addUsingAlias(UserTableMap::COL_ID, $userGroup->getUserId(), $comparison);
     } elseif ($userGroup instanceof ObjectCollection) {
         return $this->useUserGroupQuery()->filterByPrimaryKeys($userGroup->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByUserGroup() only accepts arguments of type \\keeko\\core\\model\\UserGroup or Collection');
     }
 }