Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 00:01:30 +02:00
parent 579bd829f8
commit 72016e1a21
124 changed files with 1724 additions and 3770 deletions

View File

@@ -27,12 +27,12 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Address.
*
* @ORM\Entity
*
* @ORM\Table(name="chill_main_address")
*
* @ORM\HasLifecycleCallbacks
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'chill_main_address')]
class Address implements TrackCreationInterface, TrackUpdateInterface
{
use TrackCreationTrait;
@@ -55,54 +55,39 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
*/
final public const ADDR_REFERENCE_STATUS_REVIEWED = 'reviewed';
/**
* @ORM\ManyToOne(targetEntity=AddressReference::class)
*/
#[Groups(['write'])]
#[ORM\ManyToOne(targetEntity: AddressReference::class)]
private ?AddressReference $addressReference = null;
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $buildingName = '';
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
private bool $confidential = false;
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $corridor = '';
/**
* used for the CEDEX information.
*
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $distribution = '';
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $extra = '';
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $flat = '';
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $floor = '';
/**
@@ -115,108 +100,89 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
*
* @readonly
*
* @ORM\ManyToMany(targetEntity=GeographicalUnit::class)
*
* @ORM\JoinTable(
* name="view_chill_main_address_geographical_unit",
* joinColumns={@ORM\JoinColumn(name="address_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="geographical_unit_id")}
* )
*/
#[ORM\ManyToMany(targetEntity: GeographicalUnit::class)]
#[ORM\JoinTable(name: 'view_chill_main_address_geographical_unit', joinColumns: [new ORM\JoinColumn(name: 'address_id')], inverseJoinColumns: [new ORM\JoinColumn(name: 'geographical_unit_id')])]
private Collection $geographicalUnits;
/**
* @ORM\Id
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @readonly
*/
#[Groups(['write'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
/**
* True if the address is a "no address", aka homeless person, ...
*
* @ORM\Column(type="boolean", options={"default": false})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
private bool $isNoAddress = false;
/**
* A ThirdParty reference for person's addresses that are linked to a third party.
*
* @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
*
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
#[Groups(['write'])]
#[ORM\ManyToOne(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
private ?ThirdParty $linkedToThirdParty = null;
/**
* A geospatial field storing the coordinates of the Address.
*
* @ORM\Column(type="point", nullable=true)
*/
#[Groups(['write'])]
#[ORM\Column(type: 'point', nullable: true)]
private ?Point $point = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\PostalCode")
*
* @ORM\JoinColumn(nullable=false)
*/
#[Groups(['write'])]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PostalCode::class)]
#[ORM\JoinColumn(nullable: false)]
private ?PostalCode $postcode = null;
/**
* @var self::ADDR_REFERENCE_STATUS_*
*
* @ORM\Column(type="text", nullable=false, options={"default": self::ADDR_REFERENCE_STATUS_MATCH})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => self::ADDR_REFERENCE_STATUS_MATCH])]
private string $refStatus = self::ADDR_REFERENCE_STATUS_MATCH;
/**
* @ORM\Column(type="datetime_immutable", nullable=false, options={"default": "CURRENT_TIMESTAMP"})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false, options: ['default' => 'CURRENT_TIMESTAMP'])]
private \DateTimeImmutable $refStatusLastUpdate;
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $steps = '';
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $street = '';
/**
* @ORM\Column(type="text", nullable=false, options={"default": ""})
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $streetNumber = '';
/**
* Indicates when the address starts validation. Used to build an history
* of address. By default, the current date.
*
* @ORM\Column(type="date")
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE)]
private \DateTime $validFrom;
/**
* Indicates when the address ends. Used to build an history
* of address.
*
* @ORM\Column(type="date", nullable=true)
*/
#[Groups(['write'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
private ?\DateTime $validTo = null;
public function __construct()