src/Entity/UserActionLog.php line 21

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2019, MND Next GmbH - www.mndnext.de
  4.  */
  5. namespace App\Entity;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. /**
  12.  * @ORM\Entity
  13.  * @ORM\HasLifecycleCallbacks()
  14.  * @ORM\Table(name="user_action_log", indexes={
  15.  *  @ORM\Index(name="user_action_log_created_idx", columns={"created"}),
  16.  * })
  17.  */
  18. class UserActionLog
  19. {
  20.     const ACTION_FAILED_LOGIN 'failed login';
  21.     const ACTION_PWD_CHANGED 'changed password';
  22.     /**
  23.      * @ORM\Id
  24.      * @ORM\Column(type="integer")
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     protected $id;
  28.     /**
  29.      * @var \DateTime
  30.      *
  31.      * @ORM\Column(name="created", type="datetime", nullable=false)
  32.      */
  33.     protected $created;
  34.     /**
  35.      * @var string
  36.      * @ORM\Column(type="string", length=180)
  37.      */
  38.     protected $action;
  39.     /**
  40.      * @var string
  41.      * @ORM\Column(type="string", length=180)
  42.      */
  43.     protected $email_canonical;
  44.     /**
  45.      * @var string
  46.      * @ORM\Column(type="string", length=64)
  47.      */
  48.     protected $ip;
  49.     /**
  50.      * Constructor
  51.      */
  52.     public function __construct()
  53.     {
  54.         $this->created = new \DateTime();
  55.     }
  56.     public function getId()
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getAction(): ?string
  61.     {
  62.         return $this->action;
  63.     }
  64.     public function setAction($action)
  65.     {
  66.         $this->action $action;
  67.         return $this;
  68.     }
  69.     public function getIp(): ?string
  70.     {
  71.         return $this->ip;
  72.     }
  73.     public function setIp($ip)
  74.     {
  75.         $this->ip $ip;
  76.         return $this;
  77.     }
  78.     public function setEmail($email)
  79.     {
  80.         $this->email_canonical mb_strtolower($email);
  81.         return $this;
  82.     }
  83.     public function getEMail()
  84.     {
  85.         return $this->email_canonical;
  86.     }
  87.     public function setCreated($created)
  88.     {
  89.         $this->created $created;
  90.         return $this;
  91.     }
  92.     public function getCreated(): ?string
  93.     {
  94.         return $this->created;
  95.     }
  96.  }