src/Entity/Log.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LogRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass=LogRepository::class)
  9.  */
  10. class Log
  11. {
  12.     const CATEGORY_LOGIN_EVENT 'login_event';
  13.     const CATEGORY_USE_EVENT 'use_event';
  14.     const SUB_USE_EVENT 'dash_landing';
  15.     const USE_EVENT_MESSAGE 'Used platform';
  16.     const SUB_LOGIN_SUCCESS 'login_success';
  17.     const CATEGORIES = [
  18.       self::CATEGORY_LOGIN_EVENT
  19.     ];
  20.     const SUB_CATEGORIES = [
  21.         self::CATEGORY_LOGIN_EVENT => [
  22.             self::SUB_LOGIN_SUCCESS
  23.         ]
  24.     ];
  25.     /**
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue
  28.      * @ORM\Column(type="integer")
  29.      */
  30.     private $id;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      * @Gedmo\Timestampable(on="create")
  34.      */
  35.     private $createdAt;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=TvUser::class, inversedBy="logs")
  38.      * @ORM\JoinColumn(nullable=true)
  39.      */
  40.     private $tvUser;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="logs")
  43.      * @ORM\JoinColumn(nullable=true)
  44.      * @Assert\NotNull
  45.      */
  46.     private $user;
  47.     /**
  48.      * @ORM\Column(type="text")
  49.      */
  50.     private $message;
  51.     /**
  52.      * @ORM\Column(type="string", length=255)
  53.      */
  54.     private $category;
  55.     /**
  56.      * @ORM\Column(type="string", length=255)
  57.      */
  58.     private $subCategory;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=TvCompany::class, inversedBy="logs")
  61.      */
  62.     private $tvCompany;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="logs")
  65.      */
  66.     private $company;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $device;
  71.     public function getId(): ?int
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getCreatedAt(): ?\DateTimeInterface
  76.     {
  77.         return $this->createdAt;
  78.     }
  79.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  80.     {
  81.         $this->createdAt $createdAt;
  82.         return $this;
  83.     }
  84.     public function getTvUser(): ?TvUser
  85.     {
  86.         return $this->tvUser;
  87.     }
  88.     public function setTvUser(?TvUser $tvUser): self
  89.     {
  90.         $this->tvUser $tvUser;
  91.         return $this;
  92.     }
  93.     public function getUser(): ?User
  94.     {
  95.         return $this->user;
  96.     }
  97.     public function setUser(?User $user): self
  98.     {
  99.         $this->user $user;
  100.         return $this;
  101.     }
  102.     public function getMessage(): ?string
  103.     {
  104.         return $this->message;
  105.     }
  106.     public function setMessage(string $message): self
  107.     {
  108.         $this->message $message;
  109.         return $this;
  110.     }
  111.     public function getCategory(): ?string
  112.     {
  113.         return $this->category;
  114.     }
  115.     public function setCategory(string $category): self
  116.     {
  117.         $this->category $category;
  118.         return $this;
  119.     }
  120.     public function getSubCategory(): ?string
  121.     {
  122.         return $this->subCategory;
  123.     }
  124.     public function setSubCategory(string $subCategory): self
  125.     {
  126.         $this->subCategory $subCategory;
  127.         return $this;
  128.     }
  129.     public function getTvCompany(): ?TvCompany
  130.     {
  131.         return $this->tvCompany;
  132.     }
  133.     public function setTvCompany(?TvCompany $tvCompany): self
  134.     {
  135.         $this->tvCompany $tvCompany;
  136.         return $this;
  137.     }
  138.     public function getCompany(): ?Company
  139.     {
  140.         return $this->company;
  141.     }
  142.     public function setCompany(?Company $company): self
  143.     {
  144.         $this->company $company;
  145.         return $this;
  146.     }
  147.     public function getDevice(): ?string
  148.     {
  149.         return $this->device;
  150.     }
  151.     public function setDevice(string $device): self
  152.     {
  153.         $this->device $device;
  154.         return $this;
  155.     }
  156. }