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.
feat(Product): add ProductCreated and ProductSlugChanged messages
- Loading branch information
Jens Schulze
committed
Dec 30, 2015
1 parent
7c3e6d8
commit dbb8a28
Showing
2 changed files
with
83 additions
and
0 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 @jayS-de <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\Product\ProductProjection; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* | ||
* @method string getId() | ||
* @method ProductCreatedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method ProductCreatedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method ProductCreatedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method ProductCreatedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method ProductCreatedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method ProductCreatedMessage setType(string $type = null) | ||
* @method ProductProjection getProductProjection() | ||
* @method ProductCreatedMessage setProductProjection(ProductProjection $productProjection = null) | ||
*/ | ||
class ProductCreatedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'ProductCreated'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['productProjection'] = [static::TYPE => '\Commercetools\Core\Model\Product\ProductProjection']; | ||
|
||
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,42 @@ | ||
<?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 Commercetools\Core\Model\Product\ProductProjection; | ||
use Commercetools\Core\Model\Common\LocalizedString; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* | ||
* @method string getId() | ||
* @method ProductSlugChangedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method ProductSlugChangedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method ProductSlugChangedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method ProductSlugChangedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method ProductSlugChangedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method ProductSlugChangedMessage setType(string $type = null) | ||
* @method LocalizedString getSlug() | ||
* @method ProductSlugChangedMessage setSlug(LocalizedString $slug = null) | ||
*/ | ||
class ProductSlugChangedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'ProductSlugChanged'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['slug'] = [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString']; | ||
|
||
return $definitions; | ||
} | ||
} |