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