Example #1
0
 /**
  * Get the answer from a particular user to this question, if any.
  *
  * @param Profile $profile
  *
  * @return Answer object or null
  */
 function getAnswer(Profile $profile)
 {
     $a = new QnA_Answer();
     $a->question_id = $this->id;
     $a->profile_id = $profile->id;
     $a->find();
     if ($a->fetch()) {
         return $a;
     } else {
         return null;
     }
 }