protected function EntityFormField::getBundleFieldDefinition in Views Entity Form Field 8
Collects the definition of field.
Parameters
string $bundle: The bundle to load the field definition for.
Return value
\Drupal\Core\Field\FieldDefinitionInterface|null The field definition. Null if not set.
4 calls to EntityFormField::getBundleFieldDefinition()
- EntityFormField::buildOptionsForm in src/
Plugin/ views/ field/ EntityFormField.php - Default options form that provides the label widget that all fields should have.
- EntityFormField::calculateDependencies in src/
Plugin/ views/ field/ EntityFormField.php - Calculates dependencies for the configured plugin.
- EntityFormField::getCacheTags in src/
Plugin/ views/ field/ EntityFormField.php - The cache tags associated with this object.
- EntityFormField::getPluginInstance in src/
Plugin/ views/ field/ EntityFormField.php - Gets a bundle-specific field widget instance.
File
- src/
Plugin/ views/ field/ EntityFormField.php, line 173
Class
- EntityFormField
- Defines a views form element for an entity field widget.
Namespace
Drupal\views_entity_form_field\Plugin\views\fieldCode
protected function getBundleFieldDefinition($bundle = NULL) {
$bundle = !is_null($bundle) ? $bundle : reset($this->definition['bundles']);
$field_definitions = $this->entityFieldManager
->getFieldDefinitions($this
->getEntityTypeId(), $bundle);
return array_key_exists($this->definition['field_name'], $field_definitions) ? $field_definitions[$this->definition['field_name']] : NULL;
}