<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 19/05/19
* Time: 4:55 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_sub")
* @ORM\HasLifecycleCallbacks()
*/
class PU_ManageNotificationsSub implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* Many features have one product. This is the owning side.
* @ORM\ManyToOne(targetEntity="PU_ManageNotificationsMaster", inversedBy="pu_manage_notifications_sub")
* @ORM\JoinColumn(name="manage_notifications_master_id", referencedColumnName="id")
*/
private $pu_manage_notifications_master;
/**
* @ORM\ManyToOne(targetEntity="WP_ManageNotificationsSub")
* @ORM\JoinColumn(name="wp_manage_notifications_sub_id", referencedColumnName="id")
*/
private $wp_manage_notifications_sub;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 1})
* @Assert\NotBlank()
*/
private $status = true;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getStatus()
{
return $this->status;
}
/**
* @param mixed $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @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 getWpManageNotificationsSub()
{
return $this->wp_manage_notifications_sub;
}
/**
* @param mixed $wp_manage_notifications_sub
*/
public function setWpManageNotificationsSub($wp_manage_notifications_sub)
{
$this->wp_manage_notifications_sub = $wp_manage_notifications_sub;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
);
}
/**
* @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));
}
}