X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fentity%2Fsrc%2FPlugin%2FAction%2FDerivative%2FDeleteActionDeriver.php;fp=web%2Fmodules%2Fcontrib%2Fentity%2Fsrc%2FPlugin%2FAction%2FDerivative%2FDeleteActionDeriver.php;h=0000000000000000000000000000000000000000;hp=1f7d76b8d9bdaa637033e9ecff10730a3a01ce3f;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/entity/src/Plugin/Action/Derivative/DeleteActionDeriver.php b/web/modules/contrib/entity/src/Plugin/Action/Derivative/DeleteActionDeriver.php deleted file mode 100644 index 1f7d76b8d..000000000 --- a/web/modules/contrib/entity/src/Plugin/Action/Derivative/DeleteActionDeriver.php +++ /dev/null @@ -1,78 +0,0 @@ -entityTypeManager = $entity_type_manager; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, $base_plugin_id) { - return new static($container->get('entity_type.manager')); - } - - /** - * {@inheritdoc} - */ - public function getDerivativeDefinitions($base_plugin_definition) { - if (empty($this->derivatives)) { - $definitions = []; - foreach ($this->getParticipatingEntityTypes() as $entity_type_id => $entity_type) { - $definition = $base_plugin_definition; - $definition['label'] = t('Delete @entity_type', ['@entity_type' => $entity_type->getSingularLabel()]); - $definition['type'] = $entity_type_id; - $definition['confirm_form_route_name'] = 'entity.' . $entity_type_id . '.delete_multiple_form'; - $definitions[$entity_type_id] = $definition; - } - $this->derivatives = $definitions; - } - - return parent::getDerivativeDefinitions($base_plugin_definition); - } - - /** - * Gets a list of participating entity types. - * - * The list consists of all content entity types with a delete-multiple-form - * link template. - * - * @return \Drupal\Core\Entity\EntityTypeInterface[] - * The participating entity types, keyed by entity type id. - */ - protected function getParticipatingEntityTypes() { - $entity_types = $this->entityTypeManager->getDefinitions(); - $entity_types = array_filter($entity_types, function (EntityTypeInterface $entity_type) { - return $entity_type->entityClassImplements(ContentEntityInterface::class) && $entity_type->hasLinkTemplate('delete-multiple-form'); - }); - - return $entity_types; - } - -}