<?php
namespace App\Entity\Company\Person;
use App\Entity\Company;
use App\Entity\Company\Person\Rules\DeadlineDay;
use App\Entity\Company\Person\Rules\Duration;
use App\Entity\Company\Person\Rules\PriceRule;
use App\Entity\Company\Person\Rules\StarRule;
use App\Entity\Company\Person\Rules\FlightCabin;
use App\Entity\Company\Person\Rules\CarClass;
use App\Entity\Company\Person\RulePerson;
use App\Entity\Traits\Creation;
use App\Entity\Traits\Deleteable;
use App\Entity\Traits\Idable;
use App\Repository\Company\Person\RuleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RuleRepository::class)]
#[ORM\Table(name: 'company_person_rules')]
class Rule
{
use Idable;
use Creation;
use Deleteable;
#[ORM\ManyToOne(targetEntity: Company::class)]
protected $company;
#[ORM\Column(type: 'string', nullable: true)]
protected $name;
#[ORM\Column(type: 'boolean', nullable: true, options: ['default' => 0])]
protected $isGeneric;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: PriceRule::class)]
protected $prices;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: StarRule::class)]
protected $stars;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: DeadlineDay::class)]
protected $deadlineDay;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: Duration::class)]
protected $duration;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: FlightCabin::class)]
protected $cabins;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: CarClass::class)]
protected $carClass;
#[ORM\OneToMany(mappedBy: 'rule', targetEntity: RulePerson::class)]
protected $persons;
public function __construct()
{
$this->prices = new ArrayCollection();
$this->stars = new ArrayCollection();
$this->cabins = new ArrayCollection();
$this->carClass = new ArrayCollection();
$this->persons = new ArrayCollection();
}
/**
* @return mixed
*/
public function getCompany()
{
return $this->company;
}
/**
* @param mixed $company
*/
public function setCompany($company): void
{
$this->company = $company;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name): void
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getIsGeneric()
{
return $this->isGeneric;
}
/**
* @param mixed $isGeneric
*/
public function setIsGeneric($isGeneric): void
{
$this->isGeneric = $isGeneric;
}
/**
* @return ArrayCollection
*/
public function getPrices()
{
return $this->prices;
}
/**
* @return ArrayCollection
*/
public function getStars()
{
return $this->stars;
}
/**
* @return ArrayCollection
*/
public function getCabins()
{
return $this->cabins;
}
/**
* @return ArrayCollection
*/
public function getCarClass()
{
return $this->carClass;
}
/**
* @return ArrayCollection
*/
public function getPersons()
{
return $this->persons;
}
/**
* @return mixed
*/
public function getDeadlineDay()
{
return $this->deadlineDay;
}
/**
* @return mixed
*/
public function getDuration()
{
return $this->duration;
}
/**
* @param mixed $duration
*/
public function setDuration($duration): void
{
$this->duration = $duration;
}
}