src/Entity/Geographical/Address.php line 25
<?php/** This file is part of the Pellipop project.** (c) Mobizel** For the full copyright and license information, please view the LICENSE* file that was distributed with this source code.*/declare(strict_types=1);namespace App\Entity\Geographical;use App\Entity\Customer\Customer;use App\Entity\IdentifiableTrait;use App\Repository\Geographical\AddressRepository;use Doctrine\ORM\Mapping as ORM;use Sylius\Component\Resource\Model\ResourceInterface;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: AddressRepository::class)]#[ORM\Table(name: 'app_address')]class Address implements ResourceInterface{use IdentifiableTrait;#[ORM\ManyToOne(targetEntity: Customer::class, inversedBy: 'addresses')]#[ORM\JoinColumn(name: "customer_id", referencedColumnName: "id", nullable: true, onDelete: "CASCADE")]private ?Customer $customer = null;#[ORM\Column(type: 'string', length: 100, nullable: true)]#[Assert\Email]private ?string $email = null;#[ORM\Column(type: 'string')]#[Assert\NotBlank]private ?string $firstName = null;#[ORM\Column(type: 'string')]#[Assert\NotBlank]private ?string $lastName = null;#[ORM\Column(type: 'string', nullable: true)]private ?string $phoneNumber = null;#[ORM\Column(type: 'string')]#[Assert\NotBlank]private ?string $street = null;#[ORM\Column(type: 'string', nullable: true)]private ?string $street2 = null;#[ORM\Column(type: 'string')]#[Assert\NotBlank]private ?string $city = null;#[ORM\Column(type: 'string', nullable: true)]private ?string $state = null;#[ORM\Column(type: 'string', length: 20)]#[Assert\NotBlank]private ?string $postcode = null;#[ORM\ManyToOne(targetEntity: Country::class)]#[Assert\NotBlank]#[ORM\JoinColumn(name: "country_id", referencedColumnName: "id")]private $country = null;#[ORM\Column(type: 'datetime_immutable')]private ?\DateTimeImmutable $createdAt = null;public function __construct(){$this->createdAt = new \DateTimeImmutable();}/*** Get the value of customer** @return ?Customer*/public function getCustomer(): ?Customer{return $this->customer;}/*** Set the value of customer** @return self*/public function setCustomer(?Customer $customer): self{$this->customer = $customer;return $this;}/*** Get the value of email** @return ?string*/public function getEmail(): ?string{return $this->email;}/*** Set the value of email** @return self*/public function setEmail(?string $email): self{$this->email = $email;return $this;}/*** Get the value of firstName** @return ?string*/public function getFirstName(): ?string{return $this->firstName;}/*** Set the value of firstName** @return self*/public function setFirstName(?string $firstName): self{$this->firstName = $firstName;return $this;}/*** Get the value of lastName** @return ?string*/public function getLastName(): ?string{return $this->lastName;}/*** Set the value of lastName** @return self*/public function setLastName(?string $lastName): self{$this->lastName = $lastName;return $this;}/*** Get the value of phoneNumber** @return ?string*/public function getPhoneNumber(): ?string{return $this->phoneNumber;}/*** Set the value of phoneNumber** @return self*/public function setPhoneNumber(?string $phoneNumber): self{$this->phoneNumber = $phoneNumber;return $this;}/*** Get the value of street** @return ?string*/public function getStreet(): ?string{return $this->street;}/*** Set the value of street** @return self*/public function setStreet(?string $street): self{$this->street = $street;return $this;}/*** Get the value of street2** @return ?string*/public function getStreet2(): ?string{return $this->street2;}/*** Set the value of street2** @return self*/public function setStreet2(?string $street2): self{$this->street2 = $street2;return $this;}/*** Get the value of city** @return ?string*/public function getCity(): ?string{return $this->city;}/*** Set the value of city** @return self*/public function setCity(?string $city): self{$this->city = $city;return $this;}/*** Get the value of postcode** @return ?string*/public function getPostcode(): ?string{return $this->postcode;}/*** Set the value of postcode** @return self*/public function setPostcode(?string $postcode): self{$this->postcode = $postcode;return $this;}/*** Get the value of country** @return ?Country*/public function getCountry(): ?Country{return $this->country;}/*** Set the value of country** @return self*/public function setCountry(?Country $country): self{$this->country = $country;return $this;}/*** Get the value of createdAt** @return ?\DateTimeImmutable*/public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}/*** Set the value of createdAt** @return self*/public function setCreatedAt(?\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}/*** @return string|null*/public function getState(): ?string{return $this->state;}/*** @param string|null $state*/public function setState(?string $state): void{$this->state = $state;}public function getFullName(): string{return trim(sprintf('%s %s', $this->firstName, $this->lastName));}}