Loading entity_clone.api.php +8 −6 Original line number Diff line number Diff line <?php use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Drupal\entity_clone\Event\EntityCloneEvent; use Drupal\entity_clone\Event\EntityCloneEvents; /** * @file * Entity Clone hooks and events. */ /** * Event subscribers for Entity Clone. * Loading @@ -25,7 +27,7 @@ * ?> * </code> */ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface { class MyEntityCloneEventSubscriber implements EventSubscriberInterface { /** * An example event subscriber. Loading @@ -34,7 +36,7 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher * * @see \Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE */ public function myPreClone(\Drupal\entity_clone\Event\EntityCloneEvent $event): void { public function myPreClone(EntityCloneEvent $event): void { $original = $event->getEntity(); $newEntity = $event->getClonedEntity(); } Loading @@ -46,7 +48,7 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher * * @see \Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE */ public function myPostClone(\Drupal\entity_clone\Event\EntityCloneEvent $event): void { public function myPostClone(EntityCloneEvent $event): void { $original = $event->getEntity(); $newEntity = $event->getClonedEntity(); } Loading @@ -55,8 +57,8 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher * {@inheritdoc} */ public static function getSubscribedEvents(): array { $events[\Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE][] = ['myPreClone']; $events[\Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE][] = ['myPostClone']; $events[EntityCloneEvents::PRE_CLONE][] = ['myPreClone']; $events[EntityCloneEvents::POST_CLONE][] = ['myPostClone']; return $events; } Loading entity_clone.info.yml +1 −2 Original line number Diff line number Diff line name: Entity Clone description: Add a clone action for all entities core: "8.x" core_version_requirement: ^8 || ^9 core_version_requirement: ^8 || ^9 || ^10 type: module configure: entity_clone.settings test_dependencies: Loading entity_clone.module +2 −2 Original line number Diff line number Diff line Loading @@ -7,15 +7,16 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\Entity\ConfigEntityTypeInterface; use Drupal\Core\Entity\ContentEntityTypeInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Config\Entity\ConfigEntityTypeInterface; use Drupal\Core\Session\AccountInterface; use Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneBase; use Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase; use Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone; use Drupal\entity_clone\EntityClone\Config\FieldConfigEntityClone; use Drupal\entity_clone\EntityClone\Config\LayoutBuilderEntityClone; use Drupal\entity_clone\EntityClone\Config\MenuEntityClone; use Drupal\entity_clone\EntityClone\Config\MenuEntityCloneForm; use Drupal\entity_clone\EntityClone\Content\ContentEntityCloneBase; Loading @@ -23,7 +24,6 @@ use Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase; use Drupal\entity_clone\EntityClone\Content\FileEntityClone; use Drupal\entity_clone\EntityClone\Content\TaxonomyTermEntityClone; use Drupal\entity_clone\EntityClone\Content\UserEntityClone; use Drupal\entity_clone\EntityClone\Config\LayoutBuilderEntityClone; /** * Implements hook_help(). Loading src/EntityClone/Config/LayoutBuilderEntityClone.php +1 −1 Original line number Diff line number Diff line Loading @@ -8,8 +8,8 @@ use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\layout_builder\SectionComponent; use Drupal\layout_builder\Section; use Drupal\layout_builder\SectionComponent; use Symfony\Component\DependencyInjection\ContainerInterface; /** Loading src/EntityClone/Content/ContentEntityCloneBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -13,8 +13,8 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\TranslatableInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldConfigInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\entity_clone\EntityClone\EntityCloneInterface; Loading Loading
entity_clone.api.php +8 −6 Original line number Diff line number Diff line <?php use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Drupal\entity_clone\Event\EntityCloneEvent; use Drupal\entity_clone\Event\EntityCloneEvents; /** * @file * Entity Clone hooks and events. */ /** * Event subscribers for Entity Clone. * Loading @@ -25,7 +27,7 @@ * ?> * </code> */ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface { class MyEntityCloneEventSubscriber implements EventSubscriberInterface { /** * An example event subscriber. Loading @@ -34,7 +36,7 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher * * @see \Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE */ public function myPreClone(\Drupal\entity_clone\Event\EntityCloneEvent $event): void { public function myPreClone(EntityCloneEvent $event): void { $original = $event->getEntity(); $newEntity = $event->getClonedEntity(); } Loading @@ -46,7 +48,7 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher * * @see \Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE */ public function myPostClone(\Drupal\entity_clone\Event\EntityCloneEvent $event): void { public function myPostClone(EntityCloneEvent $event): void { $original = $event->getEntity(); $newEntity = $event->getClonedEntity(); } Loading @@ -55,8 +57,8 @@ class MyEntityCloneEventSubscriber implements \Symfony\Component\EventDispatcher * {@inheritdoc} */ public static function getSubscribedEvents(): array { $events[\Drupal\entity_clone\Event\EntityCloneEvents::PRE_CLONE][] = ['myPreClone']; $events[\Drupal\entity_clone\Event\EntityCloneEvents::POST_CLONE][] = ['myPostClone']; $events[EntityCloneEvents::PRE_CLONE][] = ['myPreClone']; $events[EntityCloneEvents::POST_CLONE][] = ['myPostClone']; return $events; } Loading
entity_clone.info.yml +1 −2 Original line number Diff line number Diff line name: Entity Clone description: Add a clone action for all entities core: "8.x" core_version_requirement: ^8 || ^9 core_version_requirement: ^8 || ^9 || ^10 type: module configure: entity_clone.settings test_dependencies: Loading
entity_clone.module +2 −2 Original line number Diff line number Diff line Loading @@ -7,15 +7,16 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Config\Entity\ConfigEntityTypeInterface; use Drupal\Core\Entity\ContentEntityTypeInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Config\Entity\ConfigEntityTypeInterface; use Drupal\Core\Session\AccountInterface; use Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneBase; use Drupal\entity_clone\EntityClone\Config\ConfigEntityCloneFormBase; use Drupal\entity_clone\EntityClone\Config\ConfigWithFieldEntityClone; use Drupal\entity_clone\EntityClone\Config\FieldConfigEntityClone; use Drupal\entity_clone\EntityClone\Config\LayoutBuilderEntityClone; use Drupal\entity_clone\EntityClone\Config\MenuEntityClone; use Drupal\entity_clone\EntityClone\Config\MenuEntityCloneForm; use Drupal\entity_clone\EntityClone\Content\ContentEntityCloneBase; Loading @@ -23,7 +24,6 @@ use Drupal\entity_clone\EntityClone\Content\ContentEntityCloneFormBase; use Drupal\entity_clone\EntityClone\Content\FileEntityClone; use Drupal\entity_clone\EntityClone\Content\TaxonomyTermEntityClone; use Drupal\entity_clone\EntityClone\Content\UserEntityClone; use Drupal\entity_clone\EntityClone\Config\LayoutBuilderEntityClone; /** * Implements hook_help(). Loading
src/EntityClone/Config/LayoutBuilderEntityClone.php +1 −1 Original line number Diff line number Diff line Loading @@ -8,8 +8,8 @@ use Drupal\Component\Uuid\UuidInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\layout_builder\SectionComponent; use Drupal\layout_builder\Section; use Drupal\layout_builder\SectionComponent; use Symfony\Component\DependencyInjection\ContainerInterface; /** Loading
src/EntityClone/Content/ContentEntityCloneBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -13,8 +13,8 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\TranslatableInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldConfigInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\entity_clone\EntityClone\EntityCloneInterface; Loading