3 namespace Drupal\pathauto;
5 use Drupal\Core\Entity\EntityInterface;
8 * Provides and interface for PathautoGenerator.
10 interface PathautoGeneratorInterface {
13 * "Do nothing. Leave the old alias intact."
15 const UPDATE_ACTION_NO_NEW = 0;
18 * "Create a new alias. Leave the existing alias functioning."
20 const UPDATE_ACTION_LEAVE = 1;
23 * "Create a new alias. Delete the old alias."
25 const UPDATE_ACTION_DELETE = 2;
28 * Remove the punctuation from the alias.
30 const PUNCTUATION_REMOVE = 0;
33 * Replace the punctuation with the separator in the alias.
35 const PUNCTUATION_REPLACE = 1;
38 * Leave the punctuation as it is in the alias.
40 const PUNCTUATION_DO_NOTHING = 2;
43 * Resets internal caches.
45 public function resetCaches();
48 * Load an alias pattern entity by entity, bundle, and language.
50 * @param \Drupal\Core\Entity\EntityInterface $entity
53 * @return \Drupal\pathauto\PathautoPatternInterface|null
55 public function getPatternByEntity(EntityInterface $entity);
58 * Apply patterns to create an alias.
60 * @param \Drupal\Core\Entity\EntityInterface $entity
63 * Operation being performed on the content being aliased
64 * ('insert', 'update', 'return', or 'bulkupdate').
66 * @return array|string
67 * The alias that was created.
69 * @see _pathauto_set_alias()
71 public function createEntityAlias(EntityInterface $entity, $op);
74 * Creates or updates an alias for the given entity.
76 * @param EntityInterface $entity
77 * Entity for which to update the alias.
79 * The operation performed (insert, update)
80 * @param array $options
81 * - force: will force updating the path
82 * - language: the language for which to create the alias
85 * - An array with alias data in case the alias has been created or updated.
86 * - NULL if no operation performed.
88 public function updateEntityAlias(EntityInterface $entity, $op, array $options = array());