src/Entity/MemberRanking.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use JMS\Serializer\Annotation\Groups;
  5. /**
  6.  * @ORM\Table("MemberRanking")
  7.  *
  8.  * @ORM\HasLifecycleCallbacks()
  9.  *
  10.  * @ORM\Entity(repositoryClass="App\Repository\MemberRankingRepository")
  11.  */
  12. class MemberRanking
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      *
  17.      * @ORM\GeneratedValue()
  18.      *
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @Groups({"amateur_search"})
  24.      *
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private int $like_count 0;
  28.     /**
  29.      * @ORM\Column(type="integer")
  30.      */
  31.     private int $imageset_count 0;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private int $videos_count 0;
  36.     /**
  37.      * @Groups({"amateur_search"})
  38.      *
  39.      * @ORM\Column(type="float", nullable=true)
  40.      */
  41.     private ?float $amateur_score 0;
  42.     /**
  43.      * @Groups({"amateur_search"})
  44.      *
  45.      * @ORM\Column(type="float")
  46.      */
  47.     private float $rank 0;
  48.     /**
  49.      * @ORM\Column(type="float", nullable=true)
  50.      */
  51.     private ?float $rank_modifier 1;
  52.     /**
  53.      * @ORM\OneToOne(targetEntity="App\Entity\Member", cascade={"persist"}, inversedBy="ranking")
  54.      *
  55.      * @ORM\JoinColumn(name="member", referencedColumnName="id", onDelete="CASCADE", nullable=false)
  56.      */
  57.     private ?Member $member null;
  58.     /**
  59.      * @ORM\Column(type="datetime")
  60.      */
  61.     private $created_at;
  62.     /**
  63.      * @ORM\Column(type="datetime", nullable=true)
  64.      */
  65.     private $updated_at;
  66.     /**
  67.      * @ORM\Column(type="integer")
  68.      */
  69.     private int $spam_score 0;
  70.     /**
  71.      * @ORM\PrePersist()
  72.      */
  73.     public function prePersist()
  74.     {
  75.         if (!$this->getCreatedAt()) {
  76.             $this->setCreatedAt(new \DateTime());
  77.         }
  78.         if (!$this->getUpdatedAt()) {
  79.             $this->setUpdatedAt(new \DateTime());
  80.         }
  81.     }
  82.     public function getId(): ?int
  83.     {
  84.         return $this->id;
  85.     }
  86.     public function getLikeCount(): ?int
  87.     {
  88.         return $this->like_count;
  89.     }
  90.     public function setLikeCount(int $like_count): self
  91.     {
  92.         $this->like_count $like_count;
  93.         return $this;
  94.     }
  95.     public function getImagesetCount(): ?int
  96.     {
  97.         return $this->imageset_count;
  98.     }
  99.     public function setImagesetCount(int $imageset_count): self
  100.     {
  101.         $this->imageset_count $imageset_count;
  102.         return $this;
  103.     }
  104.     public function getVideosCount(): ?int
  105.     {
  106.         return $this->videos_count;
  107.     }
  108.     public function setVideosCount(int $videos_count): self
  109.     {
  110.         $this->videos_count $videos_count;
  111.         return $this;
  112.     }
  113.     public function getAmateurScore(): ?float
  114.     {
  115.         return $this->amateur_score;
  116.     }
  117.     public function setAmateurScore(?float $amateur_score): self
  118.     {
  119.         $this->amateur_score $amateur_score;
  120.         return $this;
  121.     }
  122.     public function getRank(): ?float
  123.     {
  124.         return $this->rank;
  125.     }
  126.     public function setRank(float $rank): self
  127.     {
  128.         $this->rank $rank;
  129.         return $this;
  130.     }
  131.     public function getRankModifier(): ?float
  132.     {
  133.         return $this->rank_modifier;
  134.     }
  135.     public function setRankModifier(?float $rank_modifier): self
  136.     {
  137.         $this->rank_modifier $rank_modifier;
  138.         return $this;
  139.     }
  140.     public function getMember(): ?Member
  141.     {
  142.         return $this->member;
  143.     }
  144.     public function setMember(Member $member): self
  145.     {
  146.         $this->member $member;
  147.         return $this;
  148.     }
  149.     public function getCreatedAt(): ?\DateTimeInterface
  150.     {
  151.         return $this->created_at;
  152.     }
  153.     public function setCreatedAt(\DateTimeInterface $created_at): self
  154.     {
  155.         $this->created_at $created_at;
  156.         return $this;
  157.     }
  158.     public function getUpdatedAt(): ?\DateTimeInterface
  159.     {
  160.         return $this->updated_at;
  161.     }
  162.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  163.     {
  164.         $this->updated_at $updated_at;
  165.         return $this;
  166.     }
  167.     public function getSpamScore(): ?int
  168.     {
  169.         return $this->spam_score;
  170.     }
  171.     public function setSpamScore(int $spam_score): self
  172.     {
  173.         $this->spam_score $spam_score;
  174.         return $this;
  175.     }
  176. }