src/Entity/Otpusk/CountryCharacteristic.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Otpusk;
  3. use App\Repository\Otpusk\CountryCharacteristicRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  8. use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
  9. /**
  10.  * @ORM\Entity(repositoryClass=CountryCharacteristicRepository::class)
  11.  */
  12. class CountryCharacteristic implements TranslatableInterface
  13. {
  14.     use TranslatableTrait;
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Otpusk\Market", inversedBy="countryCharacteristics")
  23.      * @ORM\JoinColumn(name="market_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  24.      */
  25.     private $market;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Otpusk\Country", inversedBy="countryCharacteristics")
  28.      * @ORM\JoinColumn(name="country_id", referencedColumnName="rec_id", nullable=false, onDelete="CASCADE")
  29.      */
  30.     private $country;
  31.     /**
  32.      * @var int|null
  33.      * @ORM\Column(type="string", length=6, nullable=true)
  34.      */
  35.     private $flightTime;
  36.     public function setId($id): self
  37.     {
  38.         $this->id $id;
  39.         return $this;
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getMarket(): ?Market
  46.     {
  47.         return $this->market;
  48.     }
  49.     public function setMarket(?Market $market): self
  50.     {
  51.         $this->market $market;
  52.         return $this;
  53.     }
  54.     public function getCountry(): ?Country
  55.     {
  56.         return $this->country;
  57.     }
  58.     public function setCountry(?Country $country): self
  59.     {
  60.         $this->country $country;
  61.         return $this;
  62.     }
  63.     public function getFlightTime(): ?string
  64.     {
  65.         return $this->flightTime;
  66.     }
  67.     public function setFlightTime(?string $flightTime): self
  68.     {
  69.         $this->flightTime $flightTime;
  70.         return $this;
  71.     }
  72.     public function __toString()
  73.     {
  74.         return $this->getMarket()->getName().'-'.$this->getCountry()->getName();
  75.     }
  76. }