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
52 * @return \Drupal\pathauto\PathautoPatternInterface|null
54 public function getPatternByEntity(EntityInterface $entity);
57 * Apply patterns to create an alias.
59 * @param \Drupal\Core\Entity\EntityInterface $entity
62 * Operation being performed on the content being aliased
63 * ('insert', 'update', 'return', or 'bulkupdate').
65 * @return array|string
66 * The alias that was created.
68 * @see _pathauto_set_alias()
70 public function createEntityAlias(EntityInterface $entity, $op);
73 * Creates or updates an alias for the given entity.
75 * @param EntityInterface $entity
76 * Entity for which to update the alias.
78 * The operation performed (insert, update)
79 * @param array $options
80 * - force: will force updating the path
81 * - language: the language for which to create the alias
84 * - An array with alias data in case the alias has been created or updated.
85 * - NULL if no operation performed.
87 public function updateEntityAlias(EntityInterface $entity, $op, array $options = array());