final class DeveloperAppFieldConfigListAlterEventSubscriber in Apigee Edge 8
Adds base field configuration form to developer app entity's field config UI.
Hierarchy
- class \Drupal\apigee_edge\EventSubscriber\DeveloperAppFieldConfigListAlterEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of DeveloperAppFieldConfigListAlterEventSubscriber
1 string reference to 'DeveloperAppFieldConfigListAlterEventSubscriber'
1 service uses DeveloperAppFieldConfigListAlterEventSubscriber
File
- src/
EventSubscriber/ DeveloperAppFieldConfigListAlterEventSubscriber.php, line 31
Namespace
Drupal\apigee_edge\EventSubscriberView source
final class DeveloperAppFieldConfigListAlterEventSubscriber implements EventSubscriberInterface {
/**
* The form builder service.
*
* @var \Drupal\Core\Form\FormBuilderInterface
*/
private $formBuilder;
/**
* DeveloperAppFieldConfigListAlterEventSubscriber constructor.
*
* @param \Drupal\Core\Form\FormBuilderInterface $form_builder
* The form builder service.
*/
public function __construct(FormBuilderInterface $form_builder) {
$this->formBuilder = $form_builder;
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
return [
EdgeEntityFieldConfigListAlterEvent::EVENT_NAME => 'alterPage',
];
}
/**
* Alters the field config UI page.
*
* @param \Drupal\apigee_edge\Event\EdgeEntityFieldConfigListAlterEvent $event
* The field config list alter event.
*/
public function alterPage(EdgeEntityFieldConfigListAlterEvent $event) {
if ($event
->getEntityType() === 'developer_app') {
$page =& $event
->getPage();
$page['base_field_config'] = $this->formBuilder
->getForm(DeveloperAppBaseFieldConfigForm::class);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeveloperAppFieldConfigListAlterEventSubscriber:: |
private | property | The form builder service. | |
DeveloperAppFieldConfigListAlterEventSubscriber:: |
public | function | Alters the field config UI page. | |
DeveloperAppFieldConfigListAlterEventSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
DeveloperAppFieldConfigListAlterEventSubscriber:: |
public | function | DeveloperAppFieldConfigListAlterEventSubscriber constructor. |