src/Admin/Entity/StdWebRoles.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Admin\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * StdWebRoles
  8.  */
  9. #[ORM\Table(name'std_web_roles')]
  10. #[ORM\Index(name'fk_std_roles_std_users'columns: ['created_by'])]
  11. #[ORM\Index(name'fk_std_roles_std_users_0'columns: ['updated_by'])]
  12. #[ORM\Entity(repositoryClass'App\Admin\Repository\StdWebRolesRepository')]
  13. class StdWebRoles
  14. {
  15.     /**
  16.      * @var int
  17.      */
  18.     #[ORM\Column(name'id'type'integer'nullablefalseoptions: ['unsigned' => true'comment' => 'Role unique identifier'])]
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      */
  25.     #[ORM\Column(name'name'type'string'length100nullablefalseoptions: ['comment' => 'Role name'])]
  26.     private $name;
  27.     /**
  28.      * @var string
  29.      */
  30.     #[ORM\Column(name'image'type'string'length100nullabletrueoptions: ['comment' => 'Role Image'])]
  31.     private $image;
  32.     /**
  33.      * @var bool
  34.      */
  35.     #[ORM\Column(name'is_active'type'boolean'nullablefalseoptions: ['default' => 1'comment' => 'Flag that indicates if the role is active'])]
  36.     private $isActive '1';
  37.     /**
  38.      * @var bool
  39.      */
  40.     #[ORM\Column(name'is_default'type'boolean'nullablefalseoptions: ['default' => 0'comment' => 'Flag that indicates if the role is Default'])]
  41.     private $isDefault '0';
  42.     /**
  43.      * @var \DateTime
  44.      */
  45.     #[ORM\Column(name'created_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time of the record creation'])]
  46.     private $createdDate;
  47.     /**
  48.      * @var \DateTime
  49.      */
  50.     #[ORM\Column(name'updated_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time the record was last updated'])]
  51.     private $updatedDate;
  52.     /**
  53.      * @var \StdUsers
  54.      */
  55.     #[ORM\JoinColumn(name'created_by'referencedColumnName'id')]
  56.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  57.     private $createdBy;
  58.     /**
  59.      * @var \StdUsers
  60.      */
  61.     #[ORM\JoinColumn(name'updated_by'referencedColumnName'id')]
  62.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  63.     private $updatedBy;
  64.     #[ORM\ManyToMany(targetEntity'StdPages'mappedBy'webroles')]
  65.    private $pages;
  66.    public function __construct()
  67.    {
  68.        $this->pages = new ArrayCollection();
  69.    }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(string $name): self
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getIsActive(): ?bool
  84.     {
  85.         return $this->isActive;
  86.     }
  87.     public function setIsActive(bool $isActive): self
  88.     {
  89.         $this->isActive $isActive;
  90.         return $this;
  91.     }
  92.     public function getCreatedDate(): ?\DateTimeInterface
  93.     {
  94.         return $this->createdDate;
  95.     }
  96.     public function setCreatedDate(\DateTimeInterface $createdDate): self
  97.     {
  98.         $this->createdDate $createdDate;
  99.         return $this;
  100.     }
  101.     public function getUpdatedDate(): ?\DateTimeInterface
  102.     {
  103.         return $this->updatedDate;
  104.     }
  105.     public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  106.     {
  107.         $this->updatedDate $updatedDate;
  108.         return $this;
  109.     }
  110.     public function getCreatedBy(): ?StdUsers
  111.     {
  112.         return $this->createdBy;
  113.     }
  114.     public function setCreatedBy(?StdUsers $createdBy): self
  115.     {
  116.         $this->createdBy $createdBy;
  117.         return $this;
  118.     }
  119.     public function getUpdatedBy(): ?StdUsers
  120.     {
  121.         return $this->updatedBy;
  122.     }
  123.     public function setUpdatedBy(?StdUsers $updatedBy): self
  124.     {
  125.         $this->updatedBy $updatedBy;
  126.         return $this;
  127.     }
  128.      #[ORM\PreUpdate]
  129.     public function setUpdated()
  130.     {
  131.         $this->setUpdatedDate(new \DateTime());
  132.     }
  133.     
  134.     #[ORM\PrePersist]
  135.     public function setCreated()
  136.     {
  137.         $this->setUpdatedDate(new \DateTime());
  138.         $this->setCreatedDate(new \DateTime());
  139.     }
  140.     /**
  141.      * Get the value of isDefault
  142.      *
  143.      * @return  bool
  144.      */ 
  145.     public function getIsDefault()
  146.     {
  147.         return $this->isDefault;
  148.     }
  149.     public function getRoles()
  150.     {
  151.         return $this->name;
  152.     }
  153.     /**
  154.      * Set the value of isDefault
  155.      *
  156.      * @param  bool  $isDefault
  157.      *
  158.      * @return  self
  159.      */ 
  160.     public function setIsDefault(bool $isDefault)
  161.     {
  162.         $this->isDefault $isDefault;
  163.         return $this;
  164.     }
  165.     /**
  166.      * Get the value of image
  167.      *
  168.      * @return  string
  169.      */ 
  170.     public function getImage()
  171.     {
  172.         return $this->image;
  173.     }
  174.     /**
  175.      * Set the value of image
  176.      *
  177.      * @param  string  $image
  178.      *
  179.      * @return  self
  180.      */ 
  181.     public function setImage(string $image)
  182.     {
  183.         $this->image $image;
  184.         return $this;
  185.     }
  186. }