ConfigEntityUpdater
class ConfigEntityUpdater implements ContainerInjectionInterface (View source)
A utility class to make updating configuration entities simple.
Use this in a post update function like so:
Constants
| SANDBOX_KEY |
The key used to store information in the update sandbox. |
Properties
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected int | $batchSize | The number of entities to process in each batch. |
Methods
ConfigEntityUpdater constructor.
Instantiates a new instance of this class.
Updates configuration entities as part of a Drupal update.
Details
__construct(EntityTypeManagerInterface $entity_type_manager, int $batch_size)
ConfigEntityUpdater constructor.
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.
update(array $sandbox, string $entity_type_id, callable $callback = NULL)
Updates configuration entities as part of a Drupal update.