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

Commit

Permalink
feat(Category): add CategoryCreated and CategorySlugChanged messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Dec 30, 2015
1 parent dbb8a28 commit 014dde2
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/Model/Message/CategoryCreatedMessage.php
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;
}
}
42 changes: 42 additions & 0 deletions src/Model/Message/CategorySlugChangedMessage.php
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;
}
}

0 comments on commit 014dde2

Please # to comment.