lib/API/Values/ParameterStructTrait.php
private function fillFromCollection(
        ParameterDefinitionCollectionInterface $definitionCollection,
        ParameterCollectionInterface $parameters
    ): void {
        foreach ($definitionCollection->getParameterDefinitions() as $name => $definition) {
            $value = null;

            if ($parameters->hasParameter($name)) {
                $parameter = $parameters->getParameter($name);
                if ($parameter->getParameterDefinition()->getType()::getIdentifier() === $definition->getType()::getIdentifier()) {
                    $value = $parameter->getValue();
                    $value = is_object($value) ? clone $value : $value;
                }
            }

            $this->setParameterValue($name, $value);

            if ($definition instanceof CompoundParameterDefinition) {
                $this->fillFromCollection($definition, $parameters);
            }
        }
    }
private function fillFromCollection(
        ParameterDefinitionCollectionInterface $definitionCollection,
        ParameterCollectionInterface $parameters
    ): void {
        foreach ($definitionCollection->getParameterDefinitions() as $name => $definition) {
            $value = null;

            if ($parameters->hasParameter($name)) {
                $parameter = $parameters->getParameter($name);
                if ($parameter->getParameterDefinition()->getType()::getIdentifier() === $definition->getType()::getIdentifier()) {
                    $value = $parameter->getValue();
                    $value = is_object($value) ? clone $value : $value;
                }
            }

            $this->setParameterValue($name, $value);

            if ($definition instanceof CompoundParameterDefinition) {
                $this->fillFromCollection($definition, $parameters);
            }
        }
    }
private function fillFromCollection ( ParameterDefinitionCollectionInterface $ definitionCollection , ParameterCollectionInterface $ parameters ) : void { foreach ( $ definitionCollection -> getParameterDefinitions ( ) as $ name => $ definition ) { $ value = null ; if ( $ parameters -> hasParameter ( $ name ) ) { $ parameter = $ parameters -> getParameter ( $ name ) ; if ( $ parameter -> getParameterDefinition ( ) -> getType ( ) :: getIdentifier ( ) === $ definition -> getType ( ) :: getIdentifier ( ) ) { $ value = $ parameter -> getValue ( ) ; $ value = is_object ( $ value ) ? clone $ value : $ value ; } } $ this -> setParameterValue ( $ name , $ value ) ; if ( $ definition instanceof CompoundParameterDefinition ) { $ this -> fillFromCollection ( $ definition , $ parameters ) ; } } }
Fills the struct values based on provided parameter collection.
Fills the struct values based on provided parameter collection .