class FarmLogViewsTaskLink in farmOS 2.x
Provides task links for farmOS Logs Views.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\farm_ui_views\Plugin\Derivative\FarmLogViewsTaskLink uses StringTranslationTrait
Expanded class hierarchy of FarmLogViewsTaskLink
1 string reference to 'FarmLogViewsTaskLink'
- farm_ui_views.links.task.yml in modules/
core/ ui/ views/ farm_ui_views.links.task.yml - modules/core/ui/views/farm_ui_views.links.task.yml
File
- modules/
core/ ui/ views/ src/ Plugin/ Derivative/ FarmLogViewsTaskLink.php, line 11
Namespace
Drupal\farm_ui_views\Plugin\DerivativeView source
class FarmLogViewsTaskLink extends DeriverBase {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$links = [];
// Add links for each bundle.
$bundles = \Drupal::service('entity_type.bundle.info')
->getBundleInfo('log');
foreach ($bundles as $type => $info) {
$links['farm.asset.logs.' . $type] = [
'title' => $info['label'],
'parent_id' => 'farm.asset.logs',
'route_name' => 'view.farm_log.page_asset',
'route_parameters' => [
'log_type' => $type,
],
] + $base_plugin_definition;
}
return $links;
}
}
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:: |
|
FarmLogViewsTaskLink:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
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. |