src/acdhOeaw/fedora/Fedora.php
public function getResourceByIds(array $ids, bool $checkIfExist = true): FedoraResource {
        echo self::$debug ? "[Fedora] searching for " . implode(', ', $ids) . "\n" : '';

        $matches = array();
        foreach ($ids as $id) {
            try {
                $res                         = $this->getResourceById($id, $checkIfExist);
                $matches[$res->getUri(true)] = $res;
            } catch (NotFound $e) {
                
            }
        }

        switch (count($matches)) {
            case 0:
                echo self::$debug ? "  not found\n" : '';
                throw new NotFound();
            case 1:
                echo self::$debug ? "  found\n" : '';
                return array_pop($matches);
            default:
                echo self::$debug ? "  ambiguosus match: " . implode(', ', array_keys($matches)) . "\n" : '';
                throw new AmbiguousMatch();
        }
    }
public function getResourceByIds(array $ids, bool $checkIfExist = true): FedoraResource {
        echo self::$debug ? "[Fedora] searching for " . implode(', ', $ids) . "\n" : '';

        $matches = array();
        foreach ($ids as $id) {
            try {
                $res                         = $this->getResourceById($id, $checkIfExist);
                $matches[$res->getUri(true)] = $res;
            } catch (NotFound $e) {
                
            }
        }

        switch (count($matches)) {
            case 0:
                echo self::$debug ? "  not found\n" : '';
                throw new NotFound();
            case 1:
                echo self::$debug ? "  found\n" : '';
                return array_pop($matches);
            default:
                echo self::$debug ? "  ambiguosus match: " . implode(', ', array_keys($matches)) . "\n" : '';
                throw new AmbiguousMatch();
        }
    }
public function getResourceByIds ( array $ ids , bool $ checkIfExist = true ) : FedoraResource { echo self :: $ debug ? "[Fedora] searching for " . implode ( ', ' , $ ids ) . "\n" : '' ; $ matches = array ( ) ; foreach ( $ ids as $ id ) { try { $ res = $ this -> getResourceById ( $ id , $ checkIfExist ) ; $ matches [ $ res -> getUri ( true ) ] = $ res ; } catch ( NotFound $ e ) { } } switch ( count ( $ matches ) ) { case 0 : echo self :: $ debug ? "  not found\n" : '' ; throw new NotFound ( ) ; case 1 : echo self :: $ debug ? "  found\n" : '' ; return array_pop ( $ matches ) ; default : echo self :: $ debug ? "  ambiguosus match: " . implode ( ', ' , array_keys ( $ matches ) ) . "\n" : '' ; throw new AmbiguousMatch ( ) ; } }
Finds Fedora resources matching any of provided ids.
@param array $ids
@param bool $checkIfExist should we make sure resource was not deleted
during the current transaction
@return \acdhOeaw\fedora\FedoraResource
@throws NotFound
@throws AmbiguousMatch
Finds Fedora resources matching any of provided ids .