/** * Take all fields from object based on scenario * @return array Array of fields that must be in the form */ protected function getFieldsBasedOnScenario() { $scenarios = $this->model->scenarios(); return $scenarios[$this->model->scenario]; }