Skip to content

Commit

Permalink
Added ScheduleAnchor object. #67
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Nov 9, 2017
1 parent 9185f16 commit cf9fad2
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 15 deletions.
21 changes: 11 additions & 10 deletions src/Model/Generated/Endpoint/ScheduleInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use bunq\Http\BunqResponse;
use bunq\Model\Core\BunqModel;
use bunq\Model\Generated\Object\Error;
use bunq\Model\Generated\Object\ScheduleAnchorObject;

/**
* view for reading, updating and listing the scheduled instance.
Expand Down Expand Up @@ -62,16 +63,16 @@ class ScheduleInstance extends BunqModel
protected $errorMessage;

/**
* The scheduled object.
* The scheduled object. (Payment, PaymentBatch)
*
* @var BunqModel
* @var ScheduleAnchorObject
*/
protected $scheduledObject;

/**
* The result object of this schedule instance. (payment, payment batch)
* The result object of this schedule instance. (Payment, PaymentBatch)
*
* @var BunqModel
* @var ScheduleAnchorObject
*/
protected $resultObject;

Expand Down Expand Up @@ -235,35 +236,35 @@ public function setErrorMessage($errorMessage)
}

/**
* The scheduled object.
* The scheduled object. (Payment, PaymentBatch)
*
* @return BunqModel
* @return ScheduleAnchorObject
*/
public function getScheduledObject()
{
return $this->scheduledObject;
}

/**
* @param BunqModel $scheduledObject
* @param ScheduleAnchorObject $scheduledObject
*/
public function setScheduledObject($scheduledObject)
{
$this->scheduledObject = $scheduledObject;
}

/**
* The result object of this schedule instance. (payment, payment batch)
* The result object of this schedule instance. (Payment, PaymentBatch)
*
* @return BunqModel
* @return ScheduleAnchorObject
*/
public function getResultObject()
{
return $this->resultObject;
}

/**
* @param BunqModel $resultObject
* @param ScheduleAnchorObject $resultObject
*/
public function setResultObject($resultObject)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Model/Generated/Object/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class Schedule extends BunqModel
protected $status;

/**
* The scheduled object.
* The scheduled object. (Payment, PaymentBatch)
*
* @var BunqModel
* @var ScheduleAnchorObject
*/
protected $object;

Expand Down Expand Up @@ -157,17 +157,17 @@ public function setStatus($status)
}

/**
* The scheduled object.
* The scheduled object. (Payment, PaymentBatch)
*
* @return BunqModel
* @return ScheduleAnchorObject
*/
public function getObject()
{
return $this->object;
}

/**
* @param BunqModel $object
* @param ScheduleAnchorObject $object
*/
public function setObject($object)
{
Expand Down
77 changes: 77 additions & 0 deletions src/Model/Generated/Object/ScheduleAnchorObject.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 ScheduleAnchorObject 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 cf9fad2

Please sign in to comment.