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

Commit

Permalink
feat(Order): add state to order
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Sep 25, 2015
1 parent 95437d8 commit 3a6cc3d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/Model/Message/OrderStateTransitionMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* @author @ct-jensschulze <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

use Commercetools\Core\Model\Common\DateTimeDecorator;
use Commercetools\Core\Model\Common\Reference;
use Commercetools\Core\Model\State\StateReference;

/**
* @package Commercetools\Core\Model\Message
*
* @method string getId()
* @method OrderStateTransitionMessage setId(string $id = null)
* @method DateTimeDecorator getCreatedAt()
* @method OrderStateTransitionMessage setCreatedAt(\DateTime $createdAt = null)
* @method int getSequenceNumber()
* @method OrderStateTransitionMessage setSequenceNumber(int $sequenceNumber = null)
* @method Reference getResource()
* @method OrderStateTransitionMessage setResource(Reference $resource = null)
* @method int getResourceVersion()
* @method OrderStateTransitionMessage setResourceVersion(int $resourceVersion = null)
* @method string getType()
* @method OrderStateTransitionMessage setType(string $type = null)
* @method StateReference getState()
* @method OrderStateTransitionMessage setState(StateReference $state = null)
*/
class OrderStateTransitionMessage extends StateTransitionMessage
{
const MESSAGE_TYPE = 'OrderStateTransition';
}
4 changes: 4 additions & 0 deletions src/Model/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Commercetools\Core\Model\Cart\CartReference;
use Commercetools\Core\Model\CustomField\CustomFieldObject;
use Commercetools\Core\Model\Common\DateTimeDecorator;
use Commercetools\Core\Model\State\StateReference;

/**
* @package Commercetools\Core\Model\Order
Expand Down Expand Up @@ -73,6 +74,8 @@
* @method Order setCart(CartReference $cart = null)
* @method CustomFieldObject getCustom()
* @method Order setCustom(CustomFieldObject $custom = null)
* @method StateReference getState()
* @method Order setState(StateReference $state = null)
*/
class Order extends Resource
{
Expand Down Expand Up @@ -111,6 +114,7 @@ public function fieldDefinitions()
'lastMessageSequenceNumber' => [static::TYPE => 'int'],
'cart' => [static::TYPE => '\Commercetools\Core\Model\Cart\CartReference'],
'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'],
'state' => [static::TYPE => '\Commercetools\Core\Model\State\StateReference']
];
}
}
22 changes: 22 additions & 0 deletions src/Request/Orders/Command/OrderTransitionStateAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* @author @ct-jensschulze <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Request\Orders\Command;

use Commercetools\Core\Request\States\Command\TransitionStateAction;
use Commercetools\Core\Model\State\StateReference;

/**
* @package Commercetools\Core\Request\Orders\Command
*
* @method string getAction()
* @method OrderTransitionStateAction setAction(string $action = null)
* @method StateReference getState()
* @method OrderTransitionStateAction setState(StateReference $state = null)
*/
class OrderTransitionStateAction extends TransitionStateAction
{

}

0 comments on commit 3a6cc3d

Please # to comment.