src/Entity/ContractOrder.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContractOrderRepository;
  4. use App\Repository\ContractRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassContractOrderRepository::class)]
  10. class ContractOrder
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\ManyToOne]
  17.     private ?Term $term null;
  18.     #[ORM\ManyToOne]
  19.     private ?Destination $destination null;
  20.     #[ORM\ManyToOne]
  21.     private ?Accommodation $accommodation null;
  22.     #[ORM\ManyToOne]
  23.     private ?Client $client null;
  24.     #[ORM\Column(length32nullabletrue)]
  25.     private ?string $transferType null;
  26.     #[ORM\Column(length32nullabletrue)]
  27.     private ?string $cateringType null;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $boardingPlace null;
  30.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  31.     private ?string $note null;
  32.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  33.     private ?int $step 1;
  34.     #[ORM\Column]
  35.     private ?bool $returningClient false;
  36.     #[ORM\Column]
  37.     private ?bool $withPet false;
  38.     #[ORM\Column]
  39.     private ?bool $withDiet false;
  40.     #[ORM\Column]
  41.     private ?bool $firstMinute false;
  42.     #[ORM\ManyToOne]
  43.     private ?Client $contractClient1 null;
  44.     #[ORM\ManyToOne]
  45.     private ?Client $contractClient2 null;
  46.     #[ORM\ManyToOne]
  47.     private ?Client $contractClient3 null;
  48.     #[ORM\ManyToOne]
  49.     private ?Client $contractClient4 null;
  50.     #[ORM\ManyToOne]
  51.     private ?Client $contractClient5 null;
  52.     #[ORM\ManyToOne]
  53.     private ?Client $contractClient6 null;
  54.     public function __construct()
  55.     {
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getTerm(): ?Term
  62.     {
  63.         return $this->term;
  64.     }
  65.     public function setTerm(?Term $term): self
  66.     {
  67.         $this->term $term;
  68.         return $this;
  69.     }
  70.     public function getAccommodation(): ?Accommodation
  71.     {
  72.         return $this->accommodation;
  73.     }
  74.     public function setAccommodation(?Accommodation $accommodation): self
  75.     {
  76.         $this->accommodation $accommodation;
  77.         return $this;
  78.     }
  79.     public function getClient(): ?Client
  80.     {
  81.         return $this->client;
  82.     }
  83.     public function setClient(?Client $client): self
  84.     {
  85.         $this->client $client;
  86.         return $this;
  87.     }
  88.     public function getTransferType(): ?string
  89.     {
  90.         return $this->transferType;
  91.     }
  92.     public function setTransferType(?string $transferType): self
  93.     {
  94.         $this->transferType $transferType;
  95.         return $this;
  96.     }
  97.     public function getCateringType(): ?string
  98.     {
  99.         return $this->cateringType;
  100.     }
  101.     public function setCateringType(?string $cateringType): self
  102.     {
  103.         $this->cateringType $cateringType;
  104.         return $this;
  105.     }
  106.     public function getBoardingPlace(): ?string
  107.     {
  108.         return $this->boardingPlace;
  109.     }
  110.     public function setBoardingPlace(?string $boardingPlace): self
  111.     {
  112.         $this->boardingPlace $boardingPlace;
  113.         return $this;
  114.     }
  115.     public function getNote(): ?string
  116.     {
  117.         return $this->note;
  118.     }
  119.     public function setNote(?string $note): self
  120.     {
  121.         $this->note $note;
  122.         return $this;
  123.     }
  124.     /**
  125.      * @return Destination|null
  126.      */
  127.     public function getDestination(): ?Destination
  128.     {
  129.         return $this->destination;
  130.     }
  131.     /**
  132.      * @param Destination|null $destination
  133.      */
  134.     public function setDestination(?Destination $destination): void
  135.     {
  136.         $this->destination $destination;
  137.     }
  138.     /**
  139.      * @return int|null
  140.      */
  141.     public function getStep(): ?int
  142.     {
  143.         return $this->step;
  144.     }
  145.     /**
  146.      * @param int|null $step
  147.      */
  148.     public function setStep(?int $step): void
  149.     {
  150.         $this->step $step;
  151.     }
  152.     public function isReturningClient(): ?bool
  153.     {
  154.         return $this->returningClient;
  155.     }
  156.     public function setReturningClient(bool $returningClient): self
  157.     {
  158.         $this->returningClient $returningClient;
  159.         return $this;
  160.     }
  161.     public function isWithPet(): ?bool
  162.     {
  163.         return $this->withPet;
  164.     }
  165.     public function setWithPet(bool $withPet): self
  166.     {
  167.         $this->withPet $withPet;
  168.         return $this;
  169.     }
  170.     /**
  171.      * @return Client|null
  172.      */
  173.     public function getContractClient1(): ?Client
  174.     {
  175.         return $this->contractClient1;
  176.     }
  177.     /**
  178.      * @param Client|null $contractClient1
  179.      */
  180.     public function setContractClient1(?Client $contractClient1): void
  181.     {
  182.         $this->contractClient1 $contractClient1;
  183.     }
  184.     /**
  185.      * @return Client|null
  186.      */
  187.     public function getContractClient2(): ?Client
  188.     {
  189.         return $this->contractClient2;
  190.     }
  191.     /**
  192.      * @param Client|null $contractClient2
  193.      */
  194.     public function setContractClient2(?Client $contractClient2): void
  195.     {
  196.         $this->contractClient2 $contractClient2;
  197.     }
  198.     /**
  199.      * @return Client|null
  200.      */
  201.     public function getContractClient3(): ?Client
  202.     {
  203.         return $this->contractClient3;
  204.     }
  205.     /**
  206.      * @param Client|null $contractClient3
  207.      */
  208.     public function setContractClient3(?Client $contractClient3): void
  209.     {
  210.         $this->contractClient3 $contractClient3;
  211.     }
  212.     /**
  213.      * @return Client|null
  214.      */
  215.     public function getContractClient4(): ?Client
  216.     {
  217.         return $this->contractClient4;
  218.     }
  219.     /**
  220.      * @param Client|null $contractClient4
  221.      */
  222.     public function setContractClient4(?Client $contractClient4): void
  223.     {
  224.         $this->contractClient4 $contractClient4;
  225.     }
  226.     /**
  227.      * @return Client|null
  228.      */
  229.     public function getContractClient5(): ?Client
  230.     {
  231.         return $this->contractClient5;
  232.     }
  233.     /**
  234.      * @param Client|null $contractClient5
  235.      */
  236.     public function setContractClient5(?Client $contractClient5): void
  237.     {
  238.         $this->contractClient5 $contractClient5;
  239.     }
  240.     /**
  241.      * @return Client|null
  242.      */
  243.     public function getContractClient6(): ?Client
  244.     {
  245.         return $this->contractClient6;
  246.     }
  247.     /**
  248.      * @param Client|null $contractClient6
  249.      */
  250.     public function setContractClient6(?Client $contractClient6): void
  251.     {
  252.         $this->contractClient6 $contractClient6;
  253.     }
  254.     public function getAccommodationPrice()
  255.     {
  256.         foreach ($this->getTerm()->getTermPrices() as $termPrice) {
  257.             if ($termPrice->getAccommodation()->getId() === $this->getAccommodation()->getId()) {
  258.                 return $termPrice->getPrice();
  259.             }
  260.         }
  261.     }
  262.     /**
  263.      * @return bool|null
  264.      */
  265.     public function getFirstMinute(): ?bool
  266.     {
  267.         return $this->firstMinute;
  268.     }
  269.     /**
  270.      * @param bool|null $firstMinute
  271.      */
  272.     public function setFirstMinute(?bool $firstMinute): void
  273.     {
  274.         $this->firstMinute $firstMinute;
  275.     }
  276.     public function getWithDiet(): ?bool
  277.     {
  278.         return $this->withDiet;
  279.     }
  280.     public function setWithDiet(?bool $withDiet): void
  281.     {
  282.         $this->withDiet $withDiet;
  283.     }
  284. }