<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="es_last_activity")
* @ORM\Entity(repositoryClass="App\Repository\LastActivityRepository")
*/
class LastActivity {
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="user_id", type="integer", nullable=true)
*/
protected $userId;
/**
* @ORM\Column(name="la_time", type="datetime")
*/
protected $time;
/**
* @ORM\Column(name="url", type="string", nullable=true)
*/
protected $url;
/**
* @ORM\Column(name="ip_addr", type="string", nullable=true)
*/
protected $ipAddr;
/**
* @ORM\Column(name="device", type="string", length="4000", nullable=true)
*/
protected $device;
/**
* @ORM\Column(name="edit", type="text", nullable=true)
*/
protected $edit;
/**
* Get id
*
* @return integer
*/
public function getId() {
return $this->id;
}
/**
* Set userId
*
* @param integer $userId
*
* @return LastActivity
*/
public function setUserId($userId) {
$this->userId = $userId;
return $this;
}
/**
* Get userId
*
* @return integer
*/
public function getUserId() {
return $this->userId;
}
/**
* Set time
*
* @param \DateTime $time
*
* @return LastActivity
*/
public function setTime() {
//$time = new \DateTime('now');
//$this->time = $time->format('d-M-y h:i:s');
$this->time = new \DateTime();
//$this->time = to_date($this->time, 'dd-mm-yyyy hh24:mi:ss');
return $this;
}
/**
* Get time
*
* @return \DateTime
*/
public function getTime() {
return $this->time;
}
/**
* Set url
*
* @param \string $url
*
* @return url
*/
public function setUrl($url) {
$this->url = $url;
return $this;
}
/**
* Get time
*
* @return string
*/
public function getUrl() {
return $this->url;
}
/**
* Set url
*
* @param \string $ipAddr
*
* @return ipAddr
*/
public function setIpAddr($ipAddr) {
$this->ipAddr = $ipAddr;
return $this;
}
/**
* Get time
*
* @return string
*/
public function getIpAddr() {
return $this->ipAddr;
}
/**
* Set edit
*
* @param string $edit
*
* @return LastActivity
*/
public function setEdit($edit) {
if ($edit !== null) {
$this->edit = json_encode($edit);
}
return $this;
}
/**
* Get edit
*
* @return string
*/
public function getEdit() {
return json_decode($this->edit, true);
}
/**
* Set device
*
* @param string $device
*
* @return LastActivity
*/
public function setDevice($device) {
$this->device = $device;
return $this;
}
/**
* Get device
*
* @return string
*/
public function getDevice() {
return $this->device;
}
}