protected function initializeRoles()
    {
        if ($this->roles !== null) {
            return;
        }
        $this->roles = [];
        foreach ($this->roleIdentifiers as $key => $roleIdentifier) {
            // check for and clean up roles no longer available
            if ($this->policyService->hasRole($roleIdentifier)) {
                $this->roles[$roleIdentifier] = $this->policyService->getRole($roleIdentifier);
            } else {
                unset($this->roleIdentifiers[$key]);
            }
        }
    }
protected function initializeRoles()
    {
        if ($this->roles !== null) {
            return;
        }
        $this->roles = [];
        foreach ($this->roleIdentifiers as $key => $roleIdentifier) {
            // check for and clean up roles no longer available
            if ($this->policyService->hasRole($roleIdentifier)) {
                $this->roles[$roleIdentifier] = $this->policyService->getRole($roleIdentifier);
            } else {
                unset($this->roleIdentifiers[$key]);
            }
        }
    }
protected function initializeRoles ( ) { if ( $ this -> roles !== null ) { return ; } $ this -> roles = [ ] ; foreach ( $ this -> roleIdentifiers as $ key => $ roleIdentifier ) { // check for and clean up roles no longer available if ( $ this -> policyService -> hasRole ( $ roleIdentifier ) ) { $ this -> roles [ $ roleIdentifier ] = $ this -> policyService -> getRole ( $ roleIdentifier ) ; } else { unset ( $ this -> roleIdentifiers [ $ key ] ) ; } } }
Initializes the roles field by fetching the role objects referenced by the roleIdentifiers

@return void
Initializes the roles field by fetching the role objects referenced by the roleIdentifiers