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

Commit 673b4cf

Browse files
Barbara PalumboBarbara Palumbo
authored andcommitted
feat(Message): add messages ProductAddedToCategory and ProductRemovedFromCategory
1 parent 2f9b349 commit 673b4cf

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ cache/commercetools_io_access_token*
2020
src/cache/
2121
github_deploy_key
2222
node_modules
23+
docroot/cache/
24+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
4+
namespace Commercetools\Core\Model\Message;
5+
6+
use Commercetools\Core\Model\Category\CategoryReference;
7+
use Commercetools\Core\Model\Common\DateTimeDecorator;
8+
use DateTime;
9+
use Commercetools\Core\Model\Common\Reference;
10+
11+
/**
12+
* @package Commercetools\Core\Model\Message
13+
* @link https://docs.commercetools.com/http-api-message-types#productaddedtocategory-message
14+
*
15+
* @method string getId()
16+
* @method ProductAddedToCategoryMessage setId(string $id = null)
17+
* @method int getVersion()
18+
* @method ProductAddedToCategoryMessage setVersion(int $version = null)
19+
* @method DateTimeDecorator getCreatedAt()
20+
* @method ProductAddedToCategoryMessage setCreatedAt(DateTime $createdAt = null)
21+
* @method DateTimeDecorator getLastModifiedAt()
22+
* @method ProductAddedToCategoryMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
23+
* @method int getSequenceNumber()
24+
* @method ProductAddedToCategoryMessage setSequenceNumber(int $sequenceNumber = null)
25+
* @method Reference getResource()
26+
* @method ProductAddedToCategoryMessage setResource(Reference $resource = null)
27+
* @method int getResourceVersion()
28+
* @method ProductAddedToCategoryMessage setResourceVersion(int $resourceVersion = null)
29+
* @method string getType()
30+
* @method ProductAddedToCategoryMessage setType(string $type = null)
31+
* @method UserProvidedIdentifiers getResourceUserProvidedIdentifiers()
32+
* phpcs:disable
33+
* @method ProductAddedToCategoryMessage setResourceUserProvidedIdentifiers(UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null)
34+
* phpcs:enable
35+
* @method CategoryReference getCategory()
36+
* @method ProductAddedToCategoryMessage setCategory(CategoryReference $category = null)
37+
* @method bool getStaged()
38+
* @method ProductAddedToCategoryMessage setStaged(bool $staged = null)
39+
*/
40+
class ProductAddedToCategoryMessage extends Message
41+
{
42+
const MESSAGE_TYPE = 'ProductAddedToCategory';
43+
44+
public function fieldDefinitions()
45+
{
46+
$definitions = parent::fieldDefinitions();
47+
$definitions['category'] = [static::TYPE => CategoryReference::class];
48+
$definitions['staged'] = [static::TYPE => 'bool'];
49+
50+
return $definitions;
51+
}
52+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
4+
namespace Commercetools\Core\Model\Message;
5+
6+
use Commercetools\Core\Model\Category\CategoryReference;
7+
use Commercetools\Core\Model\Common\DateTimeDecorator;
8+
use DateTime;
9+
use Commercetools\Core\Model\Common\Reference;
10+
11+
/**
12+
* @package Commercetools\Core\Model\Message
13+
* @link https://docs.commercetools.com/http-api-message-types#productremovedfromcategory-message
14+
*
15+
* @method string getId()
16+
* @method ProductRemovedFromCategoryMessage setId(string $id = null)
17+
* @method int getVersion()
18+
* @method ProductRemovedFromCategoryMessage setVersion(int $version = null)
19+
* @method DateTimeDecorator getCreatedAt()
20+
* @method ProductRemovedFromCategoryMessage setCreatedAt(DateTime $createdAt = null)
21+
* @method DateTimeDecorator getLastModifiedAt()
22+
* @method ProductRemovedFromCategoryMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
23+
* @method int getSequenceNumber()
24+
* @method ProductRemovedFromCategoryMessage setSequenceNumber(int $sequenceNumber = null)
25+
* @method Reference getResource()
26+
* @method ProductRemovedFromCategoryMessage setResource(Reference $resource = null)
27+
* @method int getResourceVersion()
28+
* @method ProductRemovedFromCategoryMessage setResourceVersion(int $resourceVersion = null)
29+
* @method string getType()
30+
* @method ProductRemovedFromCategoryMessage setType(string $type = null)
31+
* @method UserProvidedIdentifiers getResourceUserProvidedIdentifiers()
32+
* phpcs:disable
33+
* @method ProductRemovedFromCategoryMessage setResourceUserProvidedIdentifiers(UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null)
34+
* phpcs:enable
35+
* @method CategoryReference getCategory()
36+
* @method ProductRemovedFromCategoryMessage setCategory(CategoryReference $category = null)
37+
* @method bool getStaged()
38+
* @method ProductRemovedFromCategoryMessage setStaged(bool $staged = null)
39+
*/
40+
class ProductRemovedFromCategoryMessage extends Message
41+
{
42+
const MESSAGE_TYPE = 'ProductRemovedFromCategory';
43+
44+
public function fieldDefinitions()
45+
{
46+
$definitions = parent::fieldDefinitions();
47+
$definitions['category'] = [static::TYPE => CategoryReference::class];
48+
$definitions['staged'] = [static::TYPE => 'bool'];
49+
50+
return $definitions;
51+
}
52+
}

0 commit comments

Comments
 (0)