ViewsEntitySchemaSubscriber
class ViewsEntitySchemaSubscriber implements EntityTypeListenerInterface, EventSubscriberInterface (View source)
Reacts to changes on entity types to update all views entities.
Traits
Helper methods for EntityTypeListenerInterface.
Constants
| BASE_TABLE_RENAME |
Indicates that a base table got renamed. |
| DATA_TABLE_RENAME |
Indicates that a data table got renamed. |
| DATA_TABLE_ADDITION |
Indicates that a data table got added. |
| DATA_TABLE_REMOVAL |
Indicates that a data table got removed. |
| REVISION_TABLE_RENAME |
Indicates that a revision table got renamed. |
| REVISION_TABLE_ADDITION |
Indicates that a revision table got added. |
| REVISION_TABLE_REMOVAL |
Indicates that a revision table got removed. |
| REVISION_DATA_TABLE_RENAME |
Indicates that a revision data table got renamed. |
| REVISION_DATA_TABLE_ADDITION |
Indicates that a revision data table got added. |
| REVISION_DATA_TABLE_REMOVAL |
Indicates that a revision data table got removed. |
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected LoggerInterface | $logger | The default logger service. |
Methods
Listener method for any entity type definition event.
{@inheritdoc}
Reacts to the update of the entity type.
{@inheritdoc}
Constructs a ViewsEntitySchemaSubscriber.
{@inheritdoc}
Applies a callable onto all handlers of all passed in views.
Updates views if a base table is renamed.
Updates views if a data table is renamed.
Updates views if a data table is added.
Updates views if a data table is removed.
Updates views if revision support is removed.
Details
static array
getEntityTypeEvents()
Gets the subscribed events.
onEntityTypeEvent(EntityTypeEvent $event, string $event_name)
Listener method for any entity type definition event.
onEntityTypeCreate(EntityTypeInterface $entity_type)
{@inheritdoc}
onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, array $field_storage_definitions)
{@inheritdoc}
onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original)
Reacts to the update of the entity type.
onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array $sandbox = NULL)
{@inheritdoc}
onEntityTypeDelete(EntityTypeInterface $entity_type)
Reacts to the deletion of the entity type.
__construct(EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger)
Constructs a ViewsEntitySchemaSubscriber.
static
getSubscribedEvents()
{@inheritdoc}
protected
processHandlers(array $all_views, callable $process)
Applies a callable onto all handlers of all passed in views.
protected
baseTableRename(View[] $all_views, string $entity_type_id, string $old_base_table, string $new_base_table)
Updates views if a base table is renamed.
protected
dataTableRename(View[] $all_views, string $entity_type_id, string $old_data_table, string $new_data_table)
Updates views if a data table is renamed.
protected
dataTableAddition(View[] $all_views, EntityTypeInterface $entity_type, string $new_data_table, string $base_table)
Updates views if a data table is added.
protected
dataTableRemoval(View[] $all_views, string $entity_type_id, string $old_data_table, string $base_table)
Updates views if a data table is removed.
protected
revisionRemoval(View[] $all_views, EntityTypeInterface $original)
Updates views if revision support is removed.