/** * Get a field of given entity. * * @param BaseForm $entity * @param string $fieldId * * @return \Kalnoy\Cruddy\Contracts\Field */ protected function findField($entity, $fieldId) { $field = $entity->getFields()->get($fieldId); if (!$field) { throw new RuntimeException("The field [{$entity->getId()}.{$fieldId}] is not defined."); } return $field; }
/** * Process the data. * * @param array $data */ protected function process(array $data) { $this->input = $this->form->getFields()->process($data); }