src/acdhOeaw/fedora/Fedora.php
public function getResourcesByQuery(Query $query, string $resVar = '?res',
                                        bool $checkIfExist = true): array {
        $resVar    = preg_replace('|^[?]|', '', $resVar);
        $results   = $this->runQuery($query);
        $resources = array();
        foreach ($results as $i) {
            try {
                $resources[] = $this->getResourceByUri($i->$resVar);
            } catch (Deleted $e) {
                
            }
        }
        if ($checkIfExist) {
            $resources = $this->verifyResources($resources);
        }
        return $resources;
    }
public function getResourcesByQuery(Query $query, string $resVar = '?res',
                                        bool $checkIfExist = true): array {
        $resVar    = preg_replace('|^[?]|', '', $resVar);
        $results   = $this->runQuery($query);
        $resources = array();
        foreach ($results as $i) {
            try {
                $resources[] = $this->getResourceByUri($i->$resVar);
            } catch (Deleted $e) {
                
            }
        }
        if ($checkIfExist) {
            $resources = $this->verifyResources($resources);
        }
        return $resources;
    }
public function getResourcesByQuery ( Query $ query , string $ resVar = '?res' , bool $ checkIfExist = true ) : array { $ resVar = preg_replace ( '|^[?]|' , '' , $ resVar ) ; $ results = $ this -> runQuery ( $ query ) ; $ resources = array ( ) ; foreach ( $ results as $ i ) { try { $ resources [ ] = $ this -> getResourceByUri ( $ i -> $ resVar ) ; } catch ( Deleted $ e ) { } } if ( $ checkIfExist ) { $ resources = $ this -> verifyResources ( $ resources ) ; } return $ resources ; }
Finds all Fedora resources satisfying a given SPARQL query.

Be aware that the triplestore state is not affected by all actions
performed during the active transaction.

@param Query $query SPARQL query fetching resources from the triplestore
@param string $resVar name of the SPARQL variable containing resource
URIs
@param bool $checkIfExist should we make sure resource was not deleted
during the current transaction
@return array
@see begin()
Finds all Fedora resources satisfying a given SPARQL query .