Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / linkit / src / MatcherInterface.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\linkit\MatcherInterface.
6  */
7
8 namespace Drupal\linkit;
9
10 use Drupal\Component\Plugin\ConfigurablePluginInterface;
11 use Drupal\Component\Plugin\PluginInspectionInterface;
12 use Drupal\Core\Plugin\PluginFormInterface;
13
14 /**
15  * Defines the interface for matchers.
16  *
17  * @see \Drupal\linkit\Annotation\Matcher
18  * @see \Drupal\linkit\MatcherBase
19  * @see \Drupal\linkit\MatcherManager
20  * @see plugin_api
21  */
22 interface MatcherInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
23
24   /**
25    * Returns the unique ID representing the matcher.
26    *
27    * @return string
28    *   The matcher ID.
29    */
30   public function getUuid();
31
32   /**
33    * Returns the matcher label.
34    *
35    * @return string
36    *   The matcher label.
37    */
38   public function getLabel();
39
40   /**
41    * Returns the summarized configuration of the matcher.
42    *
43    * @return array
44    *   An array of summarized configuration of the matcher.
45    */
46   public function getSummary();
47
48   /**
49    * Returns the weight of the matcher.
50    *
51    * @return int|string
52    *   Either the integer weight of the matcher, or an empty string.
53    */
54   public function getWeight();
55
56   /**
57    * Sets the weight for the matcher.
58    *
59    * @param int $weight
60    *   The weight for this matcher.
61    *
62    * @return $this
63    */
64   public function setWeight($weight);
65
66   /**
67    * Gets an array with search matches that will be presented in the autocomplete
68    * widget.
69    *
70    * @param $string
71    *   The string that contains the text to search for.
72    *
73    * @return array
74    *   An array whose values are an associative array containing:
75    *   - title: A string to use as the search result label.
76    *   - description: (optional) A string with additional information about the
77    *     result item.
78    *   - path: The URL to the item.
79    *   - group: (optional) A string with the group name for the result item.
80    *     Best practice is to use the plugin name as group name.
81    */
82   public function getMatches($string);
83
84 }