Skip to content
Snippets Groups Projects
Select Git revision
  • d68c5bac092ba40f217a207155e6b6a498f2a09c
  • master default protected
  • 5.x
  • ll-php8-bs5
  • release_5_bs5
  • ll-php8
  • 4.x
  • laminas_migration
  • release_1.0.0.2
  • release_4.0.0
  • release_3.2.8
  • bootstrap4_migration
  • 1.0.0.3
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 5.1.1
  • 6.0.0
  • 5.1.0
  • 5.0.0
  • 4.0.2
  • 3.2.11
  • 4.0.1
  • 3.2.10
  • 4.0.0
  • 1.0.0.2
  • 3.2.9
  • 3.2.8
32 results

installation.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Role.php.odm.dist 1.84 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\ODM\MongoDB\Mapping\Annotations as ODM;
    
    /**
     * An example document that represents a role.
     *
     * @ODM\Document(
     *     collection="role"
     * )
     * @ODM\ChangeTrackingPolicy("DEFERRED_IMPLICIT")
     */
    class Role implements HierarchicalRoleInterface
    {
        /**
         * @var int
         * @ODM\Id(strategy="AUTO")
         */
        protected $id;
    
        /**
         * @var string
         * @ODM\Field(type="string", name="role_id")
         */
        protected $roleId;
    
        /**
         * @var MyNamespace\Role
         * @ODM\ReferenceOne(targetDocument="MyNamespace\Role")
         */
        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 $role
         *
         * @return void
         */
        public function setParent(Role $parent = null)
        {
            $this->parent = $parent;
        }
    }