1 | <?php |
||
9 | class StockItem extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb |
||
10 | { |
||
11 | const BULK_INSERT_CHUNK_SIZE = 100; |
||
12 | |||
13 | /** |
||
14 | * @var \Magento\Framework\EntityManager\EntityManager |
||
15 | */ |
||
16 | protected $entityManager; |
||
17 | |||
18 | /** |
||
19 | * Gets the amount of items available on stock. |
||
20 | * |
||
21 | * @param string|string[] $eans |
||
22 | * @return array|string |
||
23 | */ |
||
24 | 2 | public function getNotReservedStockAmount($eans) |
|
45 | |||
46 | /** |
||
47 | * Updates the amount of items available on stock for given EAN. |
||
48 | * |
||
49 | * @param string $ean |
||
50 | * @param float $amount |
||
51 | * @param string $operation |
||
52 | * @return bool |
||
53 | */ |
||
54 | 4 | public function updateStockAmount($ean, $amount, $operation = '-') |
|
72 | |||
73 | /** |
||
74 | * Gets the modification date of the last modified item in the stock. |
||
75 | * |
||
76 | * @return \DateTime|null |
||
77 | */ |
||
78 | 3 | public function getLastModifiedItemDate() |
|
91 | |||
92 | /** |
||
93 | * Updates the local stock based on given Stockbase API response. |
||
94 | * |
||
95 | * @param \stdClass $stock |
||
96 | * @return int |
||
97 | */ |
||
98 | 2 | public function updateFromStockObject(\stdClass $stock) |
|
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | 11 | protected function _construct() |
|
135 | |||
136 | /** |
||
137 | * @param array $data |
||
138 | * @throws \Exception |
||
139 | */ |
||
140 | 1 | protected function bulkUpdate(array $data) |
|
154 | } |
||
155 |