You are here

public function PathautoGenerator::__construct in Pathauto 8

Creates a new Pathauto manager.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Utility\Token $token: The token utility.

\Drupal\pathauto\AliasCleanerInterface $alias_cleaner: The alias cleaner.

\Drupal\pathauto\AliasStorageHelperInterface $alias_storage_helper: The alias storage helper.

AliasUniquifierInterface $alias_uniquifier: The alias uniquifier.

\Drupal\pathauto\MessengerInterface $pathauto_messenger: The messenger service.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\token\TokenEntityMapperInterface $token_entity_mapper: The token entity mapper.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\pathauto\AliasTypeManager $alias_type_manager: Manages pathauto alias type plugins.

File

src/PathautoGenerator.php, line 139

Class

PathautoGenerator
Provides methods for generating path aliases.

Namespace

Drupal\pathauto

Code

public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, Token $token, AliasCleanerInterface $alias_cleaner, AliasStorageHelperInterface $alias_storage_helper, AliasUniquifierInterface $alias_uniquifier, MessengerInterface $pathauto_messenger, TranslationInterface $string_translation, TokenEntityMapperInterface $token_entity_mapper, EntityTypeManagerInterface $entity_type_manager, AliasTypeManager $alias_type_manager = NULL) {
  $this->configFactory = $config_factory;
  $this->moduleHandler = $module_handler;
  $this->token = $token;
  $this->aliasCleaner = $alias_cleaner;
  $this->aliasStorageHelper = $alias_storage_helper;
  $this->aliasUniquifier = $alias_uniquifier;
  $this->pathautoMessenger = $pathauto_messenger;
  $this->stringTranslation = $string_translation;
  $this->tokenEntityMapper = $token_entity_mapper;
  $this->entityTypeManager = $entity_type_manager;
  $this->aliasTypeManager = $alias_type_manager ?: \Drupal::service('plugin.manager.alias_type');
}