<?php
namespace App\StatsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Value
*
* @ORM\Table(name="value")
* @ORM\Entity(repositoryClass="App\StatsBundle\Repository\ValueRepository")
* @ORM\HasLifecycleCallbacks()
*/
class Value
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=255)
*/
private $type;
/**
* @var float
*
* @ORM\Column(name="value", type="float", nullable=false)
*/
protected $value;
/**
* @var string
*
* @ORM\Column(name="authorClass", type="string", length=255, nullable=true)
*/
private $authorClass;
/**
* @var int
*
* @ORM\Column(name="authorId", type="integer", nullable=true)
*/
private $authorId;
/**
* @var string
*
* @ORM\Column(name="subjectClass", type="string", length=255, nullable=true)
*/
private $subjectClass;
/**
* @var int
*
* @ORM\Column(name="subjectId", type="integer", nullable=true)
*/
private $subjectId;
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="date")
*/
private $date;
/**
* @var \DateTime
*
* @ORM\Column(name="createdAt", type="datetime")
*/
private $createdAt;
/**
* @var \DateTime
*
* @ORM\Column(name="updatedAt", type="datetime")
*/
private $updatedAt;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set type
*
* @param string $type
*
* @return Value
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set authorClass
*
* @param string $authorClass
*
* @return Value
*/
public function setAuthorClass($authorClass)
{
$this->authorClass = $authorClass;
return $this;
}
/**
* Get authorClass
*
* @return string
*/
public function getAuthorClass()
{
return $this->authorClass;
}
/**
* Set authorId
*
* @param integer $authorId
*
* @return Value
*/
public function setAuthorId($authorId)
{
$this->authorId = $authorId;
return $this;
}
/**
* Get authorId
*
* @return int
*/
public function getAuthorId()
{
return $this->authorId;
}
/**
* Set subjectClass
*
* @param string $subjectClass
*
* @return Value
*/
public function setSubjectClass($subjectClass)
{
$this->subjectClass = $subjectClass;
return $this;
}
/**
* Get subjectClass
*
* @return string
*/
public function getSubjectClass()
{
return $this->subjectClass;
}
/**
* Set subjectId
*
* @param integer $subjectId
*
* @return Value
*/
public function setSubjectId($subjectId)
{
$this->subjectId = $subjectId;
return $this;
}
/**
* Get subjectId
*
* @return int
*/
public function getSubjectId()
{
return $this->subjectId;
}
/**
* Set date
*
* @param \DateTime $date
*
* @return Value
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
/**
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @return Value
* @ORM\PrePersist()
* @throws \Exception
*/
public function setCreatedAt()
{
$this->createdAt = new \DateTime();
$this->updatedAt = new \DateTime();
return $this;
}
/**
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set updatedAt
*
* @return Value
* @ORM\PreUpdate
* @throws \Exception
*/
public function setUpdatedAt()
{
$this->updatedAt = new \DateTime();
return $this;
}
/**
* @return float
*/
public function getValue()
{
return $this->value;
}
/**
* @param float $value
*/
public function setValue($value)
{
$this->value = $value;
}
}