コード例 #1
0
 /**
  * Filter the query by a related \Questions object
  *
  * @param \Questions|ObjectCollection $questions The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildResponsesQuery The current query, for fluid interface
  */
 public function filterByQuestions($questions, $comparison = null)
 {
     if ($questions instanceof \Questions) {
         return $this->addUsingAlias(ResponsesTableMap::COL_QUESTION_ID, $questions->getId(), $comparison);
     } elseif ($questions instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ResponsesTableMap::COL_QUESTION_ID, $questions->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByQuestions() only accepts arguments of type \\Questions or Collection');
     }
 }