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(Category): add CategoryCreated and CategorySlugChanged messages
- Loading branch information
Jens Schulze
committed
Dec 30, 2015
1 parent
dbb8a28
commit 014dde2
Showing
2 changed files
with
86 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,44 @@ | ||
<?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\Category\Category; | ||
|
||
/** | ||
* @package Commercetools\Core\Model\Message | ||
* | ||
* @method string getId() | ||
* @method CategoryCreatedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method CategoryCreatedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method CategoryCreatedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method CategoryCreatedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method CategoryCreatedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method CategoryCreatedMessage setType(string $type = null) | ||
* @method ProductProjection getProductProjection() | ||
* @method ProductPublishedMessage setProductProjection(ProductProjection $productProjection = null) | ||
* @method Category getCategory() | ||
* @method CategoryCreatedMessage setCategory(Category $category = null) | ||
*/ | ||
class CategoryCreatedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'CategoryCreated'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['category'] = [static::TYPE => '\Commercetools\Core\Model\Category\Category']; | ||
|
||
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 CategorySlugChangedMessage setId(string $id = null) | ||
* @method DateTimeDecorator getCreatedAt() | ||
* @method CategorySlugChangedMessage setCreatedAt(\DateTime $createdAt = null) | ||
* @method int getSequenceNumber() | ||
* @method CategorySlugChangedMessage setSequenceNumber(int $sequenceNumber = null) | ||
* @method Reference getResource() | ||
* @method CategorySlugChangedMessage setResource(Reference $resource = null) | ||
* @method int getResourceVersion() | ||
* @method CategorySlugChangedMessage setResourceVersion(int $resourceVersion = null) | ||
* @method string getType() | ||
* @method CategorySlugChangedMessage setType(string $type = null) | ||
* @method LocalizedString getSlug() | ||
* @method CategorySlugChangedMessage setSlug(LocalizedString $slug = null) | ||
*/ | ||
class CategorySlugChangedMessage extends Message | ||
{ | ||
const MESSAGE_TYPE = 'CategorySlugChanged'; | ||
|
||
public function fieldDefinitions() | ||
{ | ||
$definitions = parent::fieldDefinitions(); | ||
$definitions['slug'] = [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString']; | ||
|
||
return $definitions; | ||
} | ||
} |