Skip to content

Commit

Permalink
Added schedule instance anchor object. #67
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Nov 10, 2017
1 parent 9e0ffe8 commit 4f12e30
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Model/Generated/Endpoint/ScheduleInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use bunq\Model\Core\BunqModel;
use bunq\Model\Generated\Object\Error;
use bunq\Model\Generated\Object\ScheduleAnchorObject;
use bunq\Model\Generated\Object\ScheduleInstanceAnchorObject;
use bunq\Model\Generated\Object\ScheduleInstanceAnchorObject;

/**
* view for reading, updating and listing the scheduled instance.
Expand Down Expand Up @@ -72,7 +74,7 @@ class ScheduleInstance extends BunqModel
/**
* The result object of this schedule instance. (Payment, PaymentBatch)
*
* @var ScheduleAnchorObject
* @var ScheduleInstanceAnchorObject
*/
protected $resultObject;

Expand Down Expand Up @@ -256,15 +258,15 @@ public function setScheduledObject($scheduledObject)
/**
* The result object of this schedule instance. (Payment, PaymentBatch)
*
* @return ScheduleAnchorObject
* @return ScheduleInstanceAnchorObject
*/
public function getResultObject()
{
return $this->resultObject;
}

/**
* @param ScheduleAnchorObject $resultObject
* @param ScheduleInstanceAnchorObject $resultObject
*/
public function setResultObject($resultObject)
{
Expand Down
77 changes: 77 additions & 0 deletions src/Model/Generated/Object/ScheduleInstanceAnchorObject.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
namespace bunq\Model\Generated\Object;

use bunq\exception\BunqException;
use bunq\Model\Core\BunqModel;
use bunq\Model\Generated\Endpoint\Payment;
use bunq\Model\Generated\Endpoint\PaymentBatch;

/**
* @generated
*/
class ScheduleInstanceAnchorObject extends BunqModel
{
/**
* Error constants.
*/
const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.';

/**
* @var Payment
*/
protected $payment;

/**
* @var PaymentBatch
*/
protected $paymentBatch;

/**
* @return Payment
*/
public function getPayment()
{
return $this->payment;
}

/**
* @param Payment $payment
*/
public function setPayment($payment)
{
$this->payment = $payment;
}

/**
* @return PaymentBatch
*/
public function getPaymentBatch()
{
return $this->paymentBatch;
}

/**
* @param PaymentBatch $paymentBatch
*/
public function setPaymentBatch($paymentBatch)
{
$this->paymentBatch = $paymentBatch;
}

/**
* @return BunqModel
* @throws BunqException
*/
public function getReferencedObject()
{
if (!is_null($this->payment)) {
return $this->payment;
}

if (!is_null($this->paymentBatch)) {
return $this->paymentBatch;
}

throw new BunqException(self::ERROR_NULL_FIELDS);
}
}

0 comments on commit 4f12e30

Please sign in to comment.