-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
namespace Import -> ChartMogul, backwards compatible (#17)
* namespace Import -> ChartMogul, backwards compatible
- Loading branch information
Showing
23 changed files
with
400 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace ChartMogul; | ||
|
||
use ChartMogul\Resource\AbstractResource; | ||
use ChartMogul\Http\ClientInterface; | ||
use Doctrine\Common\Collections\ArrayCollection; | ||
|
||
class CustomerInvoices extends AbstractResource | ||
{ | ||
|
||
use \ChartMogul\Service\CreateTrait; | ||
use \ChartMogul\Service\AllTrait; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
const RESOURCE_PATH = '/v1/import/customers/:customer_uuid/invoices'; | ||
/** | ||
* @ignore | ||
*/ | ||
const RESOURCE_NAME = 'Invoices'; | ||
|
||
public $invoices = []; | ||
|
||
public $customer_uuid; | ||
|
||
public function __construct(array $attr = [], ClientInterface $client = null) | ||
{ | ||
parent::__construct($attr, $client); | ||
|
||
$this->invoices = new ArrayCollection($this->invoices); | ||
foreach ($this->invoices as $key => $item) { | ||
$this->setInvoice($key, $item); | ||
} | ||
} | ||
|
||
protected function setInvoice($index, $invoice) | ||
{ | ||
|
||
if ($invoice instanceof \ChartMogul\Import\Invoice) { | ||
$this->invoices[$index] =$invoice; | ||
} elseif (is_array($invoice)) { | ||
$this->invoices[$index] = new \ChartMogul\Import\Invoice($invoice); | ||
} | ||
} | ||
} |
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,10 @@ | ||
<?php | ||
|
||
namespace ChartMogul\Import; | ||
|
||
/** | ||
* @deprecated Use ChartMogul\DataSource | ||
*/ | ||
class DataSource extends ChartMogul\DataSource { | ||
|
||
} |
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
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,10 @@ | ||
<?php | ||
|
||
namespace ChartMogul\Import; | ||
|
||
/** | ||
* @deprecated Use ChartMogul\Plan | ||
*/ | ||
class Plan extends ChartMogul\Plan { | ||
|
||
} |
Oops, something went wrong.