src/acdhOeaw/schema/dissemination/Service.php
public function updateRms(bool $create = true, bool $uploadBinary = true,
                              string $path = '/'): FedoraResource {
        parent::updateRms($create, $uploadBinary, $path);

        $res      = $this->getResource(false, false);
        $chPath = $res->getUri(true) . '/';
        $children = [];
        foreach ($res->getChildren() as $i) {
            $children[$i->getUri(true)] = $i;
        }
        $validChildren = [];

        foreach ($this->params as $i) {
            $tmp             = $i->updateRms($create, $uploadBinary, $chPath);
            $validChildren[] = $tmp->getUri(true);
        }

        foreach ($this->matches as $i) {
            $tmp             = $i->updateRms($create, $uploadBinary, $chPath);
            $validChildren[] = $tmp->getUri(true);
        }

        $invalidChildren = array_diff(array_keys($children), $validChildren);
        foreach ($invalidChildren as $i) {
            $children[$i]->delete(true, true, false);
        }

        return $res;
    }
public function updateRms(bool $create = true, bool $uploadBinary = true,
                              string $path = '/'): FedoraResource {
        parent::updateRms($create, $uploadBinary, $path);

        $res      = $this->getResource(false, false);
        $chPath = $res->getUri(true) . '/';
        $children = [];
        foreach ($res->getChildren() as $i) {
            $children[$i->getUri(true)] = $i;
        }
        $validChildren = [];

        foreach ($this->params as $i) {
            $tmp             = $i->updateRms($create, $uploadBinary, $chPath);
            $validChildren[] = $tmp->getUri(true);
        }

        foreach ($this->matches as $i) {
            $tmp             = $i->updateRms($create, $uploadBinary, $chPath);
            $validChildren[] = $tmp->getUri(true);
        }

        $invalidChildren = array_diff(array_keys($children), $validChildren);
        foreach ($invalidChildren as $i) {
            $children[$i]->delete(true, true, false);
        }

        return $res;
    }
public function updateRms ( bool $ create = true , bool $ uploadBinary = true , string $ path = '/' ) : FedoraResource { parent :: updateRms ( $ create , $ uploadBinary , $ path ) ; $ res = $ this -> getResource ( false , false ) ; $ chPath = $ res -> getUri ( true ) . '/' ; $ children = [ ] ; foreach ( $ res -> getChildren ( ) as $ i ) { $ children [ $ i -> getUri ( true ) ] = $ i ; } $ validChildren = [ ] ; foreach ( $ this -> params as $ i ) { $ tmp = $ i -> updateRms ( $ create , $ uploadBinary , $ chPath ) ; $ validChildren [ ] = $ tmp -> getUri ( true ) ; } foreach ( $ this -> matches as $ i ) { $ tmp = $ i -> updateRms ( $ create , $ uploadBinary , $ chPath ) ; $ validChildren [ ] = $ tmp -> getUri ( true ) ; } $ invalidChildren = array_diff ( array_keys ( $ children ) , $ validChildren ) ; foreach ( $ invalidChildren as $ i ) { $ children [ $ i ] -> delete ( true , true , false ) ; } return $ res ; }
Updates the dissemination service definition in the repository.
@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 the dissemination service definition in the repository .