This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jens Schulze
committed
Sep 25, 2015
1 parent
c720eed
commit b9308c1
Showing
21 changed files
with
232 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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\Payment\Payment; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* | ||
* @method string getId() | ||
* @method PaymentCreatedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method PaymentCreatedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method PaymentCreatedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method PaymentCreatedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method PaymentCreatedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method PaymentCreatedMessage setType(string $type = null) | ||
* @method Payment getPayment() | ||
* @method PaymentCreatedMessage setPayment(Payment $payment = null) | ||
*/ | ||
class PaymentCreatedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'PaymentCreated'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['payment'] = [static::TYPE => '\Commercetools\Core\Model\Payment\Payment']; | ||
|
||
return $definitions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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\CustomField\CustomFieldObject; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* | ||
* @method string getId() | ||
* @method PaymentInteractionAddedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method PaymentInteractionAddedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method PaymentInteractionAddedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method PaymentInteractionAddedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method PaymentInteractionAddedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method PaymentInteractionAddedMessage setType(string $type = null) | ||
* @method CustomFieldObject getInteraction() | ||
* @method PaymentInteractionAddedMessage setInteraction(CustomFieldObject $interaction = null) | ||
*/ | ||
class PaymentInteractionAddedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'PaymentInteractionAdded'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['interaction'] = [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject']; | ||
|
||
return $definitions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 PaymentStatusStateTransitionMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method PaymentStatusStateTransitionMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method PaymentStatusStateTransitionMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method PaymentStatusStateTransitionMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method PaymentStatusStateTransitionMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method PaymentStatusStateTransitionMessage setType(string $type = null) | ||
* @method StateReference getState() | ||
* @method PaymentStatusStateTransitionMessage setState(StateReference $state = null) | ||
*/ | ||
class PaymentStatusStateTransitionMessage extends StateTransitionMessage | ||
{ | ||
const MESSAGE_TYPE = 'PaymentStatusStateTransition'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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\Payment\Transaction; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* | ||
* @method string getId() | ||
* @method PaymentTransactionAddedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method PaymentTransactionAddedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method PaymentTransactionAddedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method PaymentTransactionAddedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method PaymentTransactionAddedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method PaymentTransactionAddedMessage setType(string $type = null) | ||
* @method Transaction getTransaction() | ||
* @method PaymentTransactionAddedMessage setTransaction(Transaction $transaction = null) | ||
*/ | ||
class PaymentTransactionAddedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'PaymentTransactionAdded'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['transaction'] = [static::TYPE => '\Commercetools\Core\Model\Payment\Transaction']; | ||
|
||
return $definitions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* @author @ct-jensschulze <jens.schulze@commercetools.de> | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\States\Command; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Model\State\StateReference; | ||
use Commercetools\Core\Request\AbstractAction; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\States\Command | ||
* | ||
* @method string getAction() | ||
* @method TransitionStateAction setAction(string $action = null) | ||
* @method StateReference getState() | ||
* @method TransitionStateAction setState(StateReference $state = null) | ||
*/ | ||
class TransitionStateAction extends AbstractAction | ||
{ | ||
public function fieldDefinitions() | ||
{ | ||
return [ | ||
'action' => [static::TYPE => 'string'], | ||
'state' => [static::TYPE => '\Commercetools\Core\Model\State\StateReference'], | ||
]; | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param Context|callable $context | ||
*/ | ||
public function __construct(array $data = [], $context = null) | ||
{ | ||
parent::__construct($data, $context); | ||
$this->setAction('transitionState'); | ||
} | ||
|
||
/** | ||
* @param StateReference $state | ||
* @param Context|callable $context | ||
* @return static | ||
*/ | ||
public static function ofState(StateReference $state, $context = null) | ||
{ | ||
return static::of($context)->setState($state); | ||
} | ||
} |