Version 1
[yaffs-website] / web / modules / contrib / pathauto / src / AliasUniquifierInterface.php
1 <?php
2
3 namespace Drupal\pathauto;
4 use Drupal\Core\Language\LanguageInterface;
5
6 /**
7  * Provides an interface for alias uniquifiers.
8  */
9 interface AliasUniquifierInterface {
10
11   /**
12    * Check to ensure a path alias is unique and add suffix variants if necessary.
13    *
14    * Given an alias 'content/test' if a path alias with the exact alias already
15    * exists, the function will change the alias to 'content/test-0' and will
16    * increase the number suffix until it finds a unique alias.
17    *
18    * @param string $alias
19    *   A string with the alias. Can be altered by reference.
20    * @param string $source
21    *   A string with the path source.
22    * @param string $langcode
23    *   A string with a language code.
24    */
25   public function uniquify(&$alias, $source, $langcode);
26
27   /**
28    * Checks if an alias is reserved.
29    *
30    * @param string $alias
31    *   The alias.
32    * @param string $source
33    *   The source.
34    * @param string $langcode
35    *   (optional) The language code.
36    *
37    * @return bool
38    *   Returns TRUE if the alias is reserved.
39    */
40   public function isReserved($alias, $source, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED);
41
42 }