Drupal 8  8.0.2
MenuLinkContent Class Reference
Inheritance diagram for MenuLinkContent:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager)
 
 getTitle ()
 
 getDescription ()
 
 getDeleteRoute ()
 
 getEditRoute ()
 
 getTranslateRoute ()
 
 updateLink (array $new_definition_values, $persist)
 
 isDeletable ()
 
 isTranslatable ()
 
 deleteLink ()
 
- Public Member Functions inherited from PluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getPluginId ()
 
 getBaseId ()
 
 getDerivativeId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 getUuid ()
 

Protected Attributes

 $overrideAllowed
 
 $entity
 
 $entityManager
 
 $languageManager
 
- Protected Attributes inherited from PluginBase
 $pluginId
 
 $pluginDefinition
 
 $configuration
 

Static Protected Attributes

static $entityIdsToLoad = array()
 

Additional Inherited Members

- Data Fields inherited from PluginBase
const DERIVATIVE_SEPARATOR = ':'
 

Detailed Description

Provides the menu link plugin for content menu links.

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
EntityManagerInterface  $entity_manager,
LanguageManagerInterface  $language_manager 
)

Constructs a new MenuLinkContent.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.

References Drupal\entityManager(), and Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

deleteLink ( )

{Deletes a menu link.In general, this method should not be called directly, but will be called automatically from MenuLinkManagerInterface::removeDefinition().This method will only delete the link from any additional storage, but not from the plugin.manager.menu.link service.

Exceptions
\Drupal\Component\Plugin\Exception\PluginExceptionIf the link is not deletable.
}

Implements MenuLinkInterface.

getDeleteRoute ( )

{Returns route information for a route to delete the menu link.

Returns
|null A Url object, or NULL if there is no route (e.g. when the link is not deletable).
}

Implements MenuLinkInterface.

getDescription ( )

{Returns the description of the menu link.

Returns
string The description of the menu link.
}

Implements MenuLinkInterface.

References Drupal\languageManager().

Here is the call graph for this function:

getEditRoute ( )

{Returns route information for a custom edit form for the menu link.Plugins should return a value here if they have a special edit form, or if they need to define additional local tasks, local actions, etc. that are visible from the edit form.

Returns
|null A Url object, or NULL if there is no route because there is no custom edit route for this instance.
}

Implements MenuLinkInterface.

getTitle ( )

{Returns the localized title to be shown for this link.

Returns
string The title of the menu link.
}

Implements MenuLinkInterface.

References Drupal\languageManager().

Here is the call graph for this function:

getTranslateRoute ( )

{Returns route information for a route to translate the menu link.

Returns
|null A Url object, or NULL if there is no route (e.g. when the link is not translatable).
}

Implements MenuLinkInterface.

getUuid ( )
protected

Returns the unique ID representing the menu link.

Returns
string The menu link ID.

References PluginBase\getDerivativeId().

Here is the call graph for this function:

isDeletable ( )

{Returns whether this link can be deleted.

Returns
bool TRUE if the link can be deleted, FALSE otherwise.
}

Implements MenuLinkInterface.

isTranslatable ( )

{Returns whether this link can be translated.

Returns
bool TRUE if the link can be translated, FALSE otherwise.
}

Implements MenuLinkInterface.

updateLink ( array  $new_definition_values,
  $persist 
)

{Updates the definition values for a menu link.Depending on the implementation details of the class, not all definition values may be changed. For example, changes to the title of a static link will be discarded.In general, this method should not be called directly, but will be called automatically from MenuLinkManagerInterface::updateDefinition().

Parameters
array$new_definition_valuesThe new values for the link definition. This will usually be just a subset of the plugin definition.
bool$persistTRUE to have the link persist the changed values to any additional storage.
Returns
array The plugin definition incorporating any allowed changes.
}

Implements MenuLinkInterface.

References Drupal\entityManager(), and PluginBase\getPluginDefinition().

Here is the call graph for this function:

Field Documentation

$overrideAllowed
protected
Initial value:
= array(
'menu_name' => 1,
'parent' => 1,
'weight' => 1,
'expanded' => 1,
'enabled' => 1,
'title' => 1,
'description' => 1,
'route_name' => 1,
'route_parameters' => 1,
'url' => 1,
'options' => 1,
)

{}


The documentation for this class was generated from the following file: