dolibarr/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Delete.php

28 lines
655 B
PHP
Raw Normal View History

2018-03-07 19:26:06 +01:00
<?php
namespace Stripe\ApiOperations;
/**
* Trait for deletable resources. Adds a `delete()` method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Delete
{
/**
* @param array|null $params
* @param array|string|null $opts
*
2019-05-16 21:41:14 +02:00
* @return static The deleted resource.
2018-03-07 19:26:06 +01:00
*/
public function delete($params = null, $opts = null)
{
self::_validateParams($params);
$url = $this->instanceUrl();
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}