示例#1
0
文件: JudgeQuery.php 项目: iuf/junia
 /**
  * Filter the query by a related \keeko\core\model\User object
  *
  * @param \keeko\core\model\User|ObjectCollection $user The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildJudgeQuery The current query, for fluid interface
  */
 public function filterByUser($user, $comparison = null)
 {
     if ($user instanceof \keeko\core\model\User) {
         return $this->addUsingAlias(JudgeTableMap::COL_USER_ID, $user->getId(), $comparison);
     } elseif ($user instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(JudgeTableMap::COL_USER_ID, $user->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByUser() only accepts arguments of type \\keeko\\core\\model\\User or Collection');
     }
 }