From 6afb61184fbcbc3e6e771521dc770d1ea4985f30 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Thu, 1 Jun 2017 15:02:58 +0200 Subject: [PATCH] feat(Messages): add OrderPaymentStateChanged message Closes #312 --- .../Helper/Annotate/AnnotationGenerator.php | 9 ++++ .../Message/OrderPaymentChangedMessage.php | 45 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/Core/Model/Message/OrderPaymentChangedMessage.php diff --git a/src/Core/Helper/Annotate/AnnotationGenerator.php b/src/Core/Helper/Annotate/AnnotationGenerator.php index 58b6769c06..afa1bed465 100644 --- a/src/Core/Helper/Annotate/AnnotationGenerator.php +++ b/src/Core/Helper/Annotate/AnnotationGenerator.php @@ -61,6 +61,9 @@ protected function getJsonObjects(\RegexIterator $phpFiles) $jsonObjects = []; foreach ($phpFiles as $phpFile) { $class = $this->getClassName($phpFile->getRealPath()); + if (strpos($class, 'Core\\Helper') > 0) { + continue; + } if (!empty($class)) { if (in_array(JsonObject::class, class_parents($class))) { @@ -77,6 +80,9 @@ protected function getCollectionObjects(\RegexIterator $phpFiles) $collectionObjects = []; foreach ($phpFiles as $phpFile) { $class = $this->getClassName($phpFile->getRealPath()); + if (strpos($class, 'Core\\Helper') > 0) { + continue; + } if (!empty($class)) { if (in_array(Collection::class, class_parents($class))) { @@ -93,6 +99,9 @@ protected function getRequestObjects(\RegexIterator $phpFiles) $requestObjects = []; foreach ($phpFiles as $phpFile) { $class = $this->getClassName($phpFile->getRealPath()); + if (strpos($class, 'Core\\Helper') > 0) { + continue; + } if (!empty($class)) { if (in_array(AbstractApiRequest::class, class_parents($class))) { diff --git a/src/Core/Model/Message/OrderPaymentChangedMessage.php b/src/Core/Model/Message/OrderPaymentChangedMessage.php new file mode 100644 index 0000000000..e154f4d9fa --- /dev/null +++ b/src/Core/Model/Message/OrderPaymentChangedMessage.php @@ -0,0 +1,45 @@ + + */ + +namespace Commercetools\Core\Model\Message; + +use Commercetools\Core\Model\Common\DateTimeDecorator; +use Commercetools\Core\Model\Common\Reference; +use DateTime; + +/** + * @package Commercetools\Core\Model\Message + * @link https://dev.commercetools.com/http-api-projects-messages.html#orderpaymentstatechanged-message + * @method string getId() + * @method OrderPaymentChangedMessage setId(string $id = null) + * @method DateTimeDecorator getCreatedAt() + * @method OrderPaymentChangedMessage setCreatedAt(DateTime $createdAt = null) + * @method int getSequenceNumber() + * @method OrderPaymentChangedMessage setSequenceNumber(int $sequenceNumber = null) + * @method Reference getResource() + * @method OrderPaymentChangedMessage setResource(Reference $resource = null) + * @method int getResourceVersion() + * @method OrderPaymentChangedMessage setResourceVersion(int $resourceVersion = null) + * @method string getType() + * @method OrderPaymentChangedMessage setType(string $type = null) + * @method int getVersion() + * @method OrderPaymentChangedMessage setVersion(int $version = null) + * @method DateTimeDecorator getLastModifiedAt() + * @method OrderPaymentChangedMessage setLastModifiedAt(DateTime $lastModifiedAt = null) + * @method string getPaymentState() + * @method OrderPaymentChangedMessage setPaymentState(string $paymentState = null) + */ +class OrderPaymentChangedMessage extends Message +{ + const MESSAGE_TYPE = 'OrderPaymentStateChanged'; + + public function fieldDefinitions() + { + $definitions = parent::fieldDefinitions(); + $definitions['paymentState'] = [static::TYPE => 'string']; + + return $definitions; + } +}