/** * @param IRSVP $rsvp * @param IRSVPQuestionTemplate $question * @param IRSVPAnswer $answer * @return FormField */ public function build(IRSVP $rsvp, IRSVPQuestionTemplate $question, IRSVPAnswer $answer) { $field = new TextareaField($question->name(), $question->label()); $field->setValue($question->initialValue()); $field->setColumns(50); if ($question->isReadOnly()) { $field->setDisabled(true); } if ($question->isMandatory()) { $field->setAttribute('data-rule-required', 'true'); } if (!is_null($answer)) { $field->setValue($answer->value()); } return $this->buildDependantRules($rsvp, $question, $field); }