src/acdhOeaw/fedora/Fedora.php
public function fixMetadataReferences(Resource $meta): Resource {
        $properties = array_diff($meta->propertyUris(), array(RC::idProp()));
        foreach ($properties as $p) {
            foreach ($meta->allResources($p) as $obj) {
                $id  = null;
                $uri = $obj->getUri();
                try {
                    $res = $this->getResourceById($uri);
                    $id  = $res->getId();
                } catch (NotFound $e) {
                    try {
                        $res = $this->getResourceByUri($uri);
                        $id  = $res->getId();
                    } catch (NotFound $e) {
                        
                    } catch (NoAcdhId $e) {
                        
                    } catch (ClientException $e) {
                        
                    }
                } catch (NoAcdhId $e) {
                    
                } catch (ClientException $e) {
                    
                }

                if ($id !== null && $id !== $obj->getUri()) {
                    $meta->delete($p, $obj);
                    $meta->addResource($p, $id);
                }
            }
        }
        return $meta;
    }
public function fixMetadataReferences(Resource $meta): Resource {
        $properties = array_diff($meta->propertyUris(), array(RC::idProp()));
        foreach ($properties as $p) {
            foreach ($meta->allResources($p) as $obj) {
                $id  = null;
                $uri = $obj->getUri();
                try {
                    $res = $this->getResourceById($uri);
                    $id  = $res->getId();
                } catch (NotFound $e) {
                    try {
                        $res = $this->getResourceByUri($uri);
                        $id  = $res->getId();
                    } catch (NotFound $e) {
                        
                    } catch (NoAcdhId $e) {
                        
                    } catch (ClientException $e) {
                        
                    }
                } catch (NoAcdhId $e) {
                    
                } catch (ClientException $e) {
                    
                }

                if ($id !== null && $id !== $obj->getUri()) {
                    $meta->delete($p, $obj);
                    $meta->addResource($p, $id);
                }
            }
        }
        return $meta;
    }
public function fixMetadataReferences ( Resource $ meta ) : Resource { $ properties = array_diff ( $ meta -> propertyUris ( ) , array ( RC :: idProp ( ) ) ) ; foreach ( $ properties as $ p ) { foreach ( $ meta -> allResources ( $ p ) as $ obj ) { $ id = null ; $ uri = $ obj -> getUri ( ) ; try { $ res = $ this -> getResourceById ( $ uri ) ; $ id = $ res -> getId ( ) ; } catch ( NotFound $ e ) { try { $ res = $ this -> getResourceByUri ( $ uri ) ; $ id = $ res -> getId ( ) ; } catch ( NotFound $ e ) { } catch ( NoAcdhId $ e ) { } catch ( ClientException $ e ) { } } catch ( NoAcdhId $ e ) { } catch ( ClientException $ e ) { } if ( $ id !== null && $ id !== $ obj -> getUri ( ) ) { $ meta -> delete ( $ p , $ obj ) ; $ meta -> addResource ( $ p , $ id ) ; } } } return $ meta ; }
Tries to switch references to all repository resources into their UUIDs.

Changes are done in-place!
@param Resource $meta metadata to apply changes to
@return Resource
Tries to switch references to all repository resources into their UUIDs .