You are here

class FarmLogViewsTaskLink in farmOS 2.x

Provides task links for farmOS Logs Views.

Hierarchy

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\Derivative
View 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

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
FarmLogViewsTaskLink::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
StringTranslationTrait::$stringTranslation protected property The string translation service. 4
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.