<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 23/04/19
* Time: 12:06 AM
*/
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="user_records")
* @ORM\HasLifecycleCallbacks()
*/
class User_Records implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="integer", nullable=false)
* @Assert\NotBlank()
*/
private $user_id;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $token;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $social_auth_token;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $notification_token;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $model;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $device_id;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $device_name;
/**
* @ORM\Column(type="integer", nullable=true)
* @Assert\NotBlank()
*/
private $device_type;//0 - iOS, 1 - Android
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $device_os_version;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $logout_time;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getUserId()
{
return $this->user_id;
}
/**
* @param mixed $user_id
*/
public function setUserId($user_id)
{
$this->user_id = $user_id;
}
/**
* @return mixed
*/
public function getToken()
{
return $this->token;
}
/**
* @param mixed $token
*/
public function setToken($token)
{
$this->token = $token;
}
/**
* @return mixed
*/
public function getSocialAuthToken()
{
return $this->social_auth_token;
}
/**
* @param mixed $social_auth_token
*/
public function setSocialAuthToken($social_auth_token)
{
$this->social_auth_token = $social_auth_token;
}
/**
* @return mixed
*/
public function getNotificationToken()
{
return $this->notification_token;
}
/**
* @param mixed $notification_token
*/
public function setNotificationToken($notification_token)
{
$this->notification_token = $notification_token;
}
/**
* @return mixed
*/
public function getModel()
{
return $this->model;
}
/**
* @param mixed $model
*/
public function setModel($model)
{
$this->model = $model;
}
/**
* @return mixed
*/
public function getDeviceId()
{
return $this->device_id;
}
/**
* @param mixed $device_id
*/
public function setDeviceId($device_id)
{
$this->device_id = $device_id;
}
/**
* @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 getDeviceType()
{
return $this->device_type;
}
/**
* @param mixed $device_type
*/
public function setDeviceType($device_type)
{
$this->device_type = $device_type;
}
/**
* @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;
}
/**
* @return mixed
*/
public function getLogoutTime()
{
return $this->logout_time;
}
/**
* @param mixed $logout_time
*/
public function setLogoutTime($logout_time)
{
$this->logout_time = $logout_time;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'device_id' => $this->device_id,
'device_name' => $this->device_name,
'device_os_version' => $this->device_os_version,
'device_type' => $this->device_type,
'logout_time' => $this->logout_time,
'model' => $this->model,
'notification_token' => $this->notification_token,
'social_auth_token' => $this->social_auth_token,
'token' => $this->token,
'user_id' => $this->user_id
);
}
/**
* @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));
}
}