src/acdhOeaw/fedora/Fedora.php
private function verifyResources(array $resources, bool $force = false): array {
        $passed = array();
        foreach ($resources as $key => $res) {
            try {
                $res->getMetadata($force);
                $passed[$key] = $res;
            } catch (ClientException $e) {
                // "410 gone" means the resource was deleted during current transaction
                if ($e->getCode() !== 410) {
                    throw $e;
                } else {
                    $this->cache->delete($res);
                }
            }
        }
        return $passed;
    }
private function verifyResources(array $resources, bool $force = false): array {
        $passed = array();
        foreach ($resources as $key => $res) {
            try {
                $res->getMetadata($force);
                $passed[$key] = $res;
            } catch (ClientException $e) {
                // "410 gone" means the resource was deleted during current transaction
                if ($e->getCode() !== 410) {
                    throw $e;
                } else {
                    $this->cache->delete($res);
                }
            }
        }
        return $passed;
    }
private function verifyResources ( array $ resources , bool $ force = false ) : array { $ passed = array ( ) ; foreach ( $ resources as $ key => $ res ) { try { $ res -> getMetadata ( $ force ) ; $ passed [ $ key ] = $ res ; } catch ( ClientException $ e ) { // "410 gone" means the resource was deleted during current transaction if ( $ e -> getCode ( ) !== 410 ) { throw $ e ; } else { $ this -> cache -> delete ( $ res ) ; } } } return $ passed ; }
Removes from an array resources which do not exist anymore.
@param array $resources
@param bool $force should resource be always checked (true) or maybe it
is enough if metadata were already fetched during this session (false)
@return array
@throws \acdhOeaw\fedora\ClientException
Removes from an array resources which do not exist anymore .