AppserverIo\Appserver\Core\Api\Node\ParamsNodeTrait::setParam PHP Method

setParam() public method

Sets the param with the passed name, type and value.
public setParam ( string $name, string $type, mixed $value ) : void
$name string The param name
$type string The param type
$value mixed The param value
return void
    public function setParam($name, $type, $value)
    {
        // initialize the param to set
        $paramToSet = new ParamNode($name, $type, new NodeValue($value));
        // query whether a param with this name has already been set
        foreach ($this->params as $key => $param) {
            if ($param->getName() === $paramToSet->getName()) {
                // override the param
                $this->params[$key] = $paramToSet;
                return;
            }
        }
        // append the param
        $this->params[] = $paramToSet;
    }