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

Commit 6afb611

Browse files
author
Jens Schulze
committed
feat(Messages): add OrderPaymentStateChanged message
Closes #312
1 parent 267ce5c commit 6afb611

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

src/Core/Helper/Annotate/AnnotationGenerator.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ protected function getJsonObjects(\RegexIterator $phpFiles)
6161
$jsonObjects = [];
6262
foreach ($phpFiles as $phpFile) {
6363
$class = $this->getClassName($phpFile->getRealPath());
64+
if (strpos($class, 'Core\\Helper') > 0) {
65+
continue;
66+
}
6467

6568
if (!empty($class)) {
6669
if (in_array(JsonObject::class, class_parents($class))) {
@@ -77,6 +80,9 @@ protected function getCollectionObjects(\RegexIterator $phpFiles)
7780
$collectionObjects = [];
7881
foreach ($phpFiles as $phpFile) {
7982
$class = $this->getClassName($phpFile->getRealPath());
83+
if (strpos($class, 'Core\\Helper') > 0) {
84+
continue;
85+
}
8086

8187
if (!empty($class)) {
8288
if (in_array(Collection::class, class_parents($class))) {
@@ -93,6 +99,9 @@ protected function getRequestObjects(\RegexIterator $phpFiles)
9399
$requestObjects = [];
94100
foreach ($phpFiles as $phpFile) {
95101
$class = $this->getClassName($phpFile->getRealPath());
102+
if (strpos($class, 'Core\\Helper') > 0) {
103+
continue;
104+
}
96105

97106
if (!empty($class)) {
98107
if (in_array(AbstractApiRequest::class, class_parents($class))) {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* @author @jayS-de <jens.schulze@commercetools.de>
4+
*/
5+
6+
namespace Commercetools\Core\Model\Message;
7+
8+
use Commercetools\Core\Model\Common\DateTimeDecorator;
9+
use Commercetools\Core\Model\Common\Reference;
10+
use DateTime;
11+
12+
/**
13+
* @package Commercetools\Core\Model\Message
14+
* @link https://dev.commercetools.com/http-api-projects-messages.html#orderpaymentstatechanged-message
15+
* @method string getId()
16+
* @method OrderPaymentChangedMessage setId(string $id = null)
17+
* @method DateTimeDecorator getCreatedAt()
18+
* @method OrderPaymentChangedMessage setCreatedAt(DateTime $createdAt = null)
19+
* @method int getSequenceNumber()
20+
* @method OrderPaymentChangedMessage setSequenceNumber(int $sequenceNumber = null)
21+
* @method Reference getResource()
22+
* @method OrderPaymentChangedMessage setResource(Reference $resource = null)
23+
* @method int getResourceVersion()
24+
* @method OrderPaymentChangedMessage setResourceVersion(int $resourceVersion = null)
25+
* @method string getType()
26+
* @method OrderPaymentChangedMessage setType(string $type = null)
27+
* @method int getVersion()
28+
* @method OrderPaymentChangedMessage setVersion(int $version = null)
29+
* @method DateTimeDecorator getLastModifiedAt()
30+
* @method OrderPaymentChangedMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
31+
* @method string getPaymentState()
32+
* @method OrderPaymentChangedMessage setPaymentState(string $paymentState = null)
33+
*/
34+
class OrderPaymentChangedMessage extends Message
35+
{
36+
const MESSAGE_TYPE = 'OrderPaymentStateChanged';
37+
38+
public function fieldDefinitions()
39+
{
40+
$definitions = parent::fieldDefinitions();
41+
$definitions['paymentState'] = [static::TYPE => 'string'];
42+
43+
return $definitions;
44+
}
45+
}

0 commit comments

Comments
 (0)