class EntityDecorator in Automatic Entity Label 8.3
Same name and namespace in other branches
- 8 src/EntityDecorator.php \Drupal\auto_entitylabel\EntityDecorator
- 8.2 src/EntityDecorator.php \Drupal\auto_entitylabel\EntityDecorator
Provides an content entity decorator for automatic label generation.
Hierarchy
- class \Drupal\auto_entitylabel\EntityDecorator implements EntityDecoratorInterface
Expanded class hierarchy of EntityDecorator
1 file declares its use of EntityDecorator
- EntityLabelNotNullConstraintValidator.php in src/
Plugin/ Validation/ EntityLabelNotNullConstraintValidator.php
1 string reference to 'EntityDecorator'
1 service uses EntityDecorator
File
- src/
EntityDecorator.php, line 14
Namespace
Drupal\auto_entitylabelView source
class EntityDecorator implements EntityDecoratorInterface {
/**
* Config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Token service.
*
* @var \Drupal\Core\Utility\Token
*/
protected $token;
/**
* Module handler service.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Automatic label configuration for the entity.
*
* @var array
*/
protected $config;
/**
* Constructs an EntityDecorator object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* Configuration factory.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* Entity type manager.
* @param \Drupal\Core\Utility\Token $token
* Token manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* Module handler service.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, Token $token, ModuleHandlerInterface $module_handler) {
$this->configFactory = $config_factory;
$this->entityTypeManager = $entity_type_manager;
$this->token = $token;
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
public function decorate(ContentEntityInterface $entity) {
return new AutoEntityLabelManager($entity, $this->configFactory, $this->entityTypeManager, $this->token, $this->moduleHandler);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDecorator:: |
protected | property | Automatic label configuration for the entity. | |
EntityDecorator:: |
protected | property | Config factory. | |
EntityDecorator:: |
protected | property | The entity type manager. | |
EntityDecorator:: |
protected | property | Module handler service. | |
EntityDecorator:: |
protected | property | Token service. | |
EntityDecorator:: |
public | function |
Automatic entity label entity decorator. Overrides EntityDecoratorInterface:: |
|
EntityDecorator:: |
public | function | Constructs an EntityDecorator object. |