Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.84 KB | None | 0 0
  1. *************************GroupTravelAirport
  2. <?php
  3.  
  4. namespace App\Entity;
  5.  
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Timestampable\Traits\TimestampableEntity;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * @ORM\Entity(repositoryClass="App\Repository\GroupTravelAirportsRepository")
  13.  */
  14. class GroupTravelAirport
  15. {
  16.     use TimestampableEntity;
  17.     /**
  18.      * @ORM\Id()
  19.      * @ORM\GeneratedValue()
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.  
  24.     /**
  25.      * @ORM\Column(type="boolean")
  26.      */
  27.     private $isActive;
  28.  
  29.     /**
  30.      * @ORM\Column(type="boolean")
  31.      */
  32.     private $isMain;
  33.  
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      */
  37.     private $priority;
  38.  
  39.     /**
  40.      * @ORM\Column(type="boolean")
  41.      */
  42.     private $isLowcost;
  43.  
  44.  
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="Airport", inversedBy="groupTravelAirports")
  47.      */
  48.     private $airport;
  49.  
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="GroupTravel", inversedBy="groupTravelAirports")
  52.      */
  53.     private $groupTravelPackage;
  54.  
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=false)
  57.      */
  58.     private $isDeleted = false;
  59.  
  60.     /**
  61.      * @ORM\ManyToMany(targetEntity="App\Entity\GroupTravelDate", mappedBy="groupTravelAirport")
  62.      */
  63.     private $groupTravelDates;
  64.  
  65.  
  66.     /**
  67.      * @ORM\Column(type="string", nullable=true)
  68.      */
  69.     private $airportNameDynamilyCreated;
  70.  
  71.  
  72.  
  73.  
  74.     public function __construct()
  75.     {
  76.         $this->groupTravelDates = new ArrayCollection();
  77.     }
  78.  
  79.     public function setId(int $id): ?int
  80.     {
  81.         return $this->id = $id;
  82.     }
  83.  
  84.     public function getId(): ?int
  85.     {
  86.         return $this->id;
  87.     }
  88.  
  89.     public function setIsActive(?bool $isActive): self
  90.     {
  91.         $this->isActive = $isActive;
  92.  
  93.         return $this;
  94.     }
  95.  
  96.     public function getIsMain(): ?bool
  97.     {
  98.         return $this->isMain;
  99.     }
  100.  
  101.     public function setIsMain(?bool $isMain): self
  102.     {
  103.         $this->isMain = $isMain;
  104.  
  105.         return $this;
  106.     }
  107.  
  108.     public function getPriority(): ?int
  109.     {
  110.         return $this->priority;
  111.     }
  112.  
  113.     public function setPriority(int $priority): self
  114.     {
  115.         $this->priority = $priority;
  116.  
  117.         return $this;
  118.     }
  119.  
  120.     public function getIsLowcost(): ?bool
  121.     {
  122.         return $this->isLowcost;
  123.     }
  124.  
  125.     public function setIsLowcost(bool $isLowcost): self
  126.     {
  127.         $this->isLowcost = $isLowcost;
  128.  
  129.         return $this;
  130.     }
  131.  
  132.     public function getAirport(): ?Airport
  133.     {
  134.         return $this->airport;
  135.     }
  136.  
  137.     public function setAirport(?Airport $airport): self
  138.     {
  139.         $this->airport = $airport;
  140.  
  141.         return $this;
  142.     }
  143.  
  144.     public function getGroupTravelPackage(): ?GroupTravel
  145.     {
  146.         return $this->groupTravelPackage;
  147.     }
  148.  
  149.     public function setGroupTravelPackage(?GroupTravel $groupTravelPackage): self
  150.     {
  151.         $this->groupTravelPackage = $groupTravelPackage;
  152.  
  153.         return $this;
  154.     }
  155.     public function getIsDeleted(): ?bool
  156.     {
  157.         return $this->isDeleted;
  158.     }
  159.  
  160.     public function setIsDeleted(bool $isDeleted): self
  161.     {
  162.         $this->isDeleted = $isDeleted;
  163.  
  164.         return $this;
  165.     }
  166.  
  167.  
  168.  
  169.     /**
  170.      * @return Collection|GroupTravelDate[]
  171.      */
  172.     public function getGroupTravelDates(): Collection
  173.     {
  174.         return $this->groupTravelDates;
  175.     }
  176.  
  177.     public function addGroupTravelDate(GroupTravelDate $groupTravelDate): self
  178.     {
  179.         if (!$this->groupTravelDates->contains($groupTravelDate)) {
  180.             $this->groupTravelDates[] = $groupTravelDate;
  181.             $groupTravelDate->addGroupTravelAirport($this);
  182.         }
  183.  
  184.         return $this;
  185.     }
  186.  
  187.     public function removeGroupTravelDate(GroupTravelDate $groupTravelDate): self
  188.     {
  189.         if ($this->groupTravelDates->contains($groupTravelDate)) {
  190.             $this->groupTravelDates->removeElement($groupTravelDate);
  191.             $groupTravelDate->removeGroupTravelAirport($this);
  192.         }
  193.  
  194.         return $this;
  195.     }
  196.  
  197.     public function getIsActive(): ?bool
  198.     {
  199.         return $this->isActive;
  200.     }
  201.  
  202.     public function getAirportNameDynamilyCreated(): ?string
  203.     {
  204.             return $this->airport->getAirportName();
  205.     }
  206.  
  207.     public function setAirportNameDynamilyCreated(string $airportNameDynamilyCreated): self
  208.     {
  209.         $this->airportNameDynamilyCreated = $airportNameDynamilyCreated;
  210.  
  211.         return $this;
  212.     }
  213.  
  214. }
  215. **********Airport
  216. <?php
  217.  
  218. namespace App\Entity;
  219.  
  220. use Doctrine\Common\Collections\ArrayCollection;
  221. use Doctrine\Common\Collections\Collection;
  222. use Doctrine\ORM\Mapping as ORM;
  223. use Gedmo\Timestampable\Traits\TimestampableEntity;
  224. use Symfony\Component\Validator\Constraints as Assert;
  225.  
  226. /**
  227.  * @ORM\Entity(repositoryClass="App\Repository\AirportRepository")
  228.  */
  229. class Airport
  230. {
  231.     use TimestampableEntity;
  232.     /**
  233.      * @ORM\Id()
  234.      * @ORM\GeneratedValue()
  235.      * @ORM\Column(type="integer")
  236.      */
  237.     private $id;
  238.  
  239.     /**
  240.      * @ORM\Column(type="string", length=5)
  241.      * @Assert\NotBlank(message="Please fill out this field")
  242.      */
  243.     private $airportCode;
  244.  
  245.     /**
  246.      * @ORM\Column(type="string", length=255)
  247.      * @Assert\NotBlank(message="Please fill out this field")
  248.      */
  249.     private $airportName;
  250.  
  251.     /**
  252.      * @ORM\Column(type="boolean")
  253.      */
  254.     private $isActive;
  255.  
  256.     /**
  257.      * @ORM\Column(type="boolean")
  258.      */
  259.     private $isMain;
  260.  
  261.     /**
  262.      * @ORM\Column(type="integer")
  263.      * @Assert\NotBlank(message="Please fill out this field")
  264.      */
  265.     private $priority;
  266.  
  267.     /**
  268.      * @ORM\Column(type="boolean", nullable=false)
  269.      */
  270.     private $isDeleted = false;
  271.  
  272.     /**
  273.      * @ORM\OneToMany(targetEntity="GroupTravel", mappedBy="airport")
  274.      */
  275.     private $groupTravelPackages;
  276.  
  277.     /**
  278.      * @ORM\OneToMany(targetEntity="GroupTravelAirport", mappedBy="airport")
  279.      */
  280.     private $groupTravelAirports;
  281.  
  282.     /**
  283.      * @ORM\OneToMany(targetEntity="App\Entity\GroupTravelOrder", mappedBy="airport")
  284.      */
  285.     private $groupTravelOrders;
  286.  
  287.     public function __construct()
  288.     {
  289.         $this->groupTravelPackages = new ArrayCollection();
  290.         $this->groupTravelAirports = new ArrayCollection();
  291.         $this->groupTravelOrders = new ArrayCollection();
  292.     }
  293.  
  294.  
  295.  
  296.     public function getId(): ?int
  297.     {
  298.         return $this->id;
  299.     }
  300.     public function setId(int $id): ?int
  301.     {
  302.         return $this->id = $id;
  303.     }
  304.  
  305.     public function getAirportCode(): ?string
  306.     {
  307.         return $this->airportCode;
  308.     }
  309.  
  310.     public function setAirportCode(string $airportCode): self
  311.     {
  312.         $this->airportCode = $airportCode;
  313.  
  314.         return $this;
  315.     }
  316.  
  317.     public function getAirportName(): ?string
  318.     {
  319.         return $this->airportName;
  320.     }
  321.  
  322.     public function setAirportName(string $airportName): self
  323.     {
  324.         $this->airportName = $airportName;
  325.  
  326.         return $this;
  327.     }
  328.  
  329.     public function getIsActive(): ?bool
  330.     {
  331.         return $this->isActive;
  332.     }
  333.  
  334.     public function setIsActive(bool $isActive): self
  335.     {
  336.         $this->isActive = $isActive;
  337.  
  338.         return $this;
  339.     }
  340.  
  341.     public function getIsMain(): ?bool
  342.     {
  343.         return $this->isMain;
  344.     }
  345.  
  346.     public function setIsMain(bool $isMain): self
  347.     {
  348.         $this->isMain = $isMain;
  349.  
  350.         return $this;
  351.     }
  352.  
  353.     public function getPriority(): ?int
  354.     {
  355.         return $this->priority;
  356.     }
  357.  
  358.     public function setPriority(int $priority): self
  359.     {
  360.         $this->priority = $priority;
  361.  
  362.         return $this;
  363.     }
  364.  
  365.     public function getIsDeleted(): ?bool
  366.     {
  367.         return $this->isDeleted;
  368.     }
  369.  
  370.     public function setIsDeleted(?bool $isDeleted): self
  371.     {
  372.         $this->isDeleted = $isDeleted;
  373.  
  374.         return $this;
  375.     }
  376.  
  377.     /**
  378.      * @return Collection|GroupTravel[]
  379.      */
  380.     public function getGroupTravelPackages(): Collection
  381.     {
  382.         return $this->groupTravelPackages;
  383.     }
  384.  
  385.     public function addGroupTravelPackage(GroupTravel $groupTravelPackage): self
  386.     {
  387.         if (!$this->groupTravelPackages->contains($groupTravelPackage)) {
  388.             $this->groupTravelPackages[] = $groupTravelPackage;
  389.             $groupTravelPackage->setAirport($this);
  390.         }
  391.  
  392.         return $this;
  393.     }
  394.  
  395.     public function removeGroupTravelPackage(GroupTravel $groupTravelPackage): self
  396.     {
  397.         if ($this->groupTravelPackages->contains($groupTravelPackage)) {
  398.             $this->groupTravelPackages->removeElement($groupTravelPackage);
  399.             // set the owning side to null (unless already changed)
  400.             if ($groupTravelPackage->getAirport() === $this) {
  401.                 $groupTravelPackage->setAirport(null);
  402.             }
  403.         }
  404.  
  405.         return $this;
  406.     }
  407.  
  408.     /**
  409.      * @return Collection|GroupTravelAirport[]
  410.      */
  411.     public function getGroupTravelAirports(): Collection
  412.     {
  413.         return $this->groupTravelAirports;
  414.     }
  415.  
  416.     public function addGroupTravelAirport(GroupTravelAirport $groupTravelAirport): self
  417.     {
  418.         if (!$this->groupTravelAirports->contains($groupTravelAirport)) {
  419.             $this->groupTravelAirports[] = $groupTravelAirport;
  420.             $groupTravelAirport->setAirport($this);
  421.         }
  422.  
  423.         return $this;
  424.     }
  425.  
  426.     public function removeGroupTravelAirport(GroupTravelAirport $groupTravelAirport): self
  427.     {
  428.         if ($this->groupTravelAirports->contains($groupTravelAirport)) {
  429.             $this->groupTravelAirports->removeElement($groupTravelAirport);
  430.             // set the owning side to null (unless already changed)
  431.             if ($groupTravelAirport->getAirport() === $this) {
  432.                 $groupTravelAirport->setAirport(null);
  433.             }
  434.         }
  435.  
  436.         return $this;
  437.     }
  438.  
  439.     /**
  440.      * @return Collection|GroupTravelOrder[]
  441.      */
  442.     public function getGroupTravelOrders(): Collection
  443.     {
  444.         return $this->groupTravelOrders;
  445.     }
  446.  
  447.     public function addGroupTravelOrder(GroupTravelOrder $groupTravelOrder): self
  448.     {
  449.         if (!$this->groupTravelOrders->contains($groupTravelOrder)) {
  450.             $this->groupTravelOrders[] = $groupTravelOrder;
  451.             $groupTravelOrder->setAirport($this);
  452.         }
  453.  
  454.         return $this;
  455.     }
  456.  
  457.     public function removeGroupTravelOrder(GroupTravelOrder $groupTravelOrder): self
  458.     {
  459.         if ($this->groupTravelOrders->contains($groupTravelOrder)) {
  460.             $this->groupTravelOrders->removeElement($groupTravelOrder);
  461.             // set the owning side to null (unless already changed)
  462.             if ($groupTravelOrder->getAirport() === $this) {
  463.                 $groupTravelOrder->setAirport(null);
  464.             }
  465.         }
  466.  
  467.         return $this;
  468.     }
  469.  
  470. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement