PayPal\Api\Template::update PHP Method

update() public method

Update an existing template by passing the template ID to the request URI. In addition, pass a complete template object in the request JSON. Partial updates are not supported.
public update ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Template
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return Template
    public function update($apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($this->getTemplateId(), "Id");
        $payLoad = $this->toJSON();
        $json = self::executeCall("/v1/invoicing/templates/{$this->getTemplateId()}", "PUT", $payLoad, null, $apiContext, $restCall);
        $this->fromJson($json);
        return $this;
    }