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

Commit

Permalink
feat(Messages): add OrderPaymentStateChanged message
Browse files Browse the repository at this point in the history
Closes #312
  • Loading branch information
Jens Schulze committed Jun 1, 2017
1 parent 267ce5c commit 6afb611
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Core/Helper/Annotate/AnnotationGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand All @@ -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))) {
Expand All @@ -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))) {
Expand Down
45 changes: 45 additions & 0 deletions src/Core/Model/Message/OrderPaymentChangedMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

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;
}
}

0 comments on commit 6afb611

Please # to comment.