public function getQuestionAnswer($side, $question_id) { foreach ($this->{$side . '_answers'} as $answer) { if ($answer->question_id == $question_id) { return $answer->answer; } } }