Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 00:19:30 +02:00
parent 72016e1a21
commit a3f775a69b
23 changed files with 39 additions and 93 deletions

View File

@@ -97,14 +97,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
#[ORM\Column(name: 'active', type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['defaut' => true])]
private bool $active = true;
/**
*
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\ManyToOne(targetEntity: Address::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
#[Context(normalizationContext: ['groups' => 'docgen:read'], groups: ['docgen:read:3party:parent'])]
private ?Address $address = null;
/**
@@ -119,12 +116,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* @var Collection<ThirdPartyCategory>
*
*
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['docgen:read', 'docgen:read:3party:parent'])]
#[ORM\ManyToMany(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdPartyCategory::class)]
#[ORM\JoinTable(name: 'chill_3party.thirdparty_category', joinColumns: [new ORM\JoinColumn(name: 'thirdparty_id', referencedColumnName: 'id')], inverseJoinColumns: [new ORM\JoinColumn(name: 'category_id', referencedColumnName: 'id')])]
#[Context(normalizationContext: ['groups' => 'docgen:read'], groups: ['docgen:read:3party:parent'])]
private Collection $categories;
/**
@@ -206,22 +202,20 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* Institutional ThirdParty: Many Contact Persons have One Institutional ThirdParty.
*
*
*
* @Context(normalizationContext={"groups": "docgen:read:3party:parent"}, groups={"docgen:read"})
*/
#[Groups(['read', 'write', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: ThirdParty::class, inversedBy: 'children')]
#[ORM\JoinColumn(name: 'parent_id', referencedColumnName: 'id')]
#[Context(normalizationContext: ['groups' => 'docgen:read:3party:parent'], groups: ['docgen:read'])]
private ?ThirdParty $parent = null;
/**
* [fr] Qualité.
*
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
#[ORM\Column(name: 'profession', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
#[Context(normalizationContext: ['groups' => 'docgen:read'], groups: ['docgen:read:3party:parent'])]
private string $profession = '';
/**