Repository: doctrine-extensions/DoctrineExtensions (language: php)

Issue:
[Translatable][Translator] unify alias usage of doctrine ORM mapping in entities
## Feature Request

We came across an inconsistency in the annotations of the Translatable and Translator entities that lead to some php warnings in our custom class loader implementation (based on an old zend loader). Of course the current implementation works as intended but maybe it would make sense to change it for more consistency.

In Gedmo\Translatable\Entity\Translation and Gedmo\Translator\Entity\Translation the doctrine annotations are used without `ORM` aliases as in all the other entities (e.g. Gedmo\Loggable\Entity\LogEntry). Is there a specific reason for this differentiating?



Discussion / hints:

Fix patch:
diff --git a/src/Translatable/Entity/Translation.php b/src/Translatable/Entity/Translation.php
index 85a886b6b..3bca24e8d 100644
--- a/src/Translatable/Entity/Translation.php
+++ b/src/Translatable/Entity/Translation.php
@@ -9,40 +9,35 @@
 
 namespace Gedmo\Translatable\Entity;
 
-use Doctrine\ORM\Mapping\Entity;
-use Doctrine\ORM\Mapping\Index;
-use Doctrine\ORM\Mapping\Table;
-use Doctrine\ORM\Mapping\UniqueConstraint;
+use Doctrine\ORM\Mapping as ORM;
 use Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation;
 use Gedmo\Translatable\Entity\Repository\TranslationRepository;
 
 /**
  * Gedmo\Translatable\Entity\Translation
  *
- * @Table(
+ * @ORM\Table(
  *     name="ext_translations",
  *     options={"row_format": "DYNAMIC"},
  *     indexes={
- *
- *         @Index(name="translations_lookup_idx", columns={
+ *         @ORM\Index(name="translations_lookup_idx", columns={
  *             "locale", "object_class", "foreign_key"
  *         }),
- *         @Index(name="general_translations_lookup_idx", columns={
+ *         @ORM\Index(name="general_translations_lookup_idx", columns={
  *             "object_class", "foreign_key"
  *         })
  *     },
- *     uniqueConstraints={@UniqueConstraint(name="lookup_unique_idx", columns={
+ *     uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
  *         "locale", "object_class", "field", "foreign_key"
  *     })}
  * )
- *
- * @Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
+ * @ORM\Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
  */
-#[Entity(repositoryClass: TranslationRepository::class)]
-#[Table(name: 'ext_translations', options: ['row_format' => 'DYNAMIC'])]
-#[Index(name: 'translations_lookup_idx', columns: ['locale', 'object_class', 'foreign_key'])]
-#[Index(name: 'general_translations_lookup_idx', columns: ['object_class', 'foreign_key'])]
-#[UniqueConstraint(name: 'lookup_unique_idx', columns: ['locale', 'object_class', 'field', 'foreign_key'])]
+#[ORM\Entity(repositoryClass: TranslationRepository::class)]
+#[ORM\Table(name: 'ext_translations', options: ['row_format' => 'DYNAMIC'])]
+#[ORM\Index(name: 'translations_lookup_idx', columns: ['locale', 'object_class', 'foreign_key'])]
+#[ORM\Index(name: 'general_translations_lookup_idx', columns: ['object_class', 'foreign_key'])]
+#[ORM\UniqueConstraint(name: 'lookup_unique_idx', columns: ['locale', 'object_class', 'field', 'foreign_key'])]
 class Translation extends AbstractTranslation
 {
     /*
diff --git a/src/Translator/Entity/Translation.php b/src/Translator/Entity/Translation.php
index 0c22ee584..52a3c8190 100644
--- a/src/Translator/Entity/Translation.php
+++ b/src/Translator/Entity/Translation.php
@@ -10,10 +10,7 @@
 namespace Gedmo\Translator\Entity;
 
 use Doctrine\DBAL\Types\Types;
-use Doctrine\ORM\Mapping\Column;
-use Doctrine\ORM\Mapping\GeneratedValue;
-use Doctrine\ORM\Mapping\Id;
-use Doctrine\ORM\Mapping\MappedSuperclass;
+use Doctrine\ORM\Mapping as ORM;
 use Gedmo\Translator\Translation as BaseTranslation;
 
 /**
@@ -21,47 +18,45 @@
  *
  * @author Konstantin Kudryashov <ever.zet@gmail.com>
  *
- * @MappedSuperclass
+ * @ORM\MappedSuperclass
  */
-#[MappedSuperclass]
+#[ORM\MappedSuperclass]
 abstract class Translation extends BaseTranslation
 {
     /**
      * @var int
      *
-     * @Column(type="integer")
-     *
-     * @Id
-     *
-     * @GeneratedValue
+     * @ORM\Column(type="integer")
+     * @ORM\Id
+     * @ORM\GeneratedValue
      */
-    #[Column(type: Types::INTEGER)]
-    #[Id]
-    #[GeneratedValue]
+    #[ORM\Column(type: Types::INTEGER)]
+    #[ORM\Id]
+    #[ORM\GeneratedValue]
     protected $id;
 
     /**
      * @var string
      *
-     * @Column(type="string", length=8)
+     * @ORM\Column(type="string", length=8)
      */
-    #[Column(type: Types::STRING, length: 8)]
+    #[ORM\Column(type: Types::STRING, length: 8)]
     protected $locale;
 
     /**
      * @var string
      *
-     * @Column(type="string", length=32)
+     * @ORM\Column(type="string", length=32)
      */
-    #[Column(type: Types::STRING, length: 32)]
+    #[ORM\Column(type: Types::STRING, length: 32)]
     protected $property;
 
     /**
      * @var string
      *
-     * @Column(type="text", nullable=true)
+     * @ORM\Column(type="text", nullable=true)
      */
-    #[Column(type: Types::TEXT, nullable: true)]
+    #[ORM\Column(type: Types::TEXT, nullable: true)]
     protected $value;
 
     /**


Test patch: