1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
elementbatchitem.php
См. документацию.
1
<?php
2
namespace
Bitrix\Catalog\Product\Store\BatchBalancer\Entity
;
3
4
use
Bitrix\Catalog\EO_StoreBatch_Collection
;
5
use
Bitrix\Catalog\EO_StoreBatchDocumentElement
;
6
use
Bitrix\Catalog\StoreDocumentElementTable
;
7
use
Bitrix\Catalog\StoreDocumentTable
;
8
use
Bitrix\Catalog\StoreBatchTable
;
9
use
Bitrix\Currency\CurrencyManager
;
10
use
Bitrix\Main\ArgumentException
;
11
use
Bitrix\Main\Error
;
12
use
Bitrix\Main\Loader
;
13
use
Bitrix\Main\ObjectPropertyException
;
14
use
Bitrix\Main\Result
;
15
use
Bitrix\Main\SystemException
;
16
use
Bitrix\Sale\Internals\ShipmentItemStoreTable
;
17
use phpDocumentor\Reflection\Types\Boolean;
18
24
class
ElementBatchItem
implements
InventoryTreeItem
25
{
26
private
EO_StoreBatchDocumentElement
$bindingElement;
27
private
int
$storeId;
28
private
string
$storeItemHash;
29
30
public
function
__construct
(
EO_StoreBatchDocumentElement
$bindingElement,
int
$storeId)
31
{
32
$this->bindingElement = $bindingElement;
33
34
$this->storeId = $storeId;
35
}
36
37
public
function
getElement
():
EO_StoreBatchDocumentElement
38
{
39
return
$this->bindingElement;
40
}
41
42
public
function
isArrivalElement
(): bool
43
{
44
return
$this->bindingElement->getAmount() > 0;
45
}
46
47
public
function
getStoreId
(): int
48
{
49
return
$this->storeId;
50
}
51
52
public
function
setStoreItemHash
(
string
$storeItemHash): void
53
{
54
$this->storeItemHash = $storeItemHash;
55
}
56
57
public
function
getStoreItemHash
(): string
58
{
59
return
$this->storeItemHash;
60
}
61
62
public
function
getAmount
(): float
63
{
64
return
abs($this->bindingElement->getAmount());
65
}
66
67
public
function
save
():
Result
68
{
69
if
(empty($this->bindingElement->getProductBatchId()))
70
{
71
$result
=
new
Result
();
72
$result
->addError(
new
Error
(
'Empty store batch'
));
73
74
return
$result
;
75
}
76
77
return
$this->bindingElement->save();
78
}
79
}
Bitrix\Catalog\EO_StoreBatch_Collection
Определения
orm.php:8000
Bitrix\Catalog\EO_StoreBatchDocumentElement
Определения
orm.php:6631
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem
Определения
elementbatchitem.php:25
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\getStoreId
getStoreId()
Определения
elementbatchitem.php:47
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\getStoreItemHash
getStoreItemHash()
Определения
elementbatchitem.php:57
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\getAmount
getAmount()
Определения
elementbatchitem.php:62
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\setStoreItemHash
setStoreItemHash(string $storeItemHash)
Определения
elementbatchitem.php:52
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\__construct
__construct(EO_StoreBatchDocumentElement $bindingElement, int $storeId)
Определения
elementbatchitem.php:30
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\getElement
getElement()
Определения
elementbatchitem.php:37
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\save
save()
Определения
elementbatchitem.php:67
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\ElementBatchItem\isArrivalElement
isArrivalElement()
Определения
elementbatchitem.php:42
Bitrix\Catalog\StoreBatchTable
Определения
storebatchtable.php:27
Bitrix\Catalog\StoreDocumentElementTable
Определения
storedocumentelementtable.php:50
Bitrix\Catalog\StoreDocumentTable
Определения
storedocumenttable.php:64
Bitrix\Currency\CurrencyManager
Определения
currencymanager.php:16
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\Loader
Определения
loader.php:13
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
Bitrix\Main\ObjectPropertyException
Определения
ObjectPropertyException.php:9
Bitrix\Main\SystemException
Определения
SystemException.php:9
Bitrix\Sale\Internals\ShipmentItemStoreTable
Определения
shipmentitemstore.php:41
$result
$result
Определения
get_property_values.php:14
Bitrix\Catalog\Product\Store\BatchBalancer\Entity\InventoryTreeItem
Определения
inventorytreeitem.php:12
Bitrix\Catalog\Product\Store\BatchBalancer\Entity
Определения
elementbatchitem.php:2
bitrix
modules
catalog
lib
product
store
batchbalancer
entity
elementbatchitem.php
Создано системой
1.14.0