Issue #2417877 by pwolanin: Make getDefinition method on menu link content entity public so we can rebuild user paths
parent
bd0e53f429
commit
abd52e2e4d
|
@ -136,20 +136,15 @@ class MenuLinkContent extends ContentEntityBase implements MenuLinkContentInterf
|
|||
}
|
||||
|
||||
/**
|
||||
* Builds up the menu link plugin definition for this entity.
|
||||
*
|
||||
* @return array
|
||||
* The plugin definition corresponding to this entity.
|
||||
*
|
||||
* @see \Drupal\Core\Menu\MenuLinkTree::$defaults
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getPluginDefinition() {
|
||||
public function getPluginDefinition() {
|
||||
$definition = array();
|
||||
$definition['class'] = 'Drupal\menu_link_content\Plugin\Menu\MenuLinkContent';
|
||||
$definition['menu_name'] = $this->getMenuName();
|
||||
|
||||
if ($url_object = $this->getUrlObject()) {
|
||||
if ($url_object->isExternal()) {
|
||||
if (!$url_object->isRouted()) {
|
||||
$definition['url'] = $url_object->getUri();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -92,4 +92,14 @@ interface MenuLinkContentInterface extends ContentEntityInterface, EntityChanged
|
|||
*/
|
||||
public function getWeight();
|
||||
|
||||
/**
|
||||
* Builds up the menu link plugin definition for this entity.
|
||||
*
|
||||
* @return array
|
||||
* The plugin definition corresponding to this entity.
|
||||
*
|
||||
* @see \Drupal\Core\Menu\MenuLinkTree::$defaults
|
||||
*/
|
||||
public function getPluginDefinition();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue