src/StatsBundle/Entity/Value.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\StatsBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Value
  6.  *
  7.  * @ORM\Table(name="value")
  8.  * @ORM\Entity(repositoryClass="App\StatsBundle\Repository\ValueRepository")
  9.  * @ORM\HasLifecycleCallbacks()
  10.  */
  11. class Value
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @ORM\Column(name="type", type="string", length=255)
  25.      */
  26.     private $type;
  27.     /**
  28.      * @var float
  29.      *
  30.      * @ORM\Column(name="value", type="float", nullable=false)
  31.      */
  32.     protected $value;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(name="authorClass", type="string", length=255, nullable=true)
  37.      */
  38.     private $authorClass;
  39.     /**
  40.      * @var int
  41.      *
  42.      * @ORM\Column(name="authorId", type="integer", nullable=true)
  43.      */
  44.     private $authorId;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(name="subjectClass", type="string", length=255, nullable=true)
  49.      */
  50.     private $subjectClass;
  51.     /**
  52.      * @var int
  53.      *
  54.      * @ORM\Column(name="subjectId", type="integer", nullable=true)
  55.      */
  56.     private $subjectId;
  57.     /**
  58.      * @var \DateTime
  59.      *
  60.      * @ORM\Column(name="date", type="date")
  61.      */
  62.     private $date;
  63.     /**
  64.      * @var \DateTime
  65.      *
  66.      * @ORM\Column(name="createdAt", type="datetime")
  67.      */
  68.     private $createdAt;
  69.     /**
  70.      * @var \DateTime
  71.      *
  72.      * @ORM\Column(name="updatedAt", type="datetime")
  73.      */
  74.     private $updatedAt;
  75.     /**
  76.      * Get id
  77.      *
  78.      * @return int
  79.      */
  80.     public function getId()
  81.     {
  82.         return $this->id;
  83.     }
  84.     /**
  85.      * Set type
  86.      *
  87.      * @param string $type
  88.      *
  89.      * @return Value
  90.      */
  91.     public function setType($type)
  92.     {
  93.         $this->type $type;
  94.         return $this;
  95.     }
  96.     /**
  97.      * Get type
  98.      *
  99.      * @return string
  100.      */
  101.     public function getType()
  102.     {
  103.         return $this->type;
  104.     }
  105.     /**
  106.      * Set authorClass
  107.      *
  108.      * @param string $authorClass
  109.      *
  110.      * @return Value
  111.      */
  112.     public function setAuthorClass($authorClass)
  113.     {
  114.         $this->authorClass $authorClass;
  115.         return $this;
  116.     }
  117.     /**
  118.      * Get authorClass
  119.      *
  120.      * @return string
  121.      */
  122.     public function getAuthorClass()
  123.     {
  124.         return $this->authorClass;
  125.     }
  126.     /**
  127.      * Set authorId
  128.      *
  129.      * @param integer $authorId
  130.      *
  131.      * @return Value
  132.      */
  133.     public function setAuthorId($authorId)
  134.     {
  135.         $this->authorId $authorId;
  136.         return $this;
  137.     }
  138.     /**
  139.      * Get authorId
  140.      *
  141.      * @return int
  142.      */
  143.     public function getAuthorId()
  144.     {
  145.         return $this->authorId;
  146.     }
  147.     /**
  148.      * Set subjectClass
  149.      *
  150.      * @param string $subjectClass
  151.      *
  152.      * @return Value
  153.      */
  154.     public function setSubjectClass($subjectClass)
  155.     {
  156.         $this->subjectClass $subjectClass;
  157.         return $this;
  158.     }
  159.     /**
  160.      * Get subjectClass
  161.      *
  162.      * @return string
  163.      */
  164.     public function getSubjectClass()
  165.     {
  166.         return $this->subjectClass;
  167.     }
  168.     /**
  169.      * Set subjectId
  170.      *
  171.      * @param integer $subjectId
  172.      *
  173.      * @return Value
  174.      */
  175.     public function setSubjectId($subjectId)
  176.     {
  177.         $this->subjectId $subjectId;
  178.         return $this;
  179.     }
  180.     /**
  181.      * Get subjectId
  182.      *
  183.      * @return int
  184.      */
  185.     public function getSubjectId()
  186.     {
  187.         return $this->subjectId;
  188.     }
  189.     /**
  190.      * Set date
  191.      *
  192.      * @param \DateTime $date
  193.      *
  194.      * @return Value
  195.      */
  196.     public function setDate($date)
  197.     {
  198.         $this->date $date;
  199.         return $this;
  200.     }
  201.     /**
  202.      * Get date
  203.      *
  204.      * @return \DateTime
  205.      */
  206.     public function getDate()
  207.     {
  208.         return $this->date;
  209.     }
  210.     /**
  211.      * @return \DateTime
  212.      */
  213.     public function getCreatedAt()
  214.     {
  215.         return $this->createdAt;
  216.     }
  217.     /**
  218.      * @return Value
  219.      * @ORM\PrePersist()
  220.      * @throws \Exception
  221.      */
  222.     public function setCreatedAt()
  223.     {
  224.         $this->createdAt = new \DateTime();
  225.         $this->updatedAt = new \DateTime();
  226.         return $this;
  227.     }
  228.     /**
  229.      * @return \DateTime
  230.      */
  231.     public function getUpdatedAt()
  232.     {
  233.         return $this->updatedAt;
  234.     }
  235.     /**
  236.      * Set updatedAt
  237.      *
  238.      * @return Value
  239.      * @ORM\PreUpdate
  240.      * @throws \Exception
  241.      */
  242.     public function setUpdatedAt()
  243.     {
  244.         $this->updatedAt = new \DateTime();
  245.         return $this;
  246.     }
  247.     /**
  248.      * @return float
  249.      */
  250.     public function getValue()
  251.     {
  252.         return $this->value;
  253.     }
  254.     /**
  255.      * @param float $value
  256.      */
  257.     public function setValue($value)
  258.     {
  259.         $this->value $value;
  260.     }
  261. }