/** * Создать sfGuardGroupPermission */ public function makeGuardGroupPermission(sfGuardGroup $group, sfGuardPermission $permission, $save = false, array $props = array()) { $defaultProps = array('group_id' => $group->getId(), 'permission_id' => $permission->getId()); $props = array_merge($defaultProps, $props); return $this->makeModel('sfGuardGroupPermission', $props, $save); }
/** * 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 -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param sfGuardGroup $value A sfGuardGroup object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(sfGuardGroup $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
/** * Declares an association between this object and a sfGuardGroup object. * * @param sfGuardGroup $v * @return sfGuardUserGroup The current object (for fluent API support) * @throws PropelException */ public function setsfGuardGroup(sfGuardGroup $v = null) { if ($v === null) { $this->setGroupId(NULL); } else { $this->setGroupId($v->getId()); } $this->asfGuardGroup = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the sfGuardGroup object, it will not be re-added. if ($v !== null) { $v->addsfGuardUserGroup($this); } return $this; }
/** * Exclude object from result * * @param sfGuardGroup $sfGuardGroup Object to remove from the list of results * * @return sfGuardGroupQuery The current query, for fluid interface */ public function prune($sfGuardGroup = null) { if ($sfGuardGroup) { $this->addUsingAlias(sfGuardGroupPeer::ID, $sfGuardGroup->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Filter the query by a related sfGuardGroup object * * @param sfGuardGroup|PropelObjectCollection $sfGuardGroup The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return sfGuardUserGroupQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterBysfGuardGroup($sfGuardGroup, $comparison = null) { if ($sfGuardGroup instanceof sfGuardGroup) { return $this->addUsingAlias(sfGuardUserGroupPeer::GROUP_ID, $sfGuardGroup->getId(), $comparison); } elseif ($sfGuardGroup instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(sfGuardUserGroupPeer::GROUP_ID, $sfGuardGroup->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBysfGuardGroup() only accepts arguments of type sfGuardGroup or PropelCollection'); } }
/** * Filter the query by a related sfGuardGroup object * * @param sfGuardGroup $sfGuardGroup the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return sfGuardGroupPermissionQuery The current query, for fluid interface */ public function filterBysfGuardGroup($sfGuardGroup, $comparison = null) { return $this->addUsingAlias(sfGuardGroupPermissionPeer::GROUP_ID, $sfGuardGroup->getId(), $comparison); }