Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * Process the data.
  *
  * @param array $data
  */
 protected function process(array $data)
 {
     $this->input = $this->form->getFields()->process($data);
 }