<?php
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="support_requested_call_back")
* @ORM\HasLifecycleCallbacks()
*/
class Support_Request_Call_Back implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* Many Token have one user. This is the owning side.
* @ORM\ManyToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $country_code;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $mobile;
/**
* @ORM\Column(type="string", length=5000)
* @Assert\NotBlank()
*/
private $message;
/**
* Status = 1 - Pending, 2 - In Progress, 3 - Hold, 4 - Completed, 5 - User Not Reachable
* @ORM\Column(type="integer", nullable=false)
* @Assert\NotBlank()
*/
private $status;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $feedback;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $device_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 $app_version;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is_read;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is_fav;
private $user_email;
private $user_phone;
private $user_country_code;
private $user_profile_pic_url;
private $user_id;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return mixed
*/
public function getCountryCode()
{
return $this->country_code;
}
/**
* @param mixed $country_code
*/
public function setCountryCode($country_code)
{
$this->country_code = $country_code;
}
/**
* @return mixed
*/
public function getMobile()
{
return $this->mobile;
}
/**
* @param mixed $mobile
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
}
/**
* @return mixed
*/
public function getMessage()
{
return $this->message;
}
/**
* @param mixed $message
*/
public function setMessage($message)
{
$this->message = $message;
}
/**
* @return mixed
*/
public function getStatus()
{
return $this->status;
}
/**
* @param mixed $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @return mixed
*/
public function getFeedback()
{
return $this->feedback;
}
/**
* @param mixed $feedback
*/
public function setFeedback($feedback)
{
$this->feedback = $feedback;
}
/**
* @return mixed
*/
public function getDeviceModel()
{
return $this->device_model;
}
/**
* @param mixed $device_model
*/
public function setDeviceModel($device_model)
{
$this->device_model = $device_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 getUserEmail()
{
return $this->user_email;
}
/**
* @param mixed $user_email
*/
public function setUserEmail($user_email)
{
$this->user_email = $user_email;
}
/**
* @return mixed
*/
public function getUserPhone()
{
return $this->user_phone;
}
/**
* @param mixed $user_phone
*/
public function setUserPhone($user_phone)
{
$this->user_phone = $user_phone;
}
/**
* @return mixed
*/
public function getUserCountryCode()
{
return $this->user_country_code;
}
/**
* @param mixed $user_country_code
*/
public function setUserCountryCode($user_country_code)
{
$this->user_country_code = $user_country_code;
}
/**
* @return mixed
*/
public function getUserProfilePicUrl()
{
return $this->user_profile_pic_url;
}
/**
* @param mixed $user_profile_pic_url
*/
public function setUserProfilePicUrl($user_profile_pic_url)
{
$this->user_profile_pic_url = $user_profile_pic_url;
}
/**
* @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 getIsRead()
{
return $this->is_read;
}
/**
* @param mixed $is_read
*/
public function setIsRead($is_read)
{
$this->is_read = $is_read;
}
/**
* @return mixed
*/
public function getIsFav()
{
return $this->is_fav;
}
/**
* @param mixed $is_fav
*/
public function setIsFav($is_fav)
{
$this->is_fav = $is_fav;
}
/**
* @return mixed
*/
public function getUserId()
{
return $this->user_id;
}
/**
* @param mixed $user_id
*/
public function setUserId($user_id)
{
$this->user_id = $user_id;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'country_code' => $this->country_code,
'mobile' => $this->mobile,
'device_id' => $this->device_id,
'device_model' => $this->device_model,
'device_name' => $this->device_name,
'device_os_version' => $this->device_os_version,
'device_type' => $this->device_type,
'message' => $this->message,
'feedback' => $this->feedback,
'status' => $this->status,
'user_email' => $this->user_email,
'user_mobile' => $this->user_phone,
'user_country_code' => $this->user->getCountryCode(),
'user_name' => $this->user->getFirstName().' '.$this->user->getLastName(),
'user_profile_pic_url' => $this->user_profile_pic_url,
'app_version' => $this->app_version,
'is_read' => $this->is_read,
'is_fav' => $this->is_fav,
'user_id' => $this->user->getId(),
'created' => $this->createdAt->format('Y-m-d H:i:s'),
'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
);
}
/**
* @var \DateTime $created
*
* @ORM\Column(name="created_at", type="datetime", nullable=false)
*/
protected $createdAt;
/**
* @var \DateTime $updated
*
* @ORM\Column(name="updated_at", type="datetime", 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(new \DateTime());
if ($this->getCreatedAt() === null) {
$this->setCreatedAt(new \DateTime());
}
}
public function __construct() {
$this->setCreatedAt(new \DateTime());
}
}