/**
  * 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');
     }
 }
 /**
  * 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;
 }
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aExperts) {
         $this->aExperts->removeExpertQuestionState($this);
     }
     if (null !== $this->aQuestions) {
         $this->aQuestions->removeExpertQuestionState($this);
     }
     $this->username = null;
     $this->question_id = null;
     $this->is_read = null;
     $this->is_responded = null;
     $this->is_expunged = null;
     $this->is_muted = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Esempio n. 4
0
 /**
  * @depends testAddQuestion
  */
 public function testAddResponse(Questions $question)
 {
     $response = $this->api->addResponse($question->getId(), "test@nowhere.com", "The red pill of course!");
     \PHPUnit_Framework_Assert::assertNotNull($response);
 }
Esempio n. 5
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aExperts) {
         $this->aExperts->removeResponses($this);
     }
     if (null !== $this->aQuestions) {
         $this->aQuestions->removeResponses($this);
     }
     $this->id = null;
     $this->expert = null;
     $this->question_id = null;
     $this->created = null;
     $this->response = null;
     $this->votes = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }