public function createFromField($field, $value = null)
    {
        if (!is_array($field)) {
            return new NullField;
        }

        if ($value !== null) {
            $field['value'] = $value;
        }

        return $this->resolve($field['type'], $field);
    }
public function createFromField($field, $value = null)
    {
        if (!is_array($field)) {
            return new NullField;
        }

        if ($value !== null) {
            $field['value'] = $value;
        }

        return $this->resolve($field['type'], $field);
    }
public function createFromField ( $ field , $ value = null ) { if ( ! is_array ( $ field ) ) { return new NullField ; } if ( $ value !== null ) { $ field [ 'value' ] = $ value ; } return $ this -> resolve ( $ field [ 'type' ] , $ field ) ; }
Create a new custom field object from an existing set of field data.

If the field is not registered, a `\Tev\Field\Model\NullField` will be
returned.

@param  array                          $field Field data array
@param  mixed                          $value If supplied, will be set as the fields value
@return \Tev\Field\Model\AbstractField        Field object

@throws \Exception If field type is not registered
Create a new custom field object from an existing set of field data .