public static function Instance::fromField in Little helpers 7
Same name and namespace in other branches
- 7.2 src/Field/Instance.php \Drupal\little_helpers\Field\Instance::fromField()
1 call to Instance::fromField()
- Instance::fromNames in src/
Field/ Instance.php
File
- src/
Field/ Instance.php, line 42
Class
Namespace
Drupal\little_helpers\FieldCode
public static function fromField(Field $field, BundleInterface $bundle = NULL, $data = array()) {
$data = array(
'field' => $field,
'bundle' => $bundle,
) + $data;
$class = \get_called_class();
$instance = new $class($data);
return $instance;
}