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

Commit

Permalink
feat(Product): add ProductCreated and ProductSlugChanged messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Dec 30, 2015
1 parent 7c3e6d8 commit dbb8a28
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/Model/Message/ProductCreatedMessage.php
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;
}
}
42 changes: 42 additions & 0 deletions src/Model/Message/ProductSlugChangedMessage.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 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;
}
}

0 comments on commit dbb8a28

Please # to comment.