alterInfo($this->getType()); $this->setCacheBackend($cache_backend, 'block_plugins'); $this->logger = $logger; } /** * {@inheritdoc} */ protected function getType() { return 'block'; } /** * {@inheritdoc} */ public function processDefinition(&$definition, $plugin_id) { parent::processDefinition($definition, $plugin_id); $this->processDefinitionCategory($definition); } /** * {@inheritdoc} */ public function getSortedDefinitions(array $definitions = NULL) { // Sort the plugins first by category, then by admin label. $definitions = $this->traitGetSortedDefinitions($definitions, 'admin_label'); // Do not display the 'broken' plugin in the UI. unset($definitions['broken']); return $definitions; } /** * {@inheritdoc} */ public function getFallbackPluginId($plugin_id, array $configuration = []) { return 'broken'; } /** * {@inheritdoc} */ protected function handlePluginNotFound($plugin_id, array $configuration) { $this->logger->warning('The "%plugin_id" was not found', ['%plugin_id' => $plugin_id]); return parent::handlePluginNotFound($plugin_id, $configuration); } }