public function getAll()
    {
        if ($this->isRequestGet()) {
            try {
                $format   = $this->getRequestParameter('format');
                $search   = $this->hasRequestParameter('search') ? $this->getRawParameter('search') : '';
                $limit    = $this->hasRequestParameter('limit') ? $this->getRequestParameter('limit') : 30;
                $offset   = $this->hasRequestParameter('offset') ? $this->getRequestParameter('offset') : 0;
                $selectedUris = [];

                if(! empty($search) ){
                    $decodedSearch = json_decode($search, true);
                    if(is_array($decodedSearch) && count($decodedSearch) > 0){
                        $search = $decodedSearch;
                    }
                }
                if($this->hasRequestParameter('selectedUri')){
                    $selectedUri = $this->getRequestParameter('selectedUri');
                    if (!empty($selectedUri)) {
                        $selectedUris = [$selectedUri];
                    }
                }

                $class = $this->getClassParameter();
                if ($this->hasRequestParameter('classOnly')) {
                    $resources = $this->getResourceService()->getClasses($class, $format, $selectedUris, $search, $offset, $limit);
                } else {
                    $resources = $this->getResourceService()->getResources($class, $format, $selectedUris, $search, $offset, $limit);
                }

                $user = \common_Session_SessionManager::getSession()->getUser();
                if(isset($resources['nodes'])){
                    $permissions = $this->getResourceService()->getResourcesPermissions($user, $resources['nodes']);
                } else {
                    $permissions = $this->getResourceService()->getResourcesPermissions($user, $resources);
                }

                $this->returnSuccess([
                    'resources' => $resources,
                    'permissions' => $permissions
                ]);

            } catch (common_Exception $e) {
                $this->returnFailure($e);
            }
        }
    }
public function getAll()
    {
        if ($this->isRequestGet()) {
            try {
                $format   = $this->getRequestParameter('format');
                $search   = $this->hasRequestParameter('search') ? $this->getRawParameter('search') : '';
                $limit    = $this->hasRequestParameter('limit') ? $this->getRequestParameter('limit') : 30;
                $offset   = $this->hasRequestParameter('offset') ? $this->getRequestParameter('offset') : 0;
                $selectedUris = [];

                if(! empty($search) ){
                    $decodedSearch = json_decode($search, true);
                    if(is_array($decodedSearch) && count($decodedSearch) > 0){
                        $search = $decodedSearch;
                    }
                }
                if($this->hasRequestParameter('selectedUri')){
                    $selectedUri = $this->getRequestParameter('selectedUri');
                    if (!empty($selectedUri)) {
                        $selectedUris = [$selectedUri];
                    }
                }

                $class = $this->getClassParameter();
                if ($this->hasRequestParameter('classOnly')) {
                    $resources = $this->getResourceService()->getClasses($class, $format, $selectedUris, $search, $offset, $limit);
                } else {
                    $resources = $this->getResourceService()->getResources($class, $format, $selectedUris, $search, $offset, $limit);
                }

                $user = \common_Session_SessionManager::getSession()->getUser();
                if(isset($resources['nodes'])){
                    $permissions = $this->getResourceService()->getResourcesPermissions($user, $resources['nodes']);
                } else {
                    $permissions = $this->getResourceService()->getResourcesPermissions($user, $resources);
                }

                $this->returnSuccess([
                    'resources' => $resources,
                    'permissions' => $permissions
                ]);

            } catch (common_Exception $e) {
                $this->returnFailure($e);
            }
        }
    }
public function getAll ( ) { if ( $ this -> isRequestGet ( ) ) { try { $ format = $ this -> getRequestParameter ( 'format' ) ; $ search = $ this -> hasRequestParameter ( 'search' ) ? $ this -> getRawParameter ( 'search' ) : '' ; $ limit = $ this -> hasRequestParameter ( 'limit' ) ? $ this -> getRequestParameter ( 'limit' ) : 30 ; $ offset = $ this -> hasRequestParameter ( 'offset' ) ? $ this -> getRequestParameter ( 'offset' ) : 0 ; $ selectedUris = [ ] ; if ( ! empty ( $ search ) ) { $ decodedSearch = json_decode ( $ search , true ) ; if ( is_array ( $ decodedSearch ) && count ( $ decodedSearch ) > 0 ) { $ search = $ decodedSearch ; } } if ( $ this -> hasRequestParameter ( 'selectedUri' ) ) { $ selectedUri = $ this -> getRequestParameter ( 'selectedUri' ) ; if ( ! empty ( $ selectedUri ) ) { $ selectedUris = [ $ selectedUri ] ; } } $ class = $ this -> getClassParameter ( ) ; if ( $ this -> hasRequestParameter ( 'classOnly' ) ) { $ resources = $ this -> getResourceService ( ) -> getClasses ( $ class , $ format , $ selectedUris , $ search , $ offset , $ limit ) ; } else { $ resources = $ this -> getResourceService ( ) -> getResources ( $ class , $ format , $ selectedUris , $ search , $ offset , $ limit ) ; } $ user = \ common_Session_SessionManager :: getSession ( ) -> getUser ( ) ; if ( isset ( $ resources [ 'nodes' ] ) ) { $ permissions = $ this -> getResourceService ( ) -> getResourcesPermissions ( $ user , $ resources [ 'nodes' ] ) ; } else { $ permissions = $ this -> getResourceService ( ) -> getResourcesPermissions ( $ user , $ resources ) ; } $ this -> returnSuccess ( [ 'resources' => $ resources , 'permissions' => $ permissions ] ) ; } catch ( common_Exception $ e ) { $ this -> returnFailure ( $ e ) ; } } }
Get all resources belonging to a given class.
The result is paginated and structured based on the given format.
The result can be filtered, or target a given selection.

@requiresRight classUri READ
Get all resources belonging to a given class . The result is paginated and structured based on the given format . The result can be filtered or target a given selection .