/** * 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'); } }
/** * @depends testAddQuestion */ public function testAddResponse(Questions $question) { $response = $this->api->addResponse($question->getId(), "*****@*****.**", "The red pill of course!"); \PHPUnit_Framework_Assert::assertNotNull($response); }
/** * Exclude object from result * * @param ChildQuestions $questions Object to remove from the list of results * * @return $this|ChildQuestionsQuery The current query, for fluid interface */ public function prune($questions = null) { if ($questions) { $this->addUsingAlias(QuestionsTableMap::COL_ID, $questions->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildQuestions object. * * @param ChildQuestions $v * @return $this|\ExpertQuestionState The current object (for fluent API support) * @throws PropelException */ public function setQuestions(ChildQuestions $v = null) { if ($v === null) { $this->setQuestionId(NULL); } else { $this->setQuestionId($v->getId()); } $this->aQuestions = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildQuestions object, it will not be re-added. if ($v !== null) { $v->addExpertQuestionState($this); } return $this; }