You are here

public function EntityAliasTypeBase::getSourcePrefix in Pathauto 8

Returns the source prefix; used for bulk delete.

Return value

string The source path prefix.

Overrides AliasTypeInterface::getSourcePrefix

2 calls to EntityAliasTypeBase::getSourcePrefix()
EntityAliasTypeBase::batchDelete in src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php
Gets called to batch delete all aliases created by pathauto.
EntityAliasTypeBase::batchUpdate in src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php
Gets called to batch update all entries.
1 method overrides EntityAliasTypeBase::getSourcePrefix()
ForumAliasType::getSourcePrefix in src/Plugin/pathauto/AliasType/ForumAliasType.php
Returns the source prefix; used for bulk delete.

File

src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php, line 323

Class

EntityAliasTypeBase
A pathauto alias type plugin for entities with canonical links.

Namespace

Drupal\pathauto\Plugin\pathauto\AliasType

Code

public function getSourcePrefix() {
  if (empty($this->prefix)) {
    $entity_type = $this->entityTypeManager
      ->getDefinition($this
      ->getEntityTypeId());
    $path = $entity_type
      ->getLinkTemplate('canonical');
    $this->prefix = substr($path, 0, strpos($path, '{'));
  }
  return $this->prefix;
}