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

@@ -21,8 +21,6 @@ use Doctrine\ORM\Mapping as ORM;
* The process of selecting the current center is done on database side,
* using a SQL view.
*
*
*
* @psalm-internal Chill\PersonBundle\Entity
*/
#[ORM\Entity(readOnly: true)]
@@ -35,7 +33,6 @@ class PersonCenterCurrent
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;

View File

@@ -21,8 +21,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Associate a Person with a Center. The association may change on date intervals.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_person_center_history')]
@@ -35,7 +33,6 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -23,8 +23,6 @@ use Doctrine\ORM\Mapping as ORM;
*
* The validFrom and validTo properties are the intersection of
* household membership and address validity. See @see{PersonHouseholdAddress}
*
*
*/
#[ORM\Entity(readOnly: true)]
#[ORM\Table('view_chill_person_current_address')]
@@ -33,7 +31,6 @@ class PersonCurrentAddress
#[ORM\OneToOne(targetEntity: Address::class)]
protected Address $address;
#[ORM\Id]
#[ORM\OneToOne(targetEntity: Person::class, inversedBy: 'currentPersonAddress')]
#[ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id')]

View File

@@ -24,7 +24,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['personResource' => PersonResource::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_resource')]
@@ -35,21 +34,19 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
#[Groups(['read', 'docgen:read'])]
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'comment_')]
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
private CommentEmbeddable $comment;
#[Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
private ?string $freeText = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: PersonResourceKind::class, inversedBy: 'personResources')]
#[ORM\JoinColumn(nullable: true)]
@@ -57,8 +54,6 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/**
* The person which host the owner of this resource.
*
*
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
@@ -67,15 +62,12 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/**
* The person linked with this resource.
*
*
*/
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'resources')]
#[ORM\JoinColumn(nullable: false)]
private ?Person $personOwner = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: ThirdParty::class, inversedBy: 'personResources')]
#[ORM\JoinColumn(nullable: true)]

View File

@@ -14,12 +14,10 @@ namespace Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_resource_kind')]
class PersonResourceKind
{
#[Serializer\Groups(['docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@@ -20,44 +20,38 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: ResidentialAddressRepository::class)]
#[ORM\Table(name: 'chill_person_residential_address')]
class ResidentialAddress
{
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Address::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Address $address = null;
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'residentialAddressComment_')]
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'residentialAddressComment_')]
private CommentEmbeddable $comment;
#[Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $endDate = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: true)]
#[Context(normalizationContext: ['groups' => ['minimal']])]
private ?Person $hostPerson = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
#[ORM\JoinColumn(nullable: true)]
private ?ThirdParty $hostThirdParty = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: false)]
private Person $person;