src/Entity/Gos/OrderTerm.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. /**
  6.  * OrderType
  7.  *
  8.  * @ORM\Table()
  9.  * @ORM\Entity(repositoryClass="App\Repository\Gos\OrdersTermRepository")
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class OrderTerm
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="name", type="string", length=255)
  26.      */
  27.     private $title;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity="Orders", inversedBy="orderTerms")
  30.      * @ORM\JoinColumn()
  31.      */
  32.     private $orders;
  33.     /**
  34.      * @ORM\Column(type="datetime")
  35.      */
  36.     private $createdAt;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $updatedAt;
  41.     /** @ORM\PrePersist() */
  42.     public function prePersist()
  43.     {
  44.         $this->createdAt = new \DateTime();
  45.     }
  46.     /** @ORM\PreUpdate() */
  47.     public function preUpdate()
  48.     {
  49.         $this->updatedAt = new \DateTime();
  50.     }
  51.     public function __toString()
  52.     {
  53.         return (string)$this->title;
  54.     }
  55.     /**
  56.      * Get id
  57.      *
  58.      * @return integer
  59.      */
  60.     public function getId()
  61.     {
  62.         return $this->id;
  63.     }
  64.     /**
  65.      * Set title
  66.      *
  67.      * @param string $title
  68.      *
  69.      * @return OrderTerm
  70.      */
  71.     public function setTitle($title)
  72.     {
  73.         $this->title $title;
  74.         return $this;
  75.     }
  76.     /**
  77.      * Get title
  78.      *
  79.      * @return string
  80.      */
  81.     public function getTitle()
  82.     {
  83.         return $this->title;
  84.     }
  85.     /**
  86.      * Set createdAt
  87.      *
  88.      * @param \DateTime $createdAt
  89.      *
  90.      * @return OrderTerm
  91.      */
  92.     public function setCreatedAt($createdAt)
  93.     {
  94.         $this->createdAt $createdAt;
  95.         return $this;
  96.     }
  97.     /**
  98.      * Get createdAt
  99.      *
  100.      * @return \DateTime
  101.      */
  102.     public function getCreatedAt()
  103.     {
  104.         return $this->createdAt;
  105.     }
  106.     /**
  107.      * Set updatedAt
  108.      *
  109.      * @param \DateTime $updatedAt
  110.      *
  111.      * @return OrderTerm
  112.      */
  113.     public function setUpdatedAt($updatedAt)
  114.     {
  115.         $this->updatedAt $updatedAt;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Get updatedAt
  120.      *
  121.      * @return \DateTime
  122.      */
  123.     public function getUpdatedAt()
  124.     {
  125.         return $this->updatedAt;
  126.     }
  127.     /**
  128.      * Set orders
  129.      *
  130.      * @param \App\Entity\Gos\Orders $orders
  131.      *
  132.      * @return OrderTerm
  133.      */
  134.     public function setOrders(\App\Entity\Gos\Orders $orders null)
  135.     {
  136.         $this->orders $orders;
  137.         return $this;
  138.     }
  139.     /**
  140.      * Get orders
  141.      *
  142.      * @return \App\Entity\Gos\Orders
  143.      */
  144.     public function getOrders()
  145.     {
  146.         return $this->orders;
  147.     }
  148. }