-
-
Save dsnopek/611cea4581b2b4d25156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Panels storage service that stores Panels displays in Page Manager. | |
* | |
* @PanelsStorage( | |
* id = "page_manager" | |
* ) | |
*/ | |
class PageManagerPanelsStorage implements PanelsStorageInterface, ContainerFactoryPluginInterface { | |
/** | |
* @var \Drupal\Core\Entity\EntityTypeManagerInterface | |
*/ | |
protected $entityTypeManager; | |
/** | |
* Constructs a PageManagerPanelsStorage. | |
* | |
* @param array $configuration | |
* @param string $plugin_id | |
* @param mixed $plugin_definition | |
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager | |
* The entity type manager. | |
*/ | |
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) { | |
$this->entityTypeManager = $entity_type_manager; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { | |
return new static( | |
$configuration, | |
$plugin_id, | |
$plugin_definition, | |
$container->get('entity_type.manager') | |
); | |
} | |
// ... etc ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment