src/Entity/Client.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Loggable\Loggable;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Gedmo\Timestampable\Traits\TimestampableEntity;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. /**
  12.  * @ORM\Entity(repositoryClass=ClientRepository::class)
  13.  * @Gedmo\Loggable
  14.  */
  15. class Client implements Loggable
  16. {
  17.     /**
  18.      * Hook timestampable behavior
  19.      * updates createdAt, updatedAt fields
  20.      */
  21.     use TimestampableEntity;
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      * @Assert\NotBlank
  31.      */
  32. //    Last name:
  33.     private $name;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      * @Assert\NotBlank
  37.      * @Assert\Email()
  38.      */
  39.     private $email;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=FenceOffer::class, mappedBy="client")
  42.      */
  43.     private $fenceOffers;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      */
  47.     private $salutation;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $furtherSalutation;
  52.     /**
  53.      * @ORM\Column(type="string", length=255)
  54.      */
  55.     private $firstName;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $firm;
  60.     /**
  61.      * @ORM\Column(type="integer", length=255)
  62.      */
  63.     private $clientNumber;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true)
  66.      */
  67.     private $mobilePhone;
  68.     /**
  69.      * @ORM\Column(type="boolean")
  70.      */
  71.     private $invoiceRecipient;
  72.     /**
  73.      * @ORM\Column(type="string", length=255, nullable=true)
  74.      */
  75.     private $landLinePhone;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $website;
  80.     /**
  81.      * @ORM\Column(type="string", length=255, nullable=true)
  82.      */
  83.     private $fax;
  84.     /**
  85.      * @ORM\Column(type="string", length=255, nullable=true)
  86.      */
  87.     private $streetAndHouseNumber;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      */
  91.     private $postalCode;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      */
  95.     private $place;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private $land;
  100.     /**
  101.      * @ORM\Column(type="integer", options={"default": 1})
  102.      */
  103.     private $nextOfferNumber 1;
  104.     public function __construct()
  105.     {
  106.         $this->fenceOffers = new ArrayCollection();
  107.     }
  108.     public function getId(): ?int
  109.     {
  110.         return $this->id;
  111.     }
  112.     public function getName(): ?string
  113.     {
  114.         return $this->name;
  115.     }
  116.     public function setName(string $name): self
  117.     {
  118.         $this->name $name;
  119.         return $this;
  120.     }
  121.     public function getEmail(): ?string
  122.     {
  123.         return $this->email;
  124.     }
  125.     public function setEmail(string $email): self
  126.     {
  127.         $this->email $email;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, FenceOffer>
  132.      */
  133.     public function getFenceOffers(): Collection
  134.     {
  135.         return $this->fenceOffers;
  136.     }
  137.     public function addFenceOffer(FenceOffer $fenceOffer): self
  138.     {
  139.         if (!$this->fenceOffers->contains($fenceOffer)) {
  140.             $this->fenceOffers[] = $fenceOffer;
  141.             $fenceOffer->setClient($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeFenceOffer(FenceOffer $fenceOffer): self
  146.     {
  147.         if ($this->fenceOffers->removeElement($fenceOffer)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($fenceOffer->getClient() === $this) {
  150.                 $fenceOffer->setClient(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155.     public function __toString(): string
  156.     {
  157.         return $this->name;
  158.     }
  159.     public function getSalutation(): ?string
  160.     {
  161.         return $this->salutation;
  162.     }
  163.     public function setSalutation(?string $salutation): self
  164.     {
  165.         $this->salutation $salutation;
  166.         return $this;
  167.     }
  168.     public function getFurtherSalutation(): ?string
  169.     {
  170.         return $this->furtherSalutation;
  171.     }
  172.     public function setFurtherSalutation(?string $furtherSalutation): self
  173.     {
  174.         $this->furtherSalutation $furtherSalutation;
  175.         return $this;
  176.     }
  177.     public function getFirstName(): ?string
  178.     {
  179.         return $this->firstName;
  180.     }
  181.     public function setFirstName(string $firstName): self
  182.     {
  183.         $this->firstName $firstName;
  184.         return $this;
  185.     }
  186.     public function getFirm(): ?string
  187.     {
  188.         return $this->firm;
  189.     }
  190.     public function setFirm(?string $firm): self
  191.     {
  192.         $this->firm $firm;
  193.         return $this;
  194.     }
  195.     public function getClientNumber(): ?string
  196.     {
  197.         return $this->clientNumber;
  198.     }
  199.     public function setClientNumber(string $clientNumber): self
  200.     {
  201.         $this->clientNumber $clientNumber;
  202.         return $this;
  203.     }
  204.     public function getMobilePhone(): ?string
  205.     {
  206.         return $this->mobilePhone;
  207.     }
  208.     public function setMobilePhone(?string $mobilePhone): self
  209.     {
  210.         $this->mobilePhone $mobilePhone;
  211.         return $this;
  212.     }
  213.     public function isInvoiceRecipient(): ?bool
  214.     {
  215.         return $this->invoiceRecipient;
  216.     }
  217.     public function setInvoiceRecipient(bool $invoiceRecipient): self
  218.     {
  219.         $this->invoiceRecipient $invoiceRecipient;
  220.         return $this;
  221.     }
  222.     public function getLandLinePhone(): ?string
  223.     {
  224.         return $this->landLinePhone;
  225.     }
  226.     public function setLandLinePhone(?string $landLinePhone): self
  227.     {
  228.         $this->landLinePhone $landLinePhone;
  229.         return $this;
  230.     }
  231.     public function getWebsite(): ?string
  232.     {
  233.         return $this->website;
  234.     }
  235.     public function setWebsite(?string $website): self
  236.     {
  237.         $this->website $website;
  238.         return $this;
  239.     }
  240.     public function getFax(): ?string
  241.     {
  242.         return $this->fax;
  243.     }
  244.     public function setFax(?string $fax): self
  245.     {
  246.         $this->fax $fax;
  247.         return $this;
  248.     }
  249.     public function getStreetAndHouseNumber(): ?string
  250.     {
  251.         return $this->streetAndHouseNumber;
  252.     }
  253.     public function setStreetAndHouseNumber(?string $streetAndHouseNumber): self
  254.     {
  255.         $this->streetAndHouseNumber $streetAndHouseNumber;
  256.         return $this;
  257.     }
  258.     public function getPostalCode(): ?string
  259.     {
  260.         return $this->postalCode;
  261.     }
  262.     public function setPostalCode(?string $postalCode): self
  263.     {
  264.         $this->postalCode $postalCode;
  265.         return $this;
  266.     }
  267.     public function getPlace(): ?string
  268.     {
  269.         return $this->place;
  270.     }
  271.     public function setPlace(?string $place): self
  272.     {
  273.         $this->place $place;
  274.         return $this;
  275.     }
  276.     public function getLand(): ?string
  277.     {
  278.         return $this->land;
  279.     }
  280.     public function setLand(?string $land): self
  281.     {
  282.         $this->land $land;
  283.         return $this;
  284.     }
  285.     public function getNextOfferNumber(): int
  286.     {
  287.         return $this->nextOfferNumber;
  288.     }
  289.     public function incrementNextOfferNumber(): void
  290.     {
  291.         $this->nextOfferNumber++;
  292.     }
  293. }