class EntityExtraFieldInfoEvent in Hook Event Dispatcher 8
Class EntityExtraFieldInfoEvent.
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\EntityExtra\EntityExtraFieldInfoEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
Expanded class hierarchy of EntityExtraFieldInfoEvent
3 files declare their use of EntityExtraFieldInfoEvent
- EntityExtraEventTest.php in tests/
src/ Unit/ EntityExtra/ EntityExtraEventTest.php - ExampleEntityExtraFieldInfoSubscribers.php in src/
Example/ ExampleEntityExtraFieldInfoSubscribers.php - hook_event_dispatcher.module in ./
hook_event_dispatcher.module - Hook event dispatcher module.
File
- src/
Event/ EntityExtra/ EntityExtraFieldInfoEvent.php, line 12
Namespace
Drupal\hook_event_dispatcher\Event\EntityExtraView 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() {
return HookEventDispatcherInterface::ENTITY_EXTRA_FIELD_INFO;
}
/**
* Set the field info.
*
* @param array $fieldInfo
* Field info.
*/
public function setFieldInfo(array $fieldInfo) {
$this->fieldInfo = $fieldInfo;
}
/**
* Get the field info.
*
* @return array
* Field info.
*/
public function getFieldInfo() {
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($entityType, $bundle, $fieldName, array $info) {
$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($entityType, $bundle, $fieldName, array $info) {
$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($entityType, $bundle, $fieldName, array $info, $type) {
$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. |