1 | <?php |
||
15 | class StockbaseClient |
||
16 | { |
||
17 | const STOCKBASE_STOCK_ENDPOINT = 'stockbase_stock'; |
||
18 | const STOCKBASE_IMAGES_ENDPOINT = 'stockbase_images'; |
||
19 | const STOCKBASE_ORDER_REQUEST_ENDPOINT = 'stockbase_orderrequest'; |
||
20 | |||
21 | /** |
||
22 | * @var DivideIQ |
||
23 | */ |
||
24 | private $divideIqClient; |
||
25 | |||
26 | /** |
||
27 | * @var StockbaseConfiguration |
||
28 | */ |
||
29 | private $stockbaseConfiguration; |
||
30 | |||
31 | /** |
||
32 | * StockbaseClient constructor. |
||
33 | * @param DivideIQ $divideIqClient |
||
34 | * @param StockbaseConfiguration $stockbaseConfiguration |
||
35 | */ |
||
36 | 4 | public function __construct( |
|
43 | |||
44 | /** |
||
45 | * Gets current Stockbase stock state. |
||
46 | * |
||
47 | * @param \DateTime|null $since |
||
48 | * @param \DateTime|null $until |
||
49 | * @return object |
||
50 | * @throws \Exception |
||
51 | */ |
||
52 | 1 | public function getStock(\DateTime $since = null, \DateTime $until = null) |
|
64 | |||
65 | /** |
||
66 | * Gets images for specified EANs. |
||
67 | * |
||
68 | * @param string[] $eans |
||
69 | * @return object |
||
70 | * @throws \Exception |
||
71 | */ |
||
72 | 1 | public function getImages(array $eans) |
|
82 | |||
83 | /** |
||
84 | * Downloads a file using current client configuration and saves it at the specified destination. |
||
85 | * |
||
86 | * @param string|\GuzzleHttp\Url $uri File URI. |
||
87 | * @param string|resource|\GuzzleHttp\Stream\StreamInterface $destination Destination where the file should be saved to. |
||
88 | */ |
||
89 | public function downloadImage($uri, $destination) |
||
93 | |||
94 | /** |
||
95 | * Creates an order on Stockbase from reserved items for specified Magento order. |
||
96 | * |
||
97 | * @param OrderInterface $order |
||
98 | * @param StockItemReserve[] $reservedStockbaseItems |
||
99 | * @return object |
||
100 | * @throws \Exception |
||
101 | */ |
||
102 | 2 | public function createOrder(OrderInterface $order, array $reservedStockbaseItems) |
|
161 | } |
||
162 |