Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 13:11:42 +02:00
parent a3f775a69b
commit 0ff4593863
118 changed files with 143 additions and 658 deletions

View File

@@ -15,9 +15,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* CustomField.
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
@@ -31,10 +28,9 @@ class CustomField
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
private bool $active = true;
#[ORM\ManyToOne(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class, inversedBy: 'customFields')]
#[ORM\ManyToOne(targetEntity: CustomFieldsGroup::class, inversedBy: 'customFields')]
private ?CustomFieldsGroup $customFieldGroup = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]

View File

@@ -15,7 +15,6 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: \Chill\CustomFieldsBundle\EntityRepository\CustomFieldLongChoice\OptionRepository::class)]
#[ORM\Table(name: 'custom_field_long_choice_options')]
class Option
@@ -26,10 +25,9 @@ class Option
/**
* @var Collection<Option>
*/
#[ORM\OneToMany(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option::class, mappedBy: 'parent')]
#[ORM\OneToMany(targetEntity: Option::class, mappedBy: 'parent')]
private Collection $children;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -41,8 +39,7 @@ class Option
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 15)]
private ?string $key = null;
#[ORM\ManyToOne(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option::class, inversedBy: 'children')]
#[ORM\ManyToOne(targetEntity: Option::class, inversedBy: 'children')]
#[ORM\JoinColumn(nullable: true)]
private ?Option $parent = null;

View File

@@ -15,21 +15,18 @@ use Doctrine\ORM\Mapping as ORM;
/**
* CustomFieldsDefaultGroup.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'customfieldsdefaultgroup')]
#[ORM\UniqueConstraint(name: 'unique_entity', columns: ['entity'])]
class CustomFieldsDefaultGroup
{
#[ORM\ManyToOne(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)] // sf4 check: option inversedBy="customFields" return inconsistent error mapping !!
#[ORM\ManyToOne(targetEntity: CustomFieldsGroup::class)] // sf4 check: option inversedBy="customFields" return inconsistent error mapping !!
private ?CustomFieldsGroup $customFieldsGroup = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private ?string $entity = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]

View File

@@ -13,12 +13,11 @@ namespace Chill\CustomFieldsBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Order;
use Doctrine\ORM\Mapping as ORM;
/**
* CustomFieldGroup.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'customfieldsgroup')]
@@ -35,17 +34,14 @@ class CustomFieldsGroup
* The custom fields are asc-ordered regarding to their property "ordering".
*
* @var Collection<CustomField>
*
*
*/
#[ORM\OneToMany(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomField::class, mappedBy: 'customFieldGroup')]
#[ORM\OrderBy(['ordering' => \Doctrine\Common\Collections\Criteria::ASC])]
#[ORM\OneToMany(targetEntity: CustomField::class, mappedBy: 'customFieldGroup')]
#[ORM\OrderBy(['ordering' => 'ASC'])]
private Collection $customFields;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private ?string $entity = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]