|
| 1 | +<?php |
| 2 | +/** |
| 3 | + */ |
| 4 | + |
| 5 | +namespace Commercetools\Core\Builder\Request; |
| 6 | + |
| 7 | +use Commercetools\Core\Model\ShoppingList\MyShoppingListDraft; |
| 8 | +use Commercetools\Core\Model\ShoppingList\ShoppingList; |
| 9 | +use Commercetools\Core\Request\Me\MeShoppingListByIdGetRequest; |
| 10 | +use Commercetools\Core\Request\Me\MeShoppingListCreateRequest; |
| 11 | +use Commercetools\Core\Request\Me\MeShoppingListDeleteRequest; |
| 12 | +use Commercetools\Core\Request\Me\MeShoppingListQueryRequest; |
| 13 | +use Commercetools\Core\Request\Me\MeShoppingListUpdateRequest; |
| 14 | + |
| 15 | +class MeShoppingListRequestBuilder |
| 16 | +{ |
| 17 | + |
| 18 | + /** |
| 19 | + * @return MeShoppingListQueryRequest |
| 20 | + */ |
| 21 | + public function query() |
| 22 | + { |
| 23 | + return MeShoppingListQueryRequest::of(); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * @param ShoppingList $shoppingList |
| 28 | + * @return MeShoppingListUpdateRequest |
| 29 | + */ |
| 30 | + public function update(ShoppingList $shoppingList) |
| 31 | + { |
| 32 | + return MeShoppingListUpdateRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion()); |
| 33 | + } |
| 34 | + |
| 35 | + /** |
| 36 | + * @param string $shoppingListId |
| 37 | + * @return MeShoppingListByIdGetRequest |
| 38 | + */ |
| 39 | + public function getById($shoppingListId) |
| 40 | + { |
| 41 | + return MeShoppingListByIdGetRequest::ofId($shoppingListId); |
| 42 | + } |
| 43 | + |
| 44 | + /** |
| 45 | + * @param MyShoppingListDraft $myShoppingListDraft |
| 46 | + * @return MeShoppingListCreateRequest |
| 47 | + */ |
| 48 | + public function create(MyShoppingListDraft $myShoppingListDraft) |
| 49 | + { |
| 50 | + return MeShoppingListCreateRequest::ofDraft($myShoppingListDraft); |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * @param ShoppingList $shoppingList |
| 55 | + * @return MeShoppingListDeleteRequest |
| 56 | + */ |
| 57 | + public function delete(ShoppingList $shoppingList) |
| 58 | + { |
| 59 | + return MeShoppingListDeleteRequest::ofIdAndVersion($shoppingList->getId(), $shoppingList->getVersion()); |
| 60 | + } |
| 61 | +} |
0 commit comments