Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / menu_link_content / src / MenuLinkContentInterface.php
1 <?php
2
3 namespace Drupal\menu_link_content;
4
5 use Drupal\Core\Entity\EntityChangedInterface;
6 use Drupal\Core\Entity\ContentEntityInterface;
7 use Drupal\Core\Entity\EntityPublishedInterface;
8
9 /**
10  * Defines an interface for custom menu links.
11  */
12 interface MenuLinkContentInterface extends ContentEntityInterface, EntityChangedInterface, EntityPublishedInterface {
13
14   /**
15    * Flags this instance as being wrapped in a menu link plugin instance.
16    */
17   public function setInsidePlugin();
18
19   /**
20    * Gets the title of the menu link.
21    *
22    * @return string
23    *   The title of the link.
24    */
25   public function getTitle();
26
27   /**
28    * Gets the url object pointing to the URL of the menu link content entity.
29    *
30    * @return \Drupal\Core\Url
31    *   A Url object instance.
32    */
33   public function getUrlObject();
34
35   /**
36    * Gets the menu name of the custom menu link.
37    *
38    * @return string
39    *   The menu ID.
40    */
41   public function getMenuName();
42
43   /**
44    * Gets the description of the menu link for the UI.
45    *
46    * @return string
47    *   The description to use on admin pages or as a title attribute.
48    */
49   public function getDescription();
50
51   /**
52    * Gets the menu plugin ID associated with this entity.
53    *
54    * @return string
55    *   The plugin ID.
56    */
57   public function getPluginId();
58
59   /**
60    * Returns whether the menu link is marked as enabled.
61    *
62    * @return bool
63    *   TRUE if is enabled, otherwise FALSE.
64    */
65   public function isEnabled();
66
67   /**
68    * Returns whether the menu link is marked as always expanded.
69    *
70    * @return bool
71    *   TRUE for expanded, FALSE otherwise.
72    */
73   public function isExpanded();
74
75   /**
76    * Gets the plugin ID of the parent menu link.
77    *
78    * @return string
79    *   A plugin ID, or empty string if this link is at the top level.
80    */
81   public function getParentId();
82
83   /**
84    * Returns the weight of the menu link content entity.
85    *
86    * @return int
87    *   A weight for use when ordering links.
88    */
89   public function getWeight();
90
91   /**
92    * Builds up the menu link plugin definition for this entity.
93    *
94    * @return array
95    *   The plugin definition corresponding to this entity.
96    *
97    * @see \Drupal\Core\Menu\MenuLinkTree::$defaults
98    */
99   public function getPluginDefinition();
100
101   /**
102    * Returns whether the menu link requires rediscovery.
103    *
104    * If a menu-link points to a user-supplied path such as /blog then the route
105    * this resolves to needs to be rediscovered as the module or route providing
106    * a given path might change over time.
107    *
108    * For example: at the time a menu-link is created, the /blog path might be
109    * provided by a route in Views module, but later this path may be served by
110    * the Panels module. Flagging a link as requiring rediscovery ensures that if
111    * the route that provides a user-entered path changes over time, the link is
112    * flexible enough to update to reflect these changes.
113    *
114    * @return bool
115    *   TRUE if the menu link requires rediscovery during route rebuilding.
116    */
117   public function requiresRediscovery();
118
119   /**
120    * Flags a link as requiring rediscovery.
121    *
122    * @param bool $rediscovery
123    *   Whether or not the link requires rediscovery.
124    *
125    * @return $this
126    *   The instance on which the method was called.
127    *
128    * @see \Drupal\menu_link_content\MenuLinkContentInterface::requiresRediscovery()
129    */
130   public function setRequiresRediscovery($rediscovery);
131
132 }