<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 30/03/19
* Time: 4:42 PM
*/
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="wp_app_version")
* @ORM\HasLifecycleCallbacks()
*/
class WP_App_Version implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $app_version;
/**
* @ORM\Column(type="boolean", nullable=false)
* @Assert\NotBlank()
*/
private $is_ios;
/**
* @ORM\Column(type="boolean", nullable=false)
* @Assert\NotBlank()
*/
private $is_force_update;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getAppVersion()
{
return $this->app_version;
}
/**
* @param mixed $app_version
*/
public function setAppVersion($app_version)
{
$this->app_version = $app_version;
}
/**
* @return mixed
*/
public function getisIos()
{
return $this->is_ios;
}
/**
* @param mixed $is_ios
*/
public function setIsIos($is_ios)
{
$this->is_ios = $is_ios;
}
/**
* @return mixed
*/
public function getisForceUpdate()
{
return $this->is_force_update;
}
/**
* @param mixed $is_force_update
*/
public function setIsForceUpdate($is_force_update)
{
$this->is_force_update = $is_force_update;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'app_version' => $this->app_version,
'is_force_update' => $this->is_force_update,
'is_ios' => $this->is_ios
);
}
/**
* @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));
}
}