class ViewsConfigUpdater implements ContainerInjectionInterface (View source)

internal  This class is only meant to fix outdated views configuration and its methods should not be invoked directly. It will be removed once all the public methods have been deprecated and removed.
 

Provides a BC layer for modules providing old configurations.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

protected EntityFieldManagerInterface $entityFieldManager

The entity field manager.

protected TypedConfigManagerInterface $typedConfigManager

The typed config manager.

protected ViewsData $viewsData

The views data service.

protected array $multivalueBaseFieldsUpdateTableInfo

An array of helper data for the multivalue base field update.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, TypedConfigManagerInterface $typed_config_manager, ViewsData $views_data)

ViewsConfigUpdater constructor.

static 
create(ContainerInterface $container)

Instantiates a new instance of this class.

bool
updateAll(ViewEntityInterface $view)

Performs all required updates.

bool
processDisplayHandlers(ViewEntityInterface $view, bool $return_on_changed, callable $handler_processor)

Processes all display handlers.

bool
needsEntityLinkUrlUpdate(ViewEntityInterface $view)

Add additional settings to the entity link field.

bool
processEntityLinkUrlHandler(array $handler, string $handler_type)

Processes entity link URL fields.

bool
needsOperatorDefaultsUpdate(ViewEntityInterface $view)

Add additional settings to the entity link field.

bool
processOperatorDefaultsHandler(array $handler, string $handler_type)

Processes operator defaults.

bool
needsMultivalueBaseFieldUpdate(ViewEntityInterface $view)

Update field names for multi-value base fields.

array
getMultivalueBaseFieldUpdateTableInfo()

Returns the multivalue base fields update table info.

bool
processMultivalueBaseFieldHandler(array $handler, string $handler_type, string $key, string $display_id, ViewEntityInterface $view)

Processes handlers affected by the multivalue base field update.

string
mapOperatorFromSingleToMultiple(string $single_operator)

Maps a single operator to a multiple one, if possible.

Details

__construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, TypedConfigManagerInterface $typed_config_manager, ViewsData $views_data)

ViewsConfigUpdater constructor.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

EntityFieldManagerInterface $entity_field_manager

The entity field manager.

TypedConfigManagerInterface $typed_config_manager

The typed config manager.

ViewsData $views_data

The views data service.

static create(ContainerInterface $container)

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

ContainerInterface $container

The service container this instance should use.

bool updateAll(ViewEntityInterface $view)

Performs all required updates.

Parameters

ViewEntityInterface $view

The View to update.

Return Value

bool

Whether the view was updated.

protected bool processDisplayHandlers(ViewEntityInterface $view, bool $return_on_changed, callable $handler_processor)

Processes all display handlers.

Parameters

ViewEntityInterface $view

The View to update.

bool $return_on_changed

Whether processing should stop after a change is detected.

callable $handler_processor

A callback performing the actual update.

Return Value

bool

Whether the view was updated.

bool needsEntityLinkUrlUpdate(ViewEntityInterface $view)

Add additional settings to the entity link field.

Parameters

ViewEntityInterface $view

The View to update.

Return Value

bool

Whether the view was updated.

protected bool processEntityLinkUrlHandler(array $handler, string $handler_type)

Processes entity link URL fields.

Parameters

array $handler

A display handler.

string $handler_type

The handler type.

Return Value

bool

Whether the handler was updated.

bool needsOperatorDefaultsUpdate(ViewEntityInterface $view)

Add additional settings to the entity link field.

Parameters

ViewEntityInterface $view

The View to update.

Return Value

bool

Whether the view was updated.

protected bool processOperatorDefaultsHandler(array $handler, string $handler_type)

Processes operator defaults.

Parameters

array $handler

A display handler.

string $handler_type

The handler type.

Return Value

bool

Whether the handler was updated.

bool needsMultivalueBaseFieldUpdate(ViewEntityInterface $view)

Update field names for multi-value base fields.

Parameters

ViewEntityInterface $view

The View to update.

Return Value

bool

Whether the view was updated.

protected array getMultivalueBaseFieldUpdateTableInfo()

Returns the multivalue base fields update table info.

Return Value

array

An array of multivalue base field info.

protected bool processMultivalueBaseFieldHandler(array $handler, string $handler_type, string $key, string $display_id, ViewEntityInterface $view)

Processes handlers affected by the multivalue base field update.

Parameters

array $handler

A display handler.

string $handler_type

The handler type.

string $key

The handler key.

string $display_id

The handler display ID.

ViewEntityInterface $view

The view being updated.

Return Value

bool

Whether the handler was updated.

protected string mapOperatorFromSingleToMultiple(string $single_operator)

Maps a single operator to a multiple one, if possible.

Parameters

string $single_operator

A single operator.

Return Value

string

A multiple operator or the original one if no mapping was available.