src/Entity/TypePoint.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Util\UUIDGeneratorUtil;
  5. /**
  6.  * TypePoint
  7.  * @ORM\Table(name="type_point")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  * @ORM\Entity(repositoryClass="App\Repository\TypePointRepository")
  10.  */
  11. class TypePoint {
  12.     const TYPE_LOCAL 1;
  13.     const TYPE_GLOBAL 2;
  14.     const TYPE_CUSTOM 3;
  15.     const WORK_AS_LOCAL 1;
  16.     const WORK_AS_GLOBAl 2;
  17.     const WORK_AS_CUSTOM 3;
  18.     /**
  19.      * @var integer
  20.      * @ORM\Column(name="tp_id", type="guid")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="NONE")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var integer
  27.      * @ORM\Column(name="tp_type", type="integer")
  28.      */
  29.     private $type;
  30.     /**
  31.      * @var string
  32.      * @ORM\Column(name="tp_name", type="string")
  33.      */
  34.     private $name;
  35.     /**
  36.      * @var string
  37.      * @ORM\Column(name="tp_description", type="text")
  38.      */
  39.     private $description;
  40.     /**
  41.      * @var \DateTime
  42.      * @ORM\Column(name="tp_date_created", type="datetime")
  43.      */
  44.     private $dateCreated;
  45.     /**
  46.      * @var decimal
  47.      * @ORM\Column(name="tp_cash_ratio", type="decimal", precision=15, scale=6)
  48.      */
  49.     private $cashRatio;
  50.     /**
  51.      * @var integer
  52.      * @ORM\Column(name="tp_work_as", type="integer")
  53.      */
  54.     private $workAs;
  55.     /**
  56.      * @return type
  57.      */
  58.     public function getId() {
  59.         return $this->id;
  60.     }
  61.     /**
  62.      * @return type
  63.      */
  64.     public function getWorkAs() {
  65.         return $this->workAs;
  66.     }
  67.     /**
  68.      * @param type $workAs
  69.      */
  70.     public function setWorkAs($workAs) {
  71.         $this->workAs $workAs;
  72.     }
  73.     /**
  74.      * @return type
  75.      */
  76.     public function getType() {
  77.         return $this->type;
  78.     }
  79.     /**
  80.      * @return type
  81.      */
  82.     public function getName() {
  83.         return $this->name;
  84.     }
  85.     /**
  86.      * @return type
  87.      */
  88.     public function getDescription() {
  89.         return $this->description;
  90.     }
  91.     /**
  92.      * @return \DateTime
  93.      */
  94.     public function getDateCreated(): \DateTime {
  95.         return $this->dateCreated;
  96.     }
  97.     /**
  98.      * @return type
  99.      */
  100.     public function getCashRatio() {
  101.         return $this->cashRatio;
  102.     }
  103.     /**
  104.      * @param type $id
  105.      */
  106.     public function setId($id) {
  107.         $this->id $id;
  108.     }
  109.     /**
  110.      * @param type $type
  111.      */
  112.     public function setType($type) {
  113.         $this->type $type;
  114.     }
  115.     /**
  116.      * @param type $name
  117.      */
  118.     public function setName($name) {
  119.         $this->name $name;
  120.     }
  121.     /**
  122.      * @param type $description
  123.      */
  124.     public function setDescription($description) {
  125.         $this->description $description;
  126.     }
  127.     /**
  128.      * @param \DateTime $dateCreated
  129.      */
  130.     public function setDateCreated(\DateTime $dateCreated) {
  131.         $this->dateCreated $dateCreated;
  132.     }
  133.     /**
  134.      * @param type $cashRatio
  135.      */
  136.     public function setCashRatio($cashRatio) {
  137.         $this->cashRatio $cashRatio;
  138.     }
  139.     /**
  140.      * @ORM\PrePersist
  141.      */
  142.     public function syncPrePersist() {
  143.         if (!$this->id) {
  144.             $newUUID UUIDGeneratorUtil::getUUIDv4();
  145.             $this->setId($newUUID);
  146.         }
  147.     }
  148.     /**
  149.      * @return type
  150.      */
  151.     public function showEverything() {
  152.         return get_object_vars($this);
  153.     }
  154. }