<?php
namespace App\Admin\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* StdWebRoles
*/
#[ORM\Table(name: 'std_web_roles')]
#[ORM\Index(name: 'fk_std_roles_std_users', columns: ['created_by'])]
#[ORM\Index(name: 'fk_std_roles_std_users_0', columns: ['updated_by'])]
#[ORM\Entity(repositoryClass: 'App\Admin\Repository\StdWebRolesRepository')]
class StdWebRoles
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false, options: ['unsigned' => true, 'comment' => 'Role unique identifier'])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string
*/
#[ORM\Column(name: 'name', type: 'string', length: 100, nullable: false, options: ['comment' => 'Role name'])]
private $name;
/**
* @var string
*/
#[ORM\Column(name: 'image', type: 'string', length: 100, nullable: true, options: ['comment' => 'Role Image'])]
private $image;
/**
* @var bool
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: false, options: ['default' => 1, 'comment' => 'Flag that indicates if the role is active'])]
private $isActive = '1';
/**
* @var bool
*/
#[ORM\Column(name: 'is_default', type: 'boolean', nullable: false, options: ['default' => 0, 'comment' => 'Flag that indicates if the role is Default'])]
private $isDefault = '0';
/**
* @var \DateTime
*/
#[ORM\Column(name: 'created_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time of the record creation'])]
private $createdDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'updated_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time the record was last updated'])]
private $updatedDate;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $createdBy;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $updatedBy;
#[ORM\ManyToMany(targetEntity: 'StdPages', mappedBy: 'webroles')]
private $pages;
public function __construct()
{
$this->pages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getCreatedDate(): ?\DateTimeInterface
{
return $this->createdDate;
}
public function setCreatedDate(\DateTimeInterface $createdDate): self
{
$this->createdDate = $createdDate;
return $this;
}
public function getUpdatedDate(): ?\DateTimeInterface
{
return $this->updatedDate;
}
public function setUpdatedDate(\DateTimeInterface $updatedDate): self
{
$this->updatedDate = $updatedDate;
return $this;
}
public function getCreatedBy(): ?StdUsers
{
return $this->createdBy;
}
public function setCreatedBy(?StdUsers $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?StdUsers
{
return $this->updatedBy;
}
public function setUpdatedBy(?StdUsers $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
#[ORM\PreUpdate]
public function setUpdated()
{
$this->setUpdatedDate(new \DateTime());
}
#[ORM\PrePersist]
public function setCreated()
{
$this->setUpdatedDate(new \DateTime());
$this->setCreatedDate(new \DateTime());
}
/**
* Get the value of isDefault
*
* @return bool
*/
public function getIsDefault()
{
return $this->isDefault;
}
public function getRoles()
{
return $this->name;
}
/**
* Set the value of isDefault
*
* @param bool $isDefault
*
* @return self
*/
public function setIsDefault(bool $isDefault)
{
$this->isDefault = $isDefault;
return $this;
}
/**
* Get the value of image
*
* @return string
*/
public function getImage()
{
return $this->image;
}
/**
* Set the value of image
*
* @param string $image
*
* @return self
*/
public function setImage(string $image)
{
$this->image = $image;
return $this;
}
}