src/Entity/LastActivity.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table(name="es_last_activity")
  6.  * @ORM\Entity(repositoryClass="App\Repository\LastActivityRepository")
  7.  */
  8. class LastActivity {
  9.     /**
  10.      * @ORM\Id
  11.      * @ORM\Column(name="id", type="integer")
  12.      * @ORM\GeneratedValue(strategy="AUTO")
  13.      */
  14.     protected $id;
  15.     /**
  16.      * @ORM\Column(name="user_id", type="integer", nullable=true)
  17.      */
  18.     protected $userId;
  19.     /**
  20.      * @ORM\Column(name="la_time", type="datetime")
  21.      */
  22.     protected $time;
  23.     /**
  24.      * @ORM\Column(name="url", type="string", nullable=true)
  25.      */
  26.     protected $url;
  27.     /**
  28.      * @ORM\Column(name="ip_addr", type="string", nullable=true)
  29.      */
  30.     protected $ipAddr;
  31.     /**
  32.      * @ORM\Column(name="device", type="string", length="4000", nullable=true)
  33.      */
  34.     protected $device;
  35.     /**
  36.      * @ORM\Column(name="edit", type="text", nullable=true)
  37.      */
  38.     protected $edit;
  39.     /**
  40.      * Get id
  41.      *
  42.      * @return integer
  43.      */
  44.     public function getId() {
  45.         return $this->id;
  46.     }
  47.     /**
  48.      * Set userId
  49.      *
  50.      * @param integer $userId
  51.      *
  52.      * @return LastActivity
  53.      */
  54.     public function setUserId($userId) {
  55.         $this->userId $userId;
  56.         return $this;
  57.     }
  58.     /**
  59.      * Get userId
  60.      *
  61.      * @return integer
  62.      */
  63.     public function getUserId() {
  64.         return $this->userId;
  65.     }
  66.     /**
  67.      * Set time
  68.      *
  69.      * @param \DateTime $time
  70.      *
  71.      * @return LastActivity
  72.      */
  73.     public function setTime() {
  74.         //$time = new \DateTime('now');
  75.         //$this->time = $time->format('d-M-y h:i:s');
  76.         $this->time = new \DateTime();
  77.         //$this->time = to_date($this->time, 'dd-mm-yyyy hh24:mi:ss');
  78.         return $this;
  79.     }
  80.     /**
  81.      * Get time
  82.      *
  83.      * @return \DateTime
  84.      */
  85.     public function getTime() {
  86.         return $this->time;
  87.     }
  88.     /**
  89.      * Set url
  90.      *
  91.      * @param \string $url
  92.      *
  93.      * @return url
  94.      */
  95.     public function setUrl($url) {
  96.         $this->url $url;
  97.         return $this;
  98.     }
  99.     /**
  100.      * Get time
  101.      *
  102.      * @return string
  103.      */
  104.     public function getUrl() {
  105.         return $this->url;
  106.     }
  107.     /**
  108.      * Set url
  109.      *
  110.      * @param \string $ipAddr
  111.      *
  112.      * @return ipAddr
  113.      */
  114.     public function setIpAddr($ipAddr) {
  115.         $this->ipAddr $ipAddr;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Get time
  120.      *
  121.      * @return string
  122.      */
  123.     public function getIpAddr() {
  124.         return $this->ipAddr;
  125.     }
  126.     /**
  127.      * Set edit
  128.      *
  129.      * @param string $edit
  130.      *
  131.      * @return LastActivity
  132.      */
  133.     public function setEdit($edit) {
  134.         if ($edit !== null) {
  135.             $this->edit json_encode($edit);
  136.         }
  137.         return $this;
  138.     }
  139.     /**
  140.      * Get edit
  141.      *
  142.      * @return string
  143.      */
  144.     public function getEdit() {
  145.         return json_decode($this->edittrue);
  146.     }
  147.     /**
  148.      * Set device
  149.      *
  150.      * @param string $device
  151.      *
  152.      * @return LastActivity
  153.      */
  154.     public function setDevice($device) {
  155.         $this->device $device;
  156.         return $this;
  157.     }
  158.     /**
  159.      * Get device
  160.      *
  161.      * @return string
  162.      */
  163.     public function getDevice() {
  164.         return $this->device;
  165.     }
  166. }