Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / pathauto / src / PathautoGeneratorInterface.php
1 <?php
2
3 namespace Drupal\pathauto;
4
5 use Drupal\Core\Entity\EntityInterface;
6
7 /**
8  * Provides and interface for PathautoGenerator.
9  */
10 interface PathautoGeneratorInterface {
11
12   /**
13    * "Do nothing. Leave the old alias intact."
14    */
15   const UPDATE_ACTION_NO_NEW = 0;
16
17   /**
18    * "Create a new alias. Leave the existing alias functioning."
19    */
20   const UPDATE_ACTION_LEAVE = 1;
21
22   /**
23    * "Create a new alias. Delete the old alias."
24    */
25   const UPDATE_ACTION_DELETE = 2;
26
27   /**
28    * Remove the punctuation from the alias.
29    */
30   const PUNCTUATION_REMOVE = 0;
31
32   /**
33    * Replace the punctuation with the separator in the alias.
34    */
35   const PUNCTUATION_REPLACE = 1;
36
37   /**
38    * Leave the punctuation as it is in the alias.
39    */
40   const PUNCTUATION_DO_NOTHING = 2;
41
42   /**
43    * Resets internal caches.
44    */
45   public function resetCaches();
46
47   /**
48    * Load an alias pattern entity by entity, bundle, and language.
49    *
50    * @param \Drupal\Core\Entity\EntityInterface $entity
51    *   An entity.
52    *
53    * @return \Drupal\pathauto\PathautoPatternInterface|null
54    */
55   public function getPatternByEntity(EntityInterface $entity);
56
57   /**
58    * Apply patterns to create an alias.
59    *
60    * @param \Drupal\Core\Entity\EntityInterface $entity
61    *   The entity.
62    * @param string $op
63    *   Operation being performed on the content being aliased
64    *   ('insert', 'update', 'return', or 'bulkupdate').
65    *
66    * @return array|string
67    *   The alias that was created.
68    *
69    * @see _pathauto_set_alias()
70    */
71   public function createEntityAlias(EntityInterface $entity, $op);
72
73   /**
74    * Creates or updates an alias for the given entity.
75    *
76    * @param EntityInterface $entity
77    *   Entity for which to update the alias.
78    * @param string $op
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
83    *
84    * @return array|null
85    *   - An array with alias data in case the alias has been created or updated.
86    *   - NULL if no operation performed.
87    */
88   public function updateEntityAlias(EntityInterface $entity, $op, array $options = array());
89
90 }