-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Rackbeat\Builders; | ||
|
||
|
||
use Rackbeat\Models\DraftPurchaseOrder; | ||
|
||
class DraftPurchaseOrderBuilder extends Builder | ||
{ | ||
protected $entity = 'purchase-orders/drafts'; | ||
protected $model = DraftPurchaseOrder::class; | ||
} |
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,12 @@ | ||
<?php | ||
|
||
namespace Rackbeat\Builders; | ||
|
||
|
||
use Rackbeat\Models\PurchaseOrder; | ||
|
||
class PurchaseOrderBuilder extends Builder | ||
{ | ||
protected $entity = 'purchase-orders'; | ||
protected $model = PurchaseOrder::class; | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace Rackbeat\Models; | ||
|
||
|
||
use Rackbeat\Utils\Model; | ||
|
||
class DraftPurchaseOrder extends Model | ||
{ | ||
protected $entity = 'purchase-orders/drafts'; | ||
protected $primaryKey = 'number'; | ||
|
||
public function getPDF() | ||
{ | ||
return $this->request->handleWithExceptions( function () { | ||
return $this->request->client->get( "{$this->entity}/{$this->{$this->primaryKey}}.pdf" )->getBody() | ||
->getContents(); | ||
} ); | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace Rackbeat\Models; | ||
|
||
|
||
use Rackbeat\Utils\Model; | ||
|
||
class PurchaseOrder extends Model | ||
{ | ||
protected $entity = 'purchase-orders'; | ||
protected $primaryKey = 'number'; | ||
|
||
public function getPDF() | ||
{ | ||
return $this->request->handleWithExceptions( function () { | ||
return $this->request->client->get( "{$this->entity}/{$this->{$this->primaryKey}}.pdf" )->getBody() | ||
->getContents(); | ||
} ); | ||
} | ||
|
||
public function reopen() | ||
{ | ||
|
||
return $this->request->handleWithExceptions( function () { | ||
|
||
return $this->request->client->post( "{$this->entity}/{$this->{$this->primaryKey}}/reopen" ) | ||
->getBody() | ||
->getContents(); | ||
} ); | ||
} | ||
} |
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