-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from turbo124/main
Add all entities to SDK
- Loading branch information
Showing
31 changed files
with
891 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* Invoice Ninja (https://invoiceninja.com). | ||
* | ||
* @link https://github.com/invoiceninja/sdk-php source repository | ||
* | ||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) | ||
* | ||
* @license https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace InvoiceNinja\Sdk\Endpoints; | ||
|
||
use GuzzleHttp\Exception\GuzzleException; | ||
use InvoiceNinja\Sdk\InvoiceNinja; | ||
|
||
class Companies | ||
{ | ||
|
||
protected InvoiceNinja $ninja; | ||
|
||
protected string $uri = "/api/v1/companies"; | ||
|
||
public function __construct(InvoiceNinja $ninja) | ||
{ | ||
$this->ninja = $ninja; | ||
} | ||
|
||
public function all(array $search = []) | ||
{ | ||
$query = ['query' => $search]; | ||
|
||
return $this->ninja->send("GET", "{$this->uri}", $query); | ||
} | ||
|
||
public function get(string $entity_id, array $search = []) | ||
{ | ||
$query = ['query' => $search]; | ||
|
||
return $this->ninja->send("GET", "{$this->uri}/{$entity_id}", $query); | ||
} | ||
|
||
public function update(string $entity_id, array $entity) | ||
{ | ||
$query = ['form_params' => $entity]; | ||
|
||
return $this->ninja->send("PUT", "{$this->uri}/{$entity_id}", $query); | ||
} | ||
|
||
public function create(array $entity, array $includes = []) | ||
{ | ||
$query = ['form_params' => $entity, 'query' => $includes]; | ||
|
||
return $this->ninja->send("POST", "{$this->uri}", $query); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Invoice Ninja (https://invoiceninja.com). | ||
* | ||
* @link https://github.com/invoiceninja/sdk-php source repository | ||
* | ||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) | ||
* | ||
* @license https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace InvoiceNinja\Sdk\Endpoints; | ||
|
||
use GuzzleHttp\Exception\GuzzleException; | ||
use InvoiceNinja\Sdk\InvoiceNinja; | ||
|
||
class Credits extends BaseEntity | ||
{ | ||
|
||
protected InvoiceNinja $ninja; | ||
|
||
protected string $uri = "/api/v1/credits"; | ||
|
||
public function __construct(InvoiceNinja $ninja) | ||
{ | ||
$this->ninja = $ninja; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Invoice Ninja (https://invoiceninja.com). | ||
* | ||
* @link https://github.com/invoiceninja/sdk-php source repository | ||
* | ||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) | ||
* | ||
* @license https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace InvoiceNinja\Sdk\Endpoints; | ||
|
||
use GuzzleHttp\Exception\GuzzleException; | ||
use InvoiceNinja\Sdk\InvoiceNinja; | ||
|
||
class Expenses extends BaseEntity | ||
{ | ||
|
||
protected InvoiceNinja $ninja; | ||
|
||
protected string $uri = "/api/v1/expenses"; | ||
|
||
public function __construct(InvoiceNinja $ninja) | ||
{ | ||
$this->ninja = $ninja; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Invoice Ninja (https://invoiceninja.com). | ||
* | ||
* @link https://github.com/invoiceninja/sdk-php source repository | ||
* | ||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) | ||
* | ||
* @license https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace InvoiceNinja\Sdk\Endpoints; | ||
|
||
use GuzzleHttp\Exception\GuzzleException; | ||
use InvoiceNinja\Sdk\InvoiceNinja; | ||
|
||
class Projects extends BaseEntity | ||
{ | ||
|
||
protected InvoiceNinja $ninja; | ||
|
||
protected string $uri = "/api/v1/projects"; | ||
|
||
public function __construct(InvoiceNinja $ninja) | ||
{ | ||
$this->ninja = $ninja; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.