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

@@ -22,23 +22,23 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* PostalCode.
*
* @ORM\Entity
*
* @ORM\Table(
* name="chill_main_postal_code",
* uniqueConstraints={
*
* @ORM\UniqueConstraint(name="postal_code_import_unicity", columns={"code", "refpostalcodeid", "postalcodesource"},
* options={"where": "refpostalcodeid is not null"})
* },
* indexes={
*
* @ORM\Index(name="search_name_code", columns={"code", "label"}),
* @ORM\Index(name="search_by_reference_code", columns={"code", "refpostalcodeid"})
* })
*
* @ORM\HasLifecycleCallbacks
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'chill_main_postal_code')]
#[ORM\Index(name: 'search_name_code', columns: ['code', 'label'])]
#[ORM\Index(name: 'search_by_reference_code', columns: ['code', 'refpostalcodeid'])]
#[ORM\UniqueConstraint(name: 'postal_code_import_unicity', columns: ['code', 'refpostalcodeid', 'postalcodesource'], options: ['where' => 'refpostalcodeid is not null'])]
#[ORM\UniqueConstraint(name: 'postal_code_import_unicity', columns: ['code', 'refpostalcodeid', 'postalcodesource'], options: ['where' => 'refpostalcodeid is not null'])] // ,
#[ORM\Index(name: 'search_name_code', columns: ['code', 'label'])] // ,
#[ORM\Index(name: 'search_by_reference_code', columns: ['code', 'refpostalcodeid'])]
class PostalCode implements TrackUpdateInterface, TrackCreationInterface
{
use TrackCreationTrait;
@@ -49,66 +49,46 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
* This is an internal column which is populated by database.
*
* This column will ease the search operations
*
* @ORM\Column(type="text", options={"default": ""})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
private string $canonical = '';
/**
* @ORM\Column(type="point", nullable=true)
*/
#[Groups(['read'])]
#[ORM\Column(type: 'point', nullable: true)]
private ?Point $center = null;
/**
* @ORM\Column(type="string", length=100)
*/
#[Groups(['write', 'read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 100)]
private ?string $code = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Country")
*/
#[Groups(['write', 'read'])]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)]
private ?Country $country = null;
/**
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $deletedAt = null;
/**
* @ORM\Id
*
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
#[Groups(['write', 'read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
/**
* @ORM\Column(type="string", length=255, name="label")
*/
#[Groups(['write', 'read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, name: 'label')]
private ?string $name = null;
/**
* @ORM\Column(name="origin", type="integer", nullable=true)
*/
#[Groups(['write', 'read'])]
#[ORM\Column(name: 'origin', type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true)]
private int $origin = 0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
private ?string $postalCodeSource = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
private ?string $refPostalCodeId = null;
public function getCenter(): ?Point