class TotalControlMenuLink in Total Control Admin Dashboard 3.0.x
Same name in this branch
- 3.0.x src/Plugin/Derivative/TotalControlMenuLink.php \Drupal\total_control\Plugin\Derivative\TotalControlMenuLink
- 3.0.x src/Plugin/Menu/TotalControlMenuLink.php \Drupal\total_control\Plugin\Menu\TotalControlMenuLink
Same name and namespace in other branches
- 8.2 src/Plugin/Derivative/TotalControlMenuLink.php \Drupal\total_control\Plugin\Derivative\TotalControlMenuLink
Represents a menu link for a Total Control Menu Link.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\total_control\Plugin\Derivative\TotalControlMenuLink implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of TotalControlMenuLink
1 string reference to 'TotalControlMenuLink'
File
- src/
Plugin/ Derivative/ TotalControlMenuLink.php, line 15
Namespace
Drupal\total_control\Plugin\DerivativeView source
class TotalControlMenuLink extends DeriverBase implements ContainerDeriverInterface {
use StringTranslationTrait;
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Creates a Total Control Menu Link instance.
*
* @param string $base_plugin_id
* Base plugin id.
* @param Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* Entity type manager.
* @param Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The string translation service.
*/
public function __construct($base_plugin_id, EntityTypeManagerInterface $entity_type_manager, TranslationInterface $string_translation) {
$this->entityTypeManager = $entity_type_manager;
$this
->setStringTranslation($string_translation);
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($base_plugin_id, $container
->get('entity_type.manager'), $container
->get('string_translation'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$router = \Drupal::service('router.route_provider');
if (!empty($router
->getRoutesByNames([
'page_manager.page_view_total_control_dashboard_total_control_dashboard-http_status_code-0',
]))) {
$links['system.total_control_dashboard'] = [
'title' => $this
->t('Dashboard'),
'route_name' => 'page_manager.page_view_total_control_dashboard_total_control_dashboard-http_status_code-0',
'parent' => 'system.admin',
'weight' => '-20',
] + $base_plugin_definition;
return $links;
}
return [];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TotalControlMenuLink:: |
protected | property | The entity type manager. | |
TotalControlMenuLink:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
TotalControlMenuLink:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
TotalControlMenuLink:: |
public | function | Creates a Total Control Menu Link instance. |