Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Barcode.php
1
<?php
2
3
namespace
Bitrix\Catalog\v2\Barcode
;
4
5
use
Bitrix\Catalog\v2\BaseEntity
;
6
use
Bitrix\Catalog\v2\Fields\TypeCasters\MapTypeCaster
;
7
use Bitrix\Catalog\v2\HasSettingsTrait;
8
18
class
Barcode
extends
BaseEntity
19
{
20
use
HasSettingsTrait
;
21
22
public
function
__construct
(
BarcodeRepositoryContract
$repository)
23
{
24
parent::__construct($repository);
25
}
26
27
public
function
setStoreId
(
int
$storeId): self
28
{
29
$this->
setField
(
'STORE_ID'
, $storeId);
30
31
return
$this;
32
}
33
34
public
function
getStoreId
(): string
35
{
36
return
$this->
getField
(
'STORE_ID'
);
37
}
38
39
public
function
setProductId
(
int
$productId): self
40
{
41
$this->
setField
(
'PRODUCT_ID'
, $productId);
42
43
return
$this;
44
}
45
46
public
function
getProductId
(): int
47
{
48
return
(
int
)$this->
getField
(
'PRODUCT_ID'
);
49
}
50
51
public
function
setBarcode
(?
string
$barcode): self
52
{
53
$this->
setField
(
'BARCODE'
, $barcode);
54
55
return
$this;
56
}
57
58
public
function
unsetBarcode
(): self
59
{
60
return
$this->
setBarcode
(
null
);
61
}
62
63
public
function
hasBarcode
(): bool
64
{
65
return
$this->
hasField
(
'BARCODE'
);
66
}
67
68
public
function
getBarcode
(): ?string
69
{
70
return
$this->
hasBarcode
() ? (string)$this->
getField
(
'BARCODE'
) :
null
;
71
}
72
73
protected
function
getFieldsMap
(): array
74
{
75
return
[
76
'ID'
=>
MapTypeCaster::NULLABLE_INT
,
77
'PRODUCT_ID'
=>
MapTypeCaster::INT
,
78
'STORE_ID'
=>
MapTypeCaster::INT
,
79
'BARCODE'
=>
MapTypeCaster::NULLABLE_STRING
,
80
];
81
}
82
}
Bitrix\Catalog\v2\Barcode\Barcode
Definition
Barcode.php:19
Bitrix\Catalog\v2\Barcode\Barcode\getStoreId
getStoreId()
Definition
Barcode.php:34
Bitrix\Catalog\v2\Barcode\Barcode\unsetBarcode
unsetBarcode()
Definition
Barcode.php:58
Bitrix\Catalog\v2\Barcode\Barcode\getProductId
getProductId()
Definition
Barcode.php:46
Bitrix\Catalog\v2\Barcode\Barcode\setBarcode
setBarcode(?string $barcode)
Definition
Barcode.php:51
Bitrix\Catalog\v2\Barcode\Barcode\setStoreId
setStoreId(int $storeId)
Definition
Barcode.php:27
Bitrix\Catalog\v2\Barcode\Barcode\__construct
__construct(BarcodeRepositoryContract $repository)
Definition
Barcode.php:22
Bitrix\Catalog\v2\Barcode\Barcode\getBarcode
getBarcode()
Definition
Barcode.php:68
Bitrix\Catalog\v2\Barcode\Barcode\getFieldsMap
getFieldsMap()
Definition
Barcode.php:73
Bitrix\Catalog\v2\Barcode\Barcode\hasBarcode
hasBarcode()
Definition
Barcode.php:63
Bitrix\Catalog\v2\Barcode\Barcode\setProductId
setProductId(int $productId)
Definition
Barcode.php:39
Bitrix\Catalog\v2\BaseEntity
Definition
BaseEntity.php:22
Bitrix\Catalog\v2\BaseEntity\hasField
hasField(string $name)
Definition
BaseEntity.php:114
Bitrix\Catalog\v2\BaseEntity\setField
setField(string $name, $value)
Definition
BaseEntity.php:102
Bitrix\Catalog\v2\BaseEntity\getField
getField(string $name)
Definition
BaseEntity.php:119
Bitrix\Catalog\v2\Fields\TypeCasters\MapTypeCaster
Definition
MapTypeCaster.php:20
Bitrix\Catalog\v2\Fields\TypeCasters\MapTypeCaster\NULLABLE_STRING
const NULLABLE_STRING
Definition
MapTypeCaster.php:24
Bitrix\Catalog\v2\Fields\TypeCasters\MapTypeCaster\NULLABLE_INT
const NULLABLE_INT
Definition
MapTypeCaster.php:27
Bitrix\Catalog\v2\Fields\TypeCasters\MapTypeCaster\INT
const INT
Definition
MapTypeCaster.php:26
Bitrix\Catalog\v2\Barcode\BarcodeRepositoryContract
Definition
BarcodeRepositoryContract.php:18
Bitrix\Catalog\v2\Barcode
Definition
Barcode.php:3
Bitrix\Catalog\v2\HasSettingsTrait
trait HasSettingsTrait
Definition
HasSettingsTrait.php:8
modules
catalog
lib
v2
Barcode
Barcode.php
Создано системой
1.10.0