src/App/Entity/Company/Person/Rule.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Company\Person;
  3. use App\Entity\Company;
  4. use App\Entity\Company\Person\Rules\DeadlineDay;
  5. use App\Entity\Company\Person\Rules\Duration;
  6. use App\Entity\Company\Person\Rules\PriceRule;
  7. use App\Entity\Company\Person\Rules\StarRule;
  8. use App\Entity\Company\Person\Rules\FlightCabin;
  9. use App\Entity\Company\Person\Rules\CarClass;
  10. use App\Entity\Company\Person\RulePerson;
  11. use App\Entity\Traits\Creation;
  12. use App\Entity\Traits\Deleteable;
  13. use App\Entity\Traits\Idable;
  14. use App\Repository\Company\Person\RuleRepository;
  15. use Doctrine\Common\Collections\ArrayCollection;
  16. use Doctrine\ORM\Mapping as ORM;
  17. #[ORM\Entity(repositoryClassRuleRepository::class)]
  18. #[ORM\Table(name'company_person_rules')]
  19. class Rule
  20. {
  21.     use Idable;
  22.     use Creation;
  23.     use Deleteable;
  24.     #[ORM\ManyToOne(targetEntityCompany::class)]
  25.     protected $company;
  26.     #[ORM\Column(type'string'nullabletrue)]
  27.     protected $name;
  28.     #[ORM\Column(type'boolean'nullabletrueoptions: ['default' => 0])]
  29.     protected $isGeneric;
  30.     #[ORM\OneToMany(mappedBy'rule'targetEntityPriceRule::class)]
  31.     protected $prices;
  32.     #[ORM\OneToMany(mappedBy'rule'targetEntityStarRule::class)]
  33.     protected $stars;
  34.     #[ORM\OneToMany(mappedBy'rule'targetEntityDeadlineDay::class)]
  35.     protected $deadlineDay;
  36.     #[ORM\OneToMany(mappedBy'rule'targetEntityDuration::class)]
  37.     protected $duration;
  38.     #[ORM\OneToMany(mappedBy'rule'targetEntityFlightCabin::class)]
  39.     protected $cabins;
  40.     #[ORM\OneToMany(mappedBy'rule'targetEntityCarClass::class)]
  41.     protected $carClass;
  42.     #[ORM\OneToMany(mappedBy'rule'targetEntityRulePerson::class)]
  43.     protected $persons;
  44.     public function __construct()
  45.     {
  46.         $this->prices = new ArrayCollection();
  47.         $this->stars = new ArrayCollection();
  48.         $this->cabins = new ArrayCollection();
  49.         $this->carClass = new ArrayCollection();
  50.         $this->persons = new ArrayCollection();
  51.     }
  52.     /**
  53.      * @return mixed
  54.      */
  55.     public function getCompany()
  56.     {
  57.         return $this->company;
  58.     }
  59.     /**
  60.      * @param mixed $company
  61.      */
  62.     public function setCompany($company): void
  63.     {
  64.         $this->company $company;
  65.     }
  66.     /**
  67.      * @return mixed
  68.      */
  69.     public function getName()
  70.     {
  71.         return $this->name;
  72.     }
  73.     /**
  74.      * @param mixed $name
  75.      */
  76.     public function setName($name): void
  77.     {
  78.         $this->name $name;
  79.     }
  80.     /**
  81.      * @return mixed
  82.      */
  83.     public function getIsGeneric()
  84.     {
  85.         return $this->isGeneric;
  86.     }
  87.     /**
  88.      * @param mixed $isGeneric
  89.      */
  90.     public function setIsGeneric($isGeneric): void
  91.     {
  92.         $this->isGeneric $isGeneric;
  93.     }
  94.     /**
  95.      * @return ArrayCollection
  96.      */
  97.     public function getPrices()
  98.     {
  99.         return $this->prices;
  100.     }
  101.     /**
  102.      * @return ArrayCollection
  103.      */
  104.     public function getStars()
  105.     {
  106.         return $this->stars;
  107.     }
  108.     /**
  109.      * @return ArrayCollection
  110.      */
  111.     public function getCabins()
  112.     {
  113.         return $this->cabins;
  114.     }
  115.     /**
  116.      * @return ArrayCollection
  117.      */
  118.     public function getCarClass()
  119.     {
  120.         return $this->carClass;
  121.     }
  122.     /**
  123.      * @return ArrayCollection
  124.      */
  125.     public function getPersons()
  126.     {
  127.         return $this->persons;
  128.     }
  129.     /**
  130.      * @return mixed
  131.      */
  132.     public function getDeadlineDay()
  133.     {
  134.         return $this->deadlineDay;
  135.     }
  136.     /**
  137.      * @return mixed
  138.      */
  139.     public function getDuration()
  140.     {
  141.         return $this->duration;
  142.     }
  143.     /**
  144.      * @param mixed $duration
  145.      */
  146.     public function setDuration($duration): void
  147.     {
  148.         $this->duration $duration;
  149.     }
  150. }