src/acdhOeaw/fedora/dissemination/Service.php
private function getParameterValues(array $param, FedoraResource $res): array {
        $this->getParameters();

        $values = [];
        foreach ($param as $i) {
            $ii   = explode('|', substr($i, 1, -1));
            $name = array_shift($ii);

            if ($name === 'RES_URI') {
                $value = Parameter::value($res, '', $res->getUri(true), $ii);
            } else if ($name === 'RES_ID') {
                $value = Parameter::value($res, '', $res->getId(), $ii);
            } else if (isset($this->param[$name])) {
                $value = $this->param[$name]->getValue($res, $ii);
            } else {
                throw new RuntimeException('unknown parameter ' . $name);
            }
            $values[$i] = $value;
        }

        return $values;
    }
private function getParameterValues(array $param, FedoraResource $res): array {
        $this->getParameters();

        $values = [];
        foreach ($param as $i) {
            $ii   = explode('|', substr($i, 1, -1));
            $name = array_shift($ii);

            if ($name === 'RES_URI') {
                $value = Parameter::value($res, '', $res->getUri(true), $ii);
            } else if ($name === 'RES_ID') {
                $value = Parameter::value($res, '', $res->getId(), $ii);
            } else if (isset($this->param[$name])) {
                $value = $this->param[$name]->getValue($res, $ii);
            } else {
                throw new RuntimeException('unknown parameter ' . $name);
            }
            $values[$i] = $value;
        }

        return $values;
    }
private function getParameterValues ( array $ param , FedoraResource $ res ) : array { $ this -> getParameters ( ) ; $ values = [ ] ; foreach ( $ param as $ i ) { $ ii = explode ( '|' , substr ( $ i , 1 , - 1 ) ) ; $ name = array_shift ( $ ii ) ; if ( $ name === 'RES_URI' ) { $ value = Parameter :: value ( $ res , '' , $ res -> getUri ( true ) , $ ii ) ; } else if ( $ name === 'RES_ID' ) { $ value = Parameter :: value ( $ res , '' , $ res -> getId ( ) , $ ii ) ; } else if ( isset ( $ this -> param [ $ name ] ) ) { $ value = $ this -> param [ $ name ] -> getValue ( $ res , $ ii ) ; } else { throw new RuntimeException ( 'unknown parameter ' . $ name ) ; } $ values [ $ i ] = $ value ; } return $ values ; }
Evaluates parameter values for a given resource.
@param array $param list of parameters
@param FedoraResource $res repository resource to be disseminated
@return array associative array with parameter values
@throws RuntimeException
Evaluates parameter values for a given resource .