<?php/** * Copyright (c) 2019, MND Next GmbH - www.mndnext.de */namespace App\Entity;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity * @ORM\HasLifecycleCallbacks() * @ORM\Table(name="user_action_log", indexes={ * @ORM\Index(name="user_action_log_created_idx", columns={"created"}), * }) */class UserActionLog{ const ACTION_FAILED_LOGIN = 'failed login'; const ACTION_PWD_CHANGED = 'changed password'; /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false) */ protected $created; /** * @var string * @ORM\Column(type="string", length=180) */ protected $action; /** * @var string * @ORM\Column(type="string", length=180) */ protected $email_canonical; /** * @var string * @ORM\Column(type="string", length=64) */ protected $ip; /** * Constructor */ public function __construct() { $this->created = new \DateTime(); } public function getId() { return $this->id; } public function getAction(): ?string { return $this->action; } public function setAction($action) { $this->action = $action; return $this; } public function getIp(): ?string { return $this->ip; } public function setIp($ip) { $this->ip = $ip; return $this; } public function setEmail($email) { $this->email_canonical = mb_strtolower($email); return $this; } public function getEMail() { return $this->email_canonical; } public function setCreated($created) { $this->created = $created; return $this; } public function getCreated(): ?string { return $this->created; } }