BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
www
/
app.imagivibe.com
/
vendor
/
dcblogdev
/
laravel-xero
/
src
/
Resources
📤 Upload
📝 New File
📁 New Folder
Close
Editing: CreditNotes.php
<?php declare(strict_types=1); namespace Dcblogdev\Xero\Resources; use Dcblogdev\Xero\Enums\FilterOptions; use Dcblogdev\Xero\Xero; use InvalidArgumentException; class CreditNotes extends Xero { protected array $queryString = []; public function filter(string $key, string|int $value): static { if (! FilterOptions::isValid($key)) { throw new InvalidArgumentException("Filter option '$key' is not valid."); } $this->queryString[$key] = $value; return $this; } public function get(): array { $queryString = $this->formatQueryStrings($this->queryString); $result = parent::get('CreditNotes?'.$queryString); return $result['body']['CreditNotes']; } public function find(string $contactId): array { $result = parent::get('CreditNotes/'.$contactId); return $result['body']['CreditNotes'][0]; } public function update(string $contactId, array $data): array { $result = $this->post('CreditNotes/'.$contactId, $data); return $result['body']['CreditNotes'][0]; } public function store(array $data): array { $result = $this->post('CreditNotes', $data); return $result['body']['CreditNotes'][0]; } }
Save
Cancel