X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FAction%2FPlugin%2FAction%2FDerivative%2FEntityActionDeriverBase.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FAction%2FPlugin%2FAction%2FDerivative%2FEntityActionDeriverBase.php;h=5cd529a7465556229f0f831114c3555cfb1d5f96;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=29159c2931115cde69ed587dd81b4ccb0a389a17;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityActionDeriverBase.php b/web/core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityActionDeriverBase.php index 29159c293..5cd529a74 100644 --- a/web/core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityActionDeriverBase.php +++ b/web/core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityActionDeriverBase.php @@ -6,6 +6,8 @@ use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\Core\StringTranslation\TranslationInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -13,6 +15,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ abstract class EntityActionDeriverBase extends DeriverBase implements ContainerDeriverInterface { + use StringTranslationTrait; + /** * The entity type manager. * @@ -25,16 +29,22 @@ abstract class EntityActionDeriverBase extends DeriverBase implements ContainerD * * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. + * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation + * The string translation service. */ - public function __construct(EntityTypeManagerInterface $entity_type_manager) { + public function __construct(EntityTypeManagerInterface $entity_type_manager, TranslationInterface $string_translation) { $this->entityTypeManager = $entity_type_manager; + $this->stringTranslation = $string_translation; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, $base_plugin_id) { - return new static($container->get('entity_type.manager')); + return new static( + $container->get('entity_type.manager'), + $container->get('string_translation') + ); } /**