This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ShoppingList): support AnonymousId on ShoppingList owner
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 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
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
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
37 changes: 37 additions & 0 deletions
37
src/Core/Request/ShoppingLists/Command/ShoppingListSetAnonymousIdAction.php
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,37 @@ | ||
<?php | ||
/** | ||
*/ | ||
|
||
namespace Commercetools\Core\Request\ShoppingLists\Command; | ||
|
||
use Commercetools\Core\Model\Common\Context; | ||
use Commercetools\Core\Request\AbstractAction; | ||
|
||
/** | ||
* @package Commercetools\Core\Request\ShoppingLists\Command | ||
* | ||
* @method string getAction() | ||
* @method ShoppingListSetAnonymousIdAction setAction(string $action = null) | ||
* @method string getAnonymousId() | ||
* @method ShoppingListSetAnonymousIdAction setAnonymousId(string $anonymousId = null) | ||
*/ | ||
class ShoppingListSetAnonymousIdAction extends AbstractAction | ||
{ | ||
public function fieldDefinitions() | ||
{ | ||
return [ | ||
'action' => [static::TYPE => 'string'], | ||
'anonymousId' => [static::TYPE => 'string'], | ||
]; | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param Context|callable $context | ||
*/ | ||
public function __construct(array $data = [], $context = null) | ||
{ | ||
parent::__construct($data, $context); | ||
$this->setAction('setAnonymousId'); | ||
} | ||
} |