class EntityExtraFieldInfoEvent in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/core_event_dispatcher/src/Event/Entity/EntityExtraFieldInfoEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityExtraFieldInfoEvent
Class EntityExtraFieldInfoEvent.
Hierarchy
- class \Drupal\core_event_dispatcher\Event\Entity\EntityExtraFieldInfoEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
Expanded class hierarchy of EntityExtraFieldInfoEvent
3 files declare their use of EntityExtraFieldInfoEvent
- core_event_dispatcher.module in modules/
core_event_dispatcher/ core_event_dispatcher.module - Core event dispatcher submodule.
- EntityExtraEventTest.php in modules/
core_event_dispatcher/ tests/ src/ Unit/ Entity/ EntityExtraEventTest.php - ExampleEntityExtraFieldInfoSubscribers.php in examples/
ExampleEntityExtraFieldInfoSubscribers.php
File
- modules/
core_event_dispatcher/ src/ Event/ Entity/ EntityExtraFieldInfoEvent.php, line 12
Namespace
Drupal\core_event_dispatcher\Event\EntityView source
class EntityExtraFieldInfoEvent extends Event implements EventInterface {
/**
* Field info.
*
* @var array
*/
private $fieldInfo = [];
/**
* Get the dispatcher type.
*
* @return string
* The dispatcher type.
*/
public function getDispatcherType() : string {
return HookEventDispatcherInterface::ENTITY_EXTRA_FIELD_INFO;
}
/**
* Set the field info.
*
* @param array $fieldInfo
* Field info.
*/
public function setFieldInfo(array $fieldInfo) : void {
$this->fieldInfo = $fieldInfo;
}
/**
* Get the field info.
*
* @return array
* Field info.
*/
public function getFieldInfo() : array {
return $this->fieldInfo;
}
/**
* Add field info for a form display.
*
* @param string $entityType
* The entity type.
* @param string $bundle
* The bundle.
* @param string $fieldName
* The field name.
* @param array $info
* The field info.
*/
public function addDisplayFieldInfo(string $entityType, string $bundle, string $fieldName, array $info) : void {
$this
->addFieldInfo($entityType, $bundle, $fieldName, $info, 'display');
}
/**
* Add field info for a form display.
*
* @param string $entityType
* The entity type.
* @param string $bundle
* The bundle.
* @param string $fieldName
* The field name.
* @param array $info
* The field info.
*/
public function addFormFieldInfo(string $entityType, string $bundle, string $fieldName, array $info) : void {
$this
->addFieldInfo($entityType, $bundle, $fieldName, $info, 'form');
}
/**
* Add field info for a given type.
*
* @param string $entityType
* The entity type.
* @param string $bundle
* The bundle.
* @param string $fieldName
* The field name.
* @param array $info
* The field info.
* @param string $type
* The type.
*/
private function addFieldInfo(string $entityType, string $bundle, string $fieldName, array $info, string $type) : void {
$this->fieldInfo[$entityType][$bundle][$type][$fieldName] = $info;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityExtraFieldInfoEvent:: |
private | property | Field info. | |
EntityExtraFieldInfoEvent:: |
public | function | Add field info for a form display. | |
EntityExtraFieldInfoEvent:: |
private | function | Add field info for a given type. | |
EntityExtraFieldInfoEvent:: |
public | function | Add field info for a form display. | |
EntityExtraFieldInfoEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
EntityExtraFieldInfoEvent:: |
public | function | Get the field info. | |
EntityExtraFieldInfoEvent:: |
public | function | Set the field info. |