Пример #1
0
 /**
  * Filter the query by a related Group object
  *
  * @param   Group|PropelObjectCollection $group The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 UserGroupQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByGroup($group, $comparison = null)
 {
     if ($group instanceof Group) {
         return $this->addUsingAlias(UserGroupPeer::FOS_GROUP_ID, $group->getId(), $comparison);
     } elseif ($group instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(UserGroupPeer::FOS_GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByGroup() only accepts arguments of type Group or PropelCollection');
     }
 }