<?php
namespace App\AppBundle\AdminBundle\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="admin_access_role_sub")
* @ORM\HasLifecycleCallbacks()
*/
class Admin_Access_Role_Sub implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="Admin_Access_Role_Master", inversedBy="admin_access_role_subs")
* @ORM\JoinColumn(name="admin_access_role_master_id", referencedColumnName="id")
*/
private $admin_access_role_master;
/**
* @ORM\ManyToOne(targetEntity="Admin_Access_Role_Group")
* @ORM\JoinColumn(name="admin_access_role_group_id", referencedColumnName="id")
*/
private $admin_access_role_group;
/**
* @ORM\ManyToOne(targetEntity="Admin_Access_Role_Group_Permission")
* @ORM\JoinColumn(name="admin_access_role_group_permission_id", referencedColumnName="id")
*/
private $admin_access_role_group_permission;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 1})
* @Assert\NotBlank()
*/
private $status;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getAdminAccessRoleMaster()
{
return $this->admin_access_role_master;
}
/**
* @param mixed $admin_access_role_master
*/
public function setAdminAccessRoleMaster($admin_access_role_master)
{
$this->admin_access_role_master = $admin_access_role_master;
}
/**
* @return mixed
*/
public function getAdminAccessRoleGroup()
{
return $this->admin_access_role_group;
}
/**
* @param mixed $admin_access_role_group
*/
public function setAdminAccessRoleGroup($admin_access_role_group)
{
$this->admin_access_role_group = $admin_access_role_group;
}
/**
* @return mixed
*/
public function getAdminAccessRoleGroupPermission()
{
return $this->admin_access_role_group_permission;
}
/**
* @param mixed $admin_access_role_group_permission
*/
public function setAdminAccessRoleGroupPermission($admin_access_role_group_permission)
{
$this->admin_access_role_group_permission = $admin_access_role_group_permission;
}
/**
* @return mixed
*/
public function getStatus()
{
return $this->status;
}
/**
* @param mixed $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @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));
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'admin_access_role_group' => $this->admin_access_role_group,
'admin_access_role_group_permission' => $this->admin_access_role_group_permission,
'status' => $this->status
);
}
}