<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 19/05/19
* Time: 4:31 PM
*/
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="pu_manage_notifications")
* @ORM\HasLifecycleCallbacks()
*/
class PU_ManageNotifications implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* One product has many features. This is the inverse side.
* @ORM\OneToMany(targetEntity="PU_ManageNotificationsMaster", mappedBy="pu_manage_notifications_master")
*/
private $pu_manage_notifications_master;
/**
* @ORM\OneToOne(targetEntity="User", inversedBy="manage_notifications")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getPuManageNotificationsMaster()
{
return $this->pu_manage_notifications_master;
}
/**
* @param mixed $pu_manage_notifications_master
*/
public function setPuManageNotificationsMaster($pu_manage_notifications_master)
{
$this->pu_manage_notifications_master = $pu_manage_notifications_master;
}
/**
* @return mixed
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @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));
$this->pu_manage_notifications_master = new ArrayCollection();
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
);
}
}