src/Entity/UserChoice.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * UserChoice
  7.  *
  8.  * @ORM\Table(name="user_choice")
  9.  * @ORM\HasLifecycleCallbacks()
  10.  * @ORM\Entity(repositoryClass="App\Repository\UserChoiceRepository")
  11.  */
  12. class UserChoice
  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 Cart
  24.      *
  25.      * @ORM\ManyToOne(targetEntity="User")
  26.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  27.      */
  28.     protected $user;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="type", type="string", length=255)
  33.      */
  34.     private $type;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="subjectClass", type="string", length=255, nullable=true)
  39.      */
  40.     private $subjectClass;
  41.     /**
  42.      * @var int
  43.      *
  44.      * @ORM\Column(name="subjectId", type="integer", nullable=true)
  45.      */
  46.     private $subjectId;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(name="value", type="string", length=255, nullable=true)
  51.      */
  52.     private $value;
  53.     /**
  54.      * @var DateTime
  55.      *
  56.      * @ORM\Column(name="createdAt", type="datetime")
  57.      */
  58.     private $createdAt;
  59.     /**
  60.      * @var DateTime
  61.      *
  62.      * @ORM\Column(name="updatedAt", type="datetime")
  63.      */
  64.     private $updatedAt;
  65.     /**
  66.      * Get id
  67.      *
  68.      * @return int
  69.      */
  70.     public function getId()
  71.     {
  72.         return $this->id;
  73.     }
  74.     /**
  75.      * Set type
  76.      *
  77.      * @param string $type
  78.      *
  79.      * @return UserChoice
  80.      */
  81.     public function setType($type)
  82.     {
  83.         $this->type $type;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get type
  88.      *
  89.      * @return string
  90.      */
  91.     public function getType()
  92.     {
  93.         return $this->type;
  94.     }
  95.     /**
  96.      * Set subjectClass
  97.      *
  98.      * @param string $subjectClass
  99.      *
  100.      * @return UserChoice
  101.      */
  102.     public function setSubjectClass($subjectClass)
  103.     {
  104.         $this->subjectClass $subjectClass;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get subjectClass
  109.      *
  110.      * @return string
  111.      */
  112.     public function getSubjectClass()
  113.     {
  114.         return $this->subjectClass;
  115.     }
  116.     /**
  117.      * Set subjectId
  118.      *
  119.      * @param integer $subjectId
  120.      *
  121.      * @return UserChoice
  122.      */
  123.     public function setSubjectId($subjectId)
  124.     {
  125.         $this->subjectId $subjectId;
  126.         return $this;
  127.     }
  128.     /**
  129.      * Get subjectId
  130.      *
  131.      * @return int
  132.      */
  133.     public function getSubjectId()
  134.     {
  135.         return $this->subjectId;
  136.     }
  137.     /**
  138.      * Set value
  139.      *
  140.      * @param string $value
  141.      *
  142.      * @return UserChoice
  143.      */
  144.     public function setValue($value)
  145.     {
  146.         $this->value $value;
  147.         return $this;
  148.     }
  149.     /**
  150.      * Get value
  151.      *
  152.      * @return string
  153.      */
  154.     public function getValue()
  155.     {
  156.         return $this->value;
  157.     }
  158.     /**
  159.      * @return Cart
  160.      */
  161.     public function getUser()
  162.     {
  163.         return $this->user;
  164.     }
  165.     /**
  166.      * @param Cart $user
  167.      */
  168.     public function setUser($user)
  169.     {
  170.         $this->user $user;
  171.     }
  172.     /**
  173.      * @ORM\PrePersist()
  174.      */
  175.     public function creationDate()
  176.     {
  177.         $this->createdAt = new DateTime();
  178.         $this->updatedAt = new DateTime();
  179.         return $this;
  180.     }
  181.     /**
  182.      * @ORM\PreUpdate
  183.      */
  184.     public function updatedDate()
  185.     {
  186.         $this->updatedAt = new DateTime();
  187.         return $this;
  188.     }
  189.     /**
  190.      * @return DateTime
  191.      */
  192.     public function getCreatedAt()
  193.     {
  194.         return $this->createdAt;
  195.     }
  196.     /**
  197.      * @param DateTime $createdAt
  198.      */
  199.     public function setCreatedAt($createdAt)
  200.     {
  201.         $this->createdAt $createdAt;
  202.     }
  203.     /**
  204.      * @return DateTime
  205.      */
  206.     public function getUpdatedAt()
  207.     {
  208.         return $this->updatedAt;
  209.     }
  210.     /**
  211.      * @param DateTime $updatedAt
  212.      */
  213.     public function setUpdatedAt($updatedAt)
  214.     {
  215.         $this->updatedAt $updatedAt;
  216.     }
  217. }