<?php
namespace App\AppBundle\AdminBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="admin_logout")
* @ORM\HasLifecycleCallbacks()
*/
class Admin_Logout implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="integer", nullable=false)
* @Assert\NotBlank()
*/
private $admin_user_id;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $token;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $ip_address;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $device_name;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $device_os_version;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getAdminUserId()
{
return $this->admin_user_id;
}
/**
* @param mixed $admin_user_id
*/
public function setAdminUserId($admin_user_id): void
{
$this->admin_user_id = $admin_user_id;
}
/**
* @return mixed
*/
public function getToken()
{
return $this->token;
}
/**
* @param mixed $token
*/
public function setToken($token)
{
$this->token = $token;
}
/**
* @return mixed
*/
public function getIpAddress()
{
return $this->ip_address;
}
/**
* @param mixed $ip_address
*/
public function setIpAddress($ip_address)
{
$this->ip_address = $ip_address;
}
/**
* @return mixed
*/
public function getDeviceName()
{
return $this->device_name;
}
/**
* @param mixed $device_name
*/
public function setDeviceName($device_name)
{
$this->device_name = $device_name;
}
/**
* @return mixed
*/
public function getDeviceOsVersion()
{
return $this->device_os_version;
}
/**
* @param mixed $device_os_version
*/
public function setDeviceOsVersion($device_os_version)
{
$this->device_os_version = $device_os_version;
}
/**
* @var string $created
*
* @ORM\Column(name="created_at", type="string", nullable=false)
*/
protected $createdAt;
/**
* @var string $updated
*
* @ORM\Column(name="updated_at", type="string", nullable=false)
*/
protected $updatedAt;
public function getCreatedAt()
{
return $this->createdAt;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps()
{
$this->setUpdatedAt(round(microtime(true) * 1000));
if ($this->getCreatedAt() === null) {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}
public function __construct() {
$this->setCreatedAt(round(microtime(true) * 1000));
}
public function jsonSerialize()
{
return array(
'id' => $this->id
);
}
}