src/Entity/Forum/UserBan.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Forum;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use JMS\Serializer\Annotation\Exclude;
  7. /**
  8.  * @ORM\Table(name="v_forum_user_ban")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Forum\UserBanRepository")
  10.  */
  11. class UserBan
  12. {
  13.     const USER_BAN_FROM_FORUM_FEATURE 'FORUM_FEATURE';
  14.     const USER_BAN_FROM_FORUM_POST_CREATE 'POST_CREATE';
  15.     const USER_BAN_FROM_FORUM_COMMENT_CREATE 'COMMENT_CREATE';
  16.     public static function getUserBanTypeDefinitions(){
  17.         return [
  18.             self::USER_BAN_FROM_FORUM_FEATURE => 'Forum Feature',
  19.             self::USER_BAN_FROM_FORUM_POST_CREATE => 'Post Create',
  20.             self::USER_BAN_FROM_FORUM_COMMENT_CREATE => 'Comment Create'
  21.         ];
  22.     }
  23.     /**
  24.      * @ORM\Id()
  25.      * @ORM\GeneratedValue()
  26.      * @ORM\Column(type="integer")
  27.      */
  28.     private $id;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  31.      * @Exclude
  32.      */
  33.     private $user;
  34.     /**
  35.      * @ORM\Column(name="ban_from", type="datetime", nullable=true)
  36.      */
  37.     private $banFrom;
  38.     /**
  39.      * @ORM\Column(name="ban_to", type="datetime", nullable=true)
  40.      */
  41.     private $banTo;
  42.     /**
  43.      * @ORM\Column(name="ban_reason", type="text", nullable=true)
  44.      */
  45.     private $banReason;
  46.     /**
  47.      * @ORM\Column(name="ban_type", type="string", nullable=true)
  48.      */
  49.     private $banType;
  50.     use CreatedUpdatedTrait;
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     /**
  56.      * @return mixed
  57.      */
  58.     public function getUser()
  59.     {
  60.         return $this->user;
  61.     }
  62.     /**
  63.      * @param mixed $user
  64.      */
  65.     public function setUser($user): void
  66.     {
  67.         $this->user $user;
  68.     }
  69.     /**
  70.      * @return mixed
  71.      */
  72.     public function getBanFrom()
  73.     {
  74.         return $this->banFrom;
  75.     }
  76.     /**
  77.      * @param mixed $banFrom
  78.      */
  79.     public function setBanFrom($banFrom): void
  80.     {
  81.         $this->banFrom $banFrom;
  82.     }
  83.     /**
  84.      * @return mixed
  85.      */
  86.     public function getBanTo()
  87.     {
  88.         return $this->banTo;
  89.     }
  90.     /**
  91.      * @param mixed $banTo
  92.      */
  93.     public function setBanTo($banTo): void
  94.     {
  95.         $this->banTo $banTo;
  96.     }
  97.     /**
  98.      * @return mixed
  99.      */
  100.     public function getBanReason()
  101.     {
  102.         return $this->banReason;
  103.     }
  104.     /**
  105.      * @param mixed $banReason
  106.      */
  107.     public function setBanReason($banReason): void
  108.     {
  109.         $this->banReason $banReason;
  110.     }
  111.     /**
  112.      * @return mixed
  113.      */
  114.     public function getBanType()
  115.     {
  116.         return $this->banType;
  117.     }
  118.     /**
  119.      * @param mixed $banType
  120.      */
  121.     public function setBanType($banType): void
  122.     {
  123.         $this->banType $banType;
  124.     }
  125. }