src/Entity/ProductSalesUnit.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Class ProductSalesUnit
  7.  *
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="malys_product_sales_unit")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @package App\Entity
  12.  */
  13. class ProductSalesUnit
  14. {
  15.     /**
  16.      * @var integer
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="label", type="string", length=255, nullable=false)
  27.      */
  28.     protected $label;
  29.     /**
  30.      * @var DateTime
  31.      *
  32.      * @ORM\Column(name="created_at", type="datetime", nullable=false)
  33.      */
  34.     protected $createdAt;
  35.     /**
  36.      * @var DateTime
  37.      *
  38.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  39.      */
  40.     protected $updatedAt;
  41.     /**
  42.      *
  43.      * @var Unit
  44.      *
  45.      * @ORM\ManyToOne(targetEntity="Unit")
  46.      * @ORM\JoinColumn(name="mapped_unit_id", referencedColumnName="id", nullable=true)
  47.      */
  48.     protected $mappedUnit;
  49.     /**
  50.      * @return int
  51.      */
  52.     public function getId()
  53.     {
  54.         return $this->id;
  55.     }
  56.     /**
  57.      * @param int $id
  58.      */
  59.     public function setId($id)
  60.     {
  61.         $this->id $id;
  62.     }
  63.     /**
  64.      * @return string
  65.      */
  66.     public function getLabel()
  67.     {
  68.         return $this->label;
  69.     }
  70.     /**
  71.      * @param string $label
  72.      */
  73.     public function setLabel($label)
  74.     {
  75.         $this->label $label;
  76.     }
  77.     /**
  78.      * @return DateTime
  79.      */
  80.     public function getCreatedAt()
  81.     {
  82.         return $this->createdAt;
  83.     }
  84.     /**
  85.      * @return ProductSalesUnit
  86.      * @ORM\PrePersist()
  87.      */
  88.     public function setCreatedAt()
  89.     {
  90.         $this->createdAt = new DateTime();
  91.         $this->updatedAt = new DateTime();
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return DateTime
  96.      */
  97.     public function getUpdatedAt()
  98.     {
  99.         return $this->updatedAt;
  100.     }
  101.     /**
  102.      * Set updatedAt
  103.      *
  104.      * @return ProductSalesUnit
  105.      * @ORM\PreUpdate
  106.      */
  107.     public function setUpdatedAt()
  108.     {
  109.         $this->updatedAt = new DateTime();
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return Unit
  114.      */
  115.     public function getMappedUnit()
  116.     {
  117.         return $this->mappedUnit;
  118.     }
  119.     /**
  120.      * @param Unit $mappedUnit
  121.      */
  122.     public function setMappedUnit($mappedUnit)
  123.     {
  124.         $this->mappedUnit $mappedUnit;
  125.     }
  126. }