public static function Field::fromType in Little helpers 7
Same name and namespace in other branches
- 7.2 src/Field/Field.php \Drupal\little_helpers\Field\Field::fromType()
File
- src/
Field/ Field.php, line 40
Class
- Field
- OOP-wrapper for the data-structure used by field_*_field() functions.
Namespace
Drupal\little_helpers\FieldCode
public static function fromType($type, $name = NULL) {
$class = \get_called_class();
$new = new $class(array(
'field_name' => $name,
));
$new
->setType($type);
return $new;
}