Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 602303a

Browse files
committed
feat(Subscription): add modifedAt to change subscription payloads
Closes #416
1 parent b5dc8d5 commit 602303a

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/Core/Model/Subscription/ResourceCreatedDelivery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
namespace Commercetools\Core\Model\Subscription;
77

8+
use Commercetools\Core\Model\Common\DateTimeDecorator;
89
use Commercetools\Core\Model\Common\Reference;
10+
use DateTime;
911

1012
/**
1113
* @package Commercetools\Core\Model\Subscription
@@ -17,13 +19,16 @@
1719
* @method ResourceCreatedDelivery setResource(Reference $resource = null)
1820
* @method int getVersion()
1921
* @method ResourceCreatedDelivery setVersion(int $version = null)
22+
* @method DateTimeDecorator getModifiedAt()
23+
* @method ResourceCreatedDelivery setModifiedAt(DateTime $modifiedAt = null)
2024
*/
2125
class ResourceCreatedDelivery extends Delivery
2226
{
2327
public function fieldDefinitions()
2428
{
2529
$definition = parent::fieldDefinitions();
2630
$definition['version'] = [static::TYPE => 'int'];
31+
$definition['modifiedAt'] = [static::TYPE => DateTime::class, static::DECORATOR => DateTimeDecorator::class ];
2732
return $definition;
2833
}
2934
}

src/Core/Model/Subscription/ResourceDeletedDelivery.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
namespace Commercetools\Core\Model\Subscription;
77

8+
use Commercetools\Core\Model\Common\DateTimeDecorator;
89
use Commercetools\Core\Model\Common\Reference;
10+
use DateTime;
911

1012
/**
1113
* @package Commercetools\Core\Model\Subscription
@@ -17,13 +19,17 @@
1719
* @method ResourceDeletedDelivery setResource(Reference $resource = null)
1820
* @method int getVersion()
1921
* @method ResourceDeletedDelivery setVersion(int $version = null)
22+
* @method DateTimeDecorator getModifiedAt()
23+
* @method ResourceDeletedDelivery setModifiedAt(DateTime $modifiedAt = null)
2024
*/
2125
class ResourceDeletedDelivery extends Delivery
2226
{
2327
public function fieldDefinitions()
2428
{
2529
$definition = parent::fieldDefinitions();
2630
$definition['version'] = [static::TYPE => 'int'];
31+
$definition['modifiedAt'] = [static::TYPE => DateTime::class, static::DECORATOR => DateTimeDecorator::class ];
32+
2733
return $definition;
2834
}
2935
}

src/Core/Model/Subscription/ResourceUpdatedDelivery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
namespace Commercetools\Core\Model\Subscription;
77

8+
use Commercetools\Core\Model\Common\DateTimeDecorator;
89
use Commercetools\Core\Model\Common\Reference;
10+
use DateTime;
911

1012
/**
1113
* @package Commercetools\Core\Model\Subscription
@@ -19,6 +21,8 @@
1921
* @method ResourceUpdatedDelivery setVersion(int $version = null)
2022
* @method int getOldVersion()
2123
* @method ResourceUpdatedDelivery setOldVersion(int $oldVersion = null)
24+
* @method DateTimeDecorator getModifiedAt()
25+
* @method ResourceUpdatedDelivery setModifiedAt(DateTime $modifiedAt = null)
2226
*/
2327
class ResourceUpdatedDelivery extends Delivery
2428
{
@@ -27,6 +31,7 @@ public function fieldDefinitions()
2731
$definition = parent::fieldDefinitions();
2832
$definition['version'] = [static::TYPE => 'int'];
2933
$definition['oldVersion'] = [static::TYPE => 'int'];
34+
$definition['modifiedAt'] = [static::TYPE => DateTime::class, static::DECORATOR => DateTimeDecorator::class ];
3035
return $definition;
3136
}
3237
}

0 commit comments

Comments
 (0)