<?php
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="user_data_deletion_request")
* @ORM\HasLifecycleCallbacks()
*/
class User_Data_Deletion_Requests implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var User
* @ORM\OneToOne(targetEntity="User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $user_data_id;
/**
* @ORM\Column(type="string", nullable=false)
*/
private $first_name;
/**
* @ORM\Column(type="string", nullable=false)
*/
private $last_name;
/**
* @ORM\Column(type="string", nullable=false)
*/
private $email;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $mobile;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $country_code;
/**
* @ORM\Column(type="datetime", nullable=false)
*/
private $requested_on;
/**
* @ORM\Column(type="datetime", nullable=false)
*/
private $data_to_be_deleted_on;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $deleted_on;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $reason;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $additional_comments;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $admin_comments;
/**
* @var bool
* @ORM\Column(type="boolean", nullable=false)
*/
private $is_data_deleted = false;
/**
* @var bool
* @ORM\Column(type="boolean", nullable=false)
*/
private $on_hold = false;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/**
* @return \DateTime
*/
public function getRequestedOn()
{
return $this->requested_on;
}
/**
* @param mixed $requested_on
*/
public function setRequestedOn($requested_on)
{
$this->requested_on = $requested_on;
}
/**
* @return \DateTime
*/
public function getDeletedOn()
{
return $this->deleted_on;
}
/**
* @param mixed $deleted_on
*/
public function setDeletedOn($deleted_on)
{
$this->deleted_on = $deleted_on;
}
/**
* @return mixed
*/
public function getReason()
{
return $this->reason;
}
/**
* @param mixed $reason
*/
public function setReason($reason)
{
$this->reason = $reason;
}
/**
* @return mixed
*/
public function getAdditionalComments()
{
return $this->additional_comments;
}
/**
* @param mixed $additional_comments
*/
public function setAdditionalComments($additional_comments)
{
$this->additional_comments = $additional_comments;
}
/**
* @return bool
*/
public function isIsDataDeleted()
{
return $this->is_data_deleted;
}
/**
* @param bool $is_data_deleted
*/
public function setIsDataDeleted($is_data_deleted)
{
$this->is_data_deleted = $is_data_deleted;
}
/**
* @return bool
*/
public function isOnHold()
{
return $this->on_hold;
}
/**
* @param bool $on_hold
*/
public function setOnHold($on_hold)
{
$this->on_hold = $on_hold;
}
/**
* @return \DateTime
*/
public function getDataToBeDeletedOn()
{
return $this->data_to_be_deleted_on;
}
/**
* @param mixed $data_to_be_deleted_on
*/
public function setDataToBeDeletedOn($data_to_be_deleted_on)
{
$this->data_to_be_deleted_on = $data_to_be_deleted_on;
}
/**
* @return mixed
*/
public function getUserDataId()
{
return $this->user_data_id;
}
/**
* @param mixed $user_data_id
*/
public function setUserDataId($user_data_id)
{
$this->user_data_id = $user_data_id;
}
/**
* @return mixed
*/
public function getFirstName()
{
return $this->first_name;
}
/**
* @param mixed $first_name
*/
public function setFirstName($first_name)
{
$this->first_name = $first_name;
}
/**
* @return mixed
*/
public function getLastName()
{
return $this->last_name;
}
/**
* @param mixed $last_name
*/
public function setLastName($last_name)
{
$this->last_name = $last_name;
}
/**
* @return mixed
*/
public function getEmail()
{
return $this->email;
}
/**
* @param mixed $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* @return mixed
*/
public function getMobile()
{
return $this->mobile;
}
/**
* @param mixed $mobile
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
}
/**
* @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 getAdminComments()
{
return $this->admin_comments;
}
/**
* @param mixed $admin_comments
*/
public function setAdminComments($admin_comments)
{
$this->admin_comments = $admin_comments;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'requested_on' => $this->requested_on != NULL ? $this->getRequestedOn()->format('Y:m:d H:i:s') : '',
'data_to_be_deleted_on' => $this->data_to_be_deleted_on != NULL ? $this->getDataToBeDeletedOn()->format('Y:m:d') : '',
'deleted_on' => $this->deleted_on != NULL ? $this->getDeletedOn()->format('Y:m:d') : '',
'additional_comments' => $this->additional_comments,
'on_hold' => $this->on_hold,
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'email' => $this->email,
'country_code' => $this->country_code,
'mobile' => $this->mobile,
'user_data_id' => $this->user_data_id,
'reason' => $this->reason,
'is_data_deleted' => $this->is_data_deleted,
'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());
}
}