src/Entity/UserGroupScore.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table("UsergroupScore")
  6.  *
  7.  * @ORM\HasLifecycleCallbacks()
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\UserGroupScoreRepository")
  10.  */
  11. class UserGroupScore
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      *
  16.      * @ORM\GeneratedValue()
  17.      *
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\UserGroup")
  23.      *
  24.      * @ORM\JoinColumn(name="group_id", referencedColumnName="id", onDelete="SET NULL")
  25.      */
  26.     private $userGroup;
  27.     /**
  28.      * @ORM\Column(type="smallint")
  29.      */
  30.     private $score 0;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $created_at;
  35.     /**
  36.      * @ORM\PrePersist()
  37.      */
  38.     public function prePersist()
  39.     {
  40.         if (!$this->getCreatedAt()) {
  41.             $this->setCreatedAt(new \DateTime());
  42.         }
  43.     }
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getUserGroup(): ?UserGroup
  49.     {
  50.         return $this->userGroup;
  51.     }
  52.     public function setUserGroup(?UserGroup $userGroup): self
  53.     {
  54.         $this->userGroup $userGroup;
  55.         return $this;
  56.     }
  57.     public function getScore(): ?int
  58.     {
  59.         return $this->score;
  60.     }
  61.     public function setScore(int $score): self
  62.     {
  63.         $this->score $score;
  64.         return $this;
  65.     }
  66.     public function getCreatedAt(): ?\DateTimeInterface
  67.     {
  68.         return $this->created_at;
  69.     }
  70.     public function setCreatedAt(\DateTimeInterface $created_at): self
  71.     {
  72.         $this->created_at $created_at;
  73.         return $this;
  74.     }
  75. }