| @@ 184-192 (lines=9) @@ | ||
| 181 | * @param int $siteId |
|
| 182 | * @return array |
|
| 183 | */ |
|
| 184 | public function getProductsByModificationDate(\DateTimeInterface $modificationDate, int $siteId) : array |
|
| 185 | { |
|
| 186 | Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive'); |
|
| 187 | ||
| 188 | return (array)$this->master->doRequest( |
|
| 189 | 'GET', |
|
| 190 | sprintf('/admin/WEBAPI/Endpoints/v1_0/ProductService/{KEY}/ByModificationDate/%s/%d', $modificationDate->format('Y-m-d'), $siteId) |
|
| 191 | ); |
|
| 192 | } |
|
| 193 | ||
| 194 | /** |
|
| 195 | * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/ProductService/help/operations/FindProductsByProductNumbers |
|
| @@ 107-117 (lines=11) @@ | ||
| 104 | * @param array $context |
|
| 105 | * @return array |
|
| 106 | */ |
|
| 107 | public function getProductsInCategoryByMetadata(int $categoryId, array $context) : array |
|
| 108 | { |
|
| 109 | Assert::that($categoryId)->greaterThan(0, 'The $categoryId has to be positive'); |
|
| 110 | Assert::that($context)->notEmpty(); |
|
| 111 | ||
| 112 | return (array)$this->master->doRequest( |
|
| 113 | 'POST', |
|
| 114 | sprintf('/admin/WEBAPI/Endpoints/v1_0/ProductService/{KEY}/Products/%d', $categoryId), |
|
| 115 | $context |
|
| 116 | ); |
|
| 117 | } |
|
| 118 | ||
| 119 | /** |
|
| 120 | * @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/ProductService/help/operations/GetCategory |
|
| @@ 92-104 (lines=13) @@ | ||
| 89 | * @param \DateTimeInterface $dateEnd |
|
| 90 | * @return int |
|
| 91 | */ |
|
| 92 | public function countByModifiedInterval(\DateTimeInterface $dateStart, \DateTimeInterface $dateEnd) : int |
|
| 93 | { |
|
| 94 | Assert::that($dateStart)->lessThan($dateEnd, '$dateStart has to be before $dateEnd'); |
|
| 95 | ||
| 96 | return (int)$this->master->doRequest( |
|
| 97 | 'GET', |
|
| 98 | sprintf( |
|
| 99 | '/admin/WEBAPI/Endpoints/v1_0/ProductDataService/{KEY}/CountByModifiedInterval?start=%s&end=%s', |
|
| 100 | $dateStart->format('Y-m-d\TH:i:s'), |
|
| 101 | $dateEnd->format('Y-m-d\TH:i:s') |
|
| 102 | ) |
|
| 103 | ); |
|
| 104 | } |
|
| 105 | ||
| 106 | /** |
|
| 107 | * @param array|\stdClass $product |
|
| @@ 372-383 (lines=12) @@ | ||
| 369 | ); |
|
| 370 | } |
|
| 371 | ||
| 372 | protected function countDiscounts(int $siteId, string $type) : int |
|
| 373 | { |
|
| 374 | Assert::that($siteId)->greaterThan(0, '$siteId must be positive'); |
|
| 375 | Assert::that($type)->choice(self::getTypes()); |
|
| 376 | ||
| 377 | $type .= 'sCount'; |
|
| 378 | ||
| 379 | return (int)$this->master->doRequest( |
|
| 380 | 'GET', |
|
| 381 | sprintf('/admin/WEBAPI/Endpoints/v1_0/DiscountService/{KEY}/%s/%d', $type, $siteId) |
|
| 382 | ); |
|
| 383 | } |
|
| 384 | ||
| 385 | protected static function getTypes() : array |
|
| 386 | { |
|
| @@ 87-95 (lines=9) @@ | ||
| 84 | * @param int $id |
|
| 85 | * @return boolean |
|
| 86 | */ |
|
| 87 | public function deleteProductTag(int $id) : bool |
|
| 88 | { |
|
| 89 | Assert::that($id)->greaterThan(0, '$id has to be positive'); |
|
| 90 | ||
| 91 | return (bool)$this->master->doRequest( |
|
| 92 | 'DELETE', |
|
| 93 | sprintf('/admin/WEBAPI/Endpoints/v1_0/ProductTagService/{KEY}/%d', $id) |
|
| 94 | ); |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * @param string $productNumber |
|