src/acdhOeaw/schema/SchemaObject.php
public function updateRms(bool $create = true, bool $uploadBinary = true,
                              string $path = '/'): FedoraResource {
        $this->created = $this->findResource($create, $uploadBinary, $path);

        // if it has just been created it would be a waste of time to update it
        if (!$this->created) {
            $meta = $this->getMetadata();
            if ($this->metadata) {
                $meta->merge($this->metadata, $this->metadataPreserve);
            }
            $this->fedora->fixMetadataReferences($meta);
            $meta = $this->mergeMetadata($this->res->getMetadata(), $meta);
            $this->res->setMetadata($meta);
            $this->res->updateMetadata();

            $binaryContent = $this->getBinaryData();
            if ($uploadBinary && $binaryContent !== '') {
                $this->res->updateContent($binaryContent, true);
            }
        }

        return $this->res;
    }
public function updateRms(bool $create = true, bool $uploadBinary = true,
                              string $path = '/'): FedoraResource {
        $this->created = $this->findResource($create, $uploadBinary, $path);

        // if it has just been created it would be a waste of time to update it
        if (!$this->created) {
            $meta = $this->getMetadata();
            if ($this->metadata) {
                $meta->merge($this->metadata, $this->metadataPreserve);
            }
            $this->fedora->fixMetadataReferences($meta);
            $meta = $this->mergeMetadata($this->res->getMetadata(), $meta);
            $this->res->setMetadata($meta);
            $this->res->updateMetadata();

            $binaryContent = $this->getBinaryData();
            if ($uploadBinary && $binaryContent !== '') {
                $this->res->updateContent($binaryContent, true);
            }
        }

        return $this->res;
    }
public function updateRms ( bool $ create = true , bool $ uploadBinary = true , string $ path = '/' ) : FedoraResource { $ this -> created = $ this -> findResource ( $ create , $ uploadBinary , $ path ) ; // if it has just been created it would be a waste of time to update it if ( ! $ this -> created ) { $ meta = $ this -> getMetadata ( ) ; if ( $ this -> metadata ) { $ meta -> merge ( $ this -> metadata , $ this -> metadataPreserve ) ; } $ this -> fedora -> fixMetadataReferences ( $ meta ) ; $ meta = $ this -> mergeMetadata ( $ this -> res -> getMetadata ( ) , $ meta ) ; $ this -> res -> setMetadata ( $ meta ) ; $ this -> res -> updateMetadata ( ) ; $ binaryContent = $ this -> getBinaryData ( ) ; if ( $ uploadBinary && $ binaryContent !== '' ) { $ this -> res -> updateContent ( $ binaryContent , true ) ; } } return $ this -> res ; }
Updates repository resource representing a real-world entity stored in
this object.

@param bool $create should repository resource be created if it does not
exist?
@param bool $uploadBinary should binary data of the real-world entity
be uploaded uppon repository resource creation?
@param string $path where to create a resource (if it does not exist).
If it it ends with a "/", the resource will be created as a child of
a given collection). All the parents in the Fedora resource tree have
to exist (you can not create "/foo/bar" if "/foo" does not exist already).
@return FedoraResource
Updates repository resource representing a real - world entity stored in this object .