Issue #2417877 by pwolanin: Make getDefinition method on menu link content entity public so we can rebuild user paths

8.0.x
webchick 2015-01-31 12:26:27 -08:00
parent bd0e53f429
commit abd52e2e4d
2 changed files with 13 additions and 8 deletions

View File

@ -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 {

View File

@ -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();
}