File "SaveMethodTrait.php"

Full Path: /home/cananyalcin/public_html/core/lib/coinbase/coinbase-commerce/src/Resources/Operations/SaveMethodTrait.php
File size: 370 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
namespace CoinbaseCommerce\Resources\Operations;

trait SaveMethodTrait
{
    public function save($headers = [])
    {
        $id = $this->getPrimaryKeyValue();

        if (\is_scalar($id) && !method_exists($this, 'update')) {
            throw new \Exception('Update is not allowed');
        }

        return $id ? $this->update() : $this->insert();
    }
}