Skip to content

Commit

Permalink
Add support for the order_item_id parameter on the Subscription entity
Browse files Browse the repository at this point in the history
  • Loading branch information
imkingdavid committed Jun 16, 2021
1 parent be6b8bf commit 0ed4321
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/SubscribePro/Service/Subscription/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class Subscription extends DataObject implements SubscriptionInterface
self::MAGENTO_SHIPPING_METHOD_CODE => false,
self::SHIPPING_METHOD_CODE => false,
self::USER_DEFINED_FIELDS => false,
self::PLATFORM_SPECIFIC_FIELDS => false
self::PLATFORM_SPECIFIC_FIELDS => false,
self::ORDER_ITEM_ID => false,
];

/**
Expand All @@ -62,7 +63,8 @@ class Subscription extends DataObject implements SubscriptionInterface
self::MAGENTO_SHIPPING_METHOD_CODE => false,
self::SHIPPING_METHOD_CODE => false,
self::USER_DEFINED_FIELDS => false,
self::PLATFORM_SPECIFIC_FIELDS => false
self::PLATFORM_SPECIFIC_FIELDS => false,
self::ORDER_ITEM_ID => false,
];

/**
Expand Down Expand Up @@ -684,5 +686,18 @@ public function getCancelled($format = null)
return $this->getDatetimeData(self::CANCELLED, $format);
}

/**
* @return string|null
*/
public function getOrderItemId()
{
return $this->getData(self::ORDER_ITEM_ID);
}

public function setOrderItemId($orderItemId)
{
return $this->setData(self::ORDER_ITEM_ID, $orderItemId);
}

//@codeCoverageIgnoreEnd
}
12 changes: 12 additions & 0 deletions src/SubscribePro/Service/Subscription/SubscriptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ interface SubscriptionInterface extends DataInterface
const CREATED = 'created';
const UPDATED = 'updated';
const CANCELLED = 'cancelled';
const ORDER_ITEM_ID = 'order_item_id';

/**
* Subscription statuses
Expand Down Expand Up @@ -298,6 +299,17 @@ public function setNextOrderDate($nextOrderDate);
*/
public function getNextOrderDate($format = null);

/**
* @return string|null
*/
public function getOrderItemId();

/**
* @param string $orderItemId
* @return $this
*/
public function setOrderItemId($orderItemId);

/**
* @param string|null $format
* @return string|null
Expand Down

0 comments on commit 0ed4321

Please sign in to comment.