Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
unsatisfiableness
/
core
/
lib
/
coinbase
/
coinbase-commerce
/
src
/
Resources
/
Operations
:
DeleteMethodTrait.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace CoinbaseCommerce\Resources\Operations; use CoinbaseCommerce\Util; trait DeleteMethodTrait { public function delete($headers = []) { $id = $this->getPrimaryKeyValue(); if (!\is_scalar($id)) { throw new \Exception('id is not set.'); } $path = Util::joinPath(static::getResourcePath(), $id); $client = static::getClient(); $client->delete($path, $headers); $this->clearAttributes(); } public static function deleteById($id, $headers = []) { if (!\is_scalar($id)) { throw new \Exception('Invalid id provided.'); } $path = Util::joinPath(static::getResourcePath(), $id); $client = static::getClient(); $client->delete($path, $headers); return new static; } }