Skip to content

Drupal\helper\PathautoHelper

Helpers for working with the Pathauto module.

Methods

Name Description
__construct
getAlteredPattern Get the altered pathauto pattern.
hasAutomaticAlias Determine if an entity has a manual path alias.

PathautoHelper::__construct

Description

 __construct (void)

Parameters

This function has no parameters.

Return Values

void


PathautoHelper::getAlteredPattern

Description

public getAlteredPattern (\Drupal\Core\Entity\EntityInterface $entity)

Get the altered pathauto pattern.

Parameters

  • (\Drupal\Core\Entity\EntityInterface) $entity :
    The entity.

Return Values

string|null

The pattern prior to token replacement if available or NULL.


PathautoHelper::hasAutomaticAlias

Description

public hasAutomaticAlias (\Drupal\Core\Entity\EntityInterface $entity, bool $checkGenerated)

Determine if an entity has a manual path alias.

Parameters

  • (\Drupal\Core\Entity\EntityInterface) $entity :
    The entity object.
  • (bool) $checkGenerated :
    (optional) Also check to make sure the current alias matches what
    Pathauto would currently generate for the alias.

Return Values

bool

TRUE if the entity has an automatic alias, or FALSE otherwise.