Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • ll-api-test
  • php84
  • detached3
  • detached4
  • detached2
  • ll-sans-console
  • detached
  • revert-482f2acb
  • 5.x
  • 4.x
  • laminas_migration
  • release_4.0.0
  • 6.1.4
  • 6.1.3
  • 6.1.2
  • 6.1.1
  • 6.1.0
  • 5.0.0
  • 4.0.1
  • 4.0.0
  • 3.0.5
  • 3.0.4
  • 3.0.3
  • 3.0.2
  • 3.0.1
  • 3.0.0
27 results

Role.php.dist

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Role.php.dist 1.96 KiB
    <?php
    /**
     * BjyAuthorize Module (https://github.com/bjyoungblood/BjyAuthorize)
     *
     * @link https://github.com/bjyoungblood/BjyAuthorize for the canonical source repository
     * @license http://framework.zend.com/license/new-bsd New BSD License
     */
    
    namespace MyNamespace;
    
    use BjyAuthorize\Acl\HierarchicalRoleInterface;
    use Doctrine\ORM\Mapping as ORM;
    
    /**
     * An example entity that represents a role.
     *
     * @ORM\Entity
     * @ORM\Table(name="role")
     *
     * @author Tom Oram <tom@scl.co.uk>
     */
    class Role implements HierarchicalRoleInterface
    {
        /**
         * @var int
         * @ORM\Id
         * @ORM\Column(type="integer")
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        protected $id;
    
        /**
         * @var string
         * @ORM\Column(type="string", name="role_id", length=255, unique=true, nullable=true)
         */
        protected $roleId;
    
        /**
         * @var Role
         * @ORM\ManyToOne(targetEntity="MyNamespace\Role")
         * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true)
         */
        protected $parent;
    
        /**
         * Get the id.
         *
         * @return int
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * Set the id.
         *
         * @param int $id
         *
         * @return void
         */
        public function setId($id)
        {
            $this->id = (int)$id;
        }
    
        /**
         * Get the role id.
         *
         * @return string
         */
        public function getRoleId()
        {
            return $this->roleId;
        }
    
        /**
         * Set the role id.
         *
         * @param string $roleId
         *
         * @return void
         */
        public function setRoleId($roleId)
        {
            $this->roleId = (string) $roleId;
        }
    
        /**
         * Get the parent role
         *
         * @return Role
         */
        public function getParent()
        {
            return $this->parent;
        }
    
        /**
         * Set the parent role.
         *
         * @param Role $parent
         *
         * @return void
         */
        public function setParent(Role $parent)
        {
            $this->parent = $parent;
        }
    }