You are here

interface PathautoGeneratorInterface in Pathauto 8

Provides and interface for PathautoGenerator.

Hierarchy

Expanded class hierarchy of PathautoGeneratorInterface

All classes that implement PathautoGeneratorInterface

6 files declare their use of PathautoGeneratorInterface
PathautoBulkUpdateForm.php in src/Form/PathautoBulkUpdateForm.php
PathautoBulkUpdateTest.php in tests/src/Functional/PathautoBulkUpdateTest.php
PathautoCommands.php in src/Commands/PathautoCommands.php
PathautoKernelTest.php in tests/src/Kernel/PathautoKernelTest.php
PathautoSettingsForm.php in src/Form/PathautoSettingsForm.php

... See full list

File

src/PathautoGeneratorInterface.php, line 10

Namespace

Drupal\pathauto
View source
interface PathautoGeneratorInterface {

  /**
   * "Do nothing. Leave the old alias intact."
   */
  const UPDATE_ACTION_NO_NEW = 0;

  /**
   * "Create a new alias. Leave the existing alias functioning."
   */
  const UPDATE_ACTION_LEAVE = 1;

  /**
   * "Create a new alias. Delete the old alias."
   */
  const UPDATE_ACTION_DELETE = 2;

  /**
   * Remove the punctuation from the alias.
   */
  const PUNCTUATION_REMOVE = 0;

  /**
   * Replace the punctuation with the separator in the alias.
   */
  const PUNCTUATION_REPLACE = 1;

  /**
   * Leave the punctuation as it is in the alias.
   */
  const PUNCTUATION_DO_NOTHING = 2;

  /**
   * Resets internal caches.
   */
  public function resetCaches();

  /**
   * Load an alias pattern entity by entity, bundle, and language.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   An entity.
   *
   * @return \Drupal\pathauto\PathautoPatternInterface|null
   */
  public function getPatternByEntity(EntityInterface $entity);

  /**
   * Apply patterns to create an alias.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   * @param string $op
   *   Operation being performed on the content being aliased
   *   ('insert', 'update', 'return', or 'bulkupdate').
   *
   * @return array|string
   *   The alias that was created.
   *
   * @see _pathauto_set_alias()
   */
  public function createEntityAlias(EntityInterface $entity, $op);

  /**
   * Creates or updates an alias for the given entity.
   *
   * @param EntityInterface $entity
   *   Entity for which to update the alias.
   * @param string $op
   *   The operation performed (insert, update)
   * @param array $options
   *   - force: will force updating the path
   *   - language: the language for which to create the alias
   *
   * @return array|null
   *   - An array with alias data in case the alias has been created or updated.
   *   - NULL if no operation performed.
   */
  public function updateEntityAlias(EntityInterface $entity, $op, array $options = []);

}

Members

Namesort descending Modifiers Type Description Overrides
PathautoGeneratorInterface::createEntityAlias public function Apply patterns to create an alias. 1
PathautoGeneratorInterface::getPatternByEntity public function Load an alias pattern entity by entity, bundle, and language. 1
PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING constant Leave the punctuation as it is in the alias.
PathautoGeneratorInterface::PUNCTUATION_REMOVE constant Remove the punctuation from the alias.
PathautoGeneratorInterface::PUNCTUATION_REPLACE constant Replace the punctuation with the separator in the alias.
PathautoGeneratorInterface::resetCaches public function Resets internal caches. 1
PathautoGeneratorInterface::updateEntityAlias public function Creates or updates an alias for the given entity. 1
PathautoGeneratorInterface::UPDATE_ACTION_DELETE constant "Create a new alias. Delete the old alias."
PathautoGeneratorInterface::UPDATE_ACTION_LEAVE constant "Create a new alias. Leave the existing alias functioning."
PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW constant "Do nothing. Leave the old alias intact."