src/Entity/Advert.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Advert
  6.  *
  7.  * The query is on dep_stop_id, arr_stop_id and dep_datetime thus and index on thoses 3 columns can be added. Or we can also add an attribute archived
  8.  *
  9.  * @ORM\Table
  10.  * @ORM\Entity(repositoryClass="App\Repository\AdvertRepository")
  11.  */
  12. class Advert {
  13.     /**
  14.      * @ORM\Column(name="id", type="integer")
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue(strategy="AUTO")
  17.      */
  18.     private int $id;
  19.     /**
  20.      * @ORM\Column(name="dep_datetime", type="datetime")
  21.      */
  22.     private \DateTime $depDatetime;
  23.     /**
  24.      * @ORM\Column(name="arr_datetime", type="datetime")
  25.      */
  26.     private $arrDatetime;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity="App\Entity\Stop")
  29.      * @ORM\JoinColumn(name="dep_stop_id", nullable=false)
  30.      */
  31.     private Stop $depStop;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\Stop")
  34.      * @ORM\JoinColumn(name="arr_stop_id", nullable=false)
  35.      */
  36.     private Stop $arrStop;
  37.     /**
  38.      * @ORM\Column(name="seat", type="smallint")
  39.      */
  40.     private int $seat;
  41.     /**
  42.      * @ORM\Column(name="buy", type="decimal", precision=7, scale=2)
  43.      */
  44.     private int $buy;
  45.     /**
  46.      * @ORM\Column(name="resale", type="decimal", precision=7, scale=2)
  47.      */
  48.     private int $resale;
  49.     /**
  50.      * @ORM\Column(name="contact", type="string", length=255)
  51.      */
  52.     private string $contact;
  53.     /**
  54.      * @ORM\Column(name="comment", type="string", length=255, nullable=true)
  55.      */
  56.     private ?string $comment;
  57.     /**
  58.      * @ORM\Column(name="created_at", type="datetime")
  59.      */
  60.     private \DateTime $createdAt;
  61.     public $accepted;
  62.     public function getId(): ?int {
  63.         return $this->id;
  64.     }
  65.     public function getDepDatetime(): ?\DateTimeInterface {
  66.         return $this->depDatetime;
  67.     }
  68.     public function setDepDatetime(\DateTimeInterface $depDatetime): self {
  69.         $this->depDatetime $depDatetime;
  70.         return $this;
  71.     }
  72.     public function getArrDatetime(): ?\DateTimeInterface {
  73.         return $this->arrDatetime;
  74.     }
  75.     public function setArrDatetime(\DateTimeInterface $arrDatetime): self {
  76.         $this->arrDatetime $arrDatetime;
  77.         return $this;
  78.     }
  79.     public function getSeat(): ?int {
  80.         return $this->seat;
  81.     }
  82.     public function setSeat(int $seat): self {
  83.         $this->seat $seat;
  84.         return $this;
  85.     }
  86.     public function getBuy(): ?string {
  87.         return $this->buy;
  88.     }
  89.     public function setBuy(string $buy): self {
  90.         $this->buy $buy;
  91.         return $this;
  92.     }
  93.     public function getResale(): ?string {
  94.         return $this->resale;
  95.     }
  96.     public function setResale(string $resale): self {
  97.         $this->resale $resale;
  98.         return $this;
  99.     }
  100.     public function getContact(): ?string {
  101.         return $this->contact;
  102.     }
  103.     public function setContact(string $contact): self {
  104.         $this->contact $contact;
  105.         return $this;
  106.     }
  107.     public function getComment(): ?string {
  108.         return $this->comment;
  109.     }
  110.     public function setComment(?string $comment): self {
  111.         $this->comment $comment;
  112.         return $this;
  113.     }
  114.     public function getCreatedAt(): ?\DateTimeInterface {
  115.         return $this->createdAt;
  116.     }
  117.     public function setCreatedAt(\DateTimeInterface $createdAt): self {
  118.         $this->createdAt $createdAt;
  119.         return $this;
  120.     }
  121.     public function getDepStop(): ?Stop {
  122.         return $this->depStop;
  123.     }
  124.     public function setDepStop(?Stop $depStop): self {
  125.         $this->depStop $depStop;
  126.         return $this;
  127.     }
  128.     public function getArrStop(): ?Stop {
  129.         return $this->arrStop;
  130.     }
  131.     public function setArrStop(?Stop $arrStop): self {
  132.         $this->arrStop $arrStop;
  133.         return $this;
  134.     }
  135. }