Bundle/CriteriaBundle/DataSource/RolesDataSource.php
public function getAllAvailableRoles($roleHierarchy)
    {
        $roles = [];
        foreach ($roleHierarchy as $key => $value) {
            if (is_array($value)) {
                $roles = array_merge($roles, $this->getAllAvailableRoles($value));
            }
            if (is_string($key)) {
                $roles[] = $key;
            }
            if (is_string($value)) {
                $roles[] = $value;
            }
        }

        return $roles;
    }
public function getAllAvailableRoles($roleHierarchy)
    {
        $roles = [];
        foreach ($roleHierarchy as $key => $value) {
            if (is_array($value)) {
                $roles = array_merge($roles, $this->getAllAvailableRoles($value));
            }
            if (is_string($key)) {
                $roles[] = $key;
            }
            if (is_string($value)) {
                $roles[] = $value;
            }
        }

        return $roles;
    }
public function getAllAvailableRoles ( $ roleHierarchy ) { $ roles = [ ] ; foreach ( $ roleHierarchy as $ key => $ value ) { if ( is_array ( $ value ) ) { $ roles = array_merge ( $ roles , $ this -> getAllAvailableRoles ( $ value ) ) ; } if ( is_string ( $ key ) ) { $ roles [ ] = $ key ; } if ( is_string ( $ value ) ) { $ roles [ ] = $ value ; } } return $ roles ; }
flatten the array of all roles defined in role_hierarchy.

@param array $roleHierarchy

@return array
flatten the array of all roles defined in role_hierarchy .