You are here

class ContentDashboard in CMS Content Sync 2.0.x

Same name in this branch
  1. 2.0.x src/Plugin/Derivative/ContentDashboard.php \Drupal\cms_content_sync\Plugin\Derivative\ContentDashboard
  2. 2.0.x src/Plugin/Menu/ContentDashboard.php \Drupal\cms_content_sync\Plugin\Menu\ContentDashboard
Same name and namespace in other branches
  1. 8 src/Plugin/Derivative/ContentDashboard.php \Drupal\cms_content_sync\Plugin\Derivative\ContentDashboard
  2. 2.1.x src/Plugin/Derivative/ContentDashboard.php \Drupal\cms_content_sync\Plugin\Derivative\ContentDashboard

Derivative class that provides the menu links for the Products.

Hierarchy

Expanded class hierarchy of ContentDashboard

1 string reference to 'ContentDashboard'
cms_content_sync.links.menu.yml in ./cms_content_sync.links.menu.yml
cms_content_sync.links.menu.yml

File

src/Plugin/Derivative/ContentDashboard.php, line 13

Namespace

Drupal\cms_content_sync\Plugin\Derivative
View source
class ContentDashboard extends DeriverBase implements ContainerDeriverInterface {

  /**
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Creates a ProductMenuLink instance.
   *
   * @param $base_plugin_id
   */
  public function __construct($base_plugin_id, EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, $base_plugin_id) {
    return new static($base_plugin_id, $container
      ->get('entity_type.manager'));
  }

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $links = [];
    $links['content_dashboard'] = [
      'title' => _cms_content_sync_get_repository_name(),
      'menu_name' => 'admin',
      'parent' => 'system.admin_content',
      'route_name' => 'entity.cms_content_sync.content',
    ] + $base_plugin_definition;
    return $links;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContentDashboard::$entityTypeManager protected property
ContentDashboard::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create
ContentDashboard::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
ContentDashboard::__construct public function Creates a ProductMenuLink instance.
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition