Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
storeinfo.php
1
<?php
2
3
namespace
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store
;
4
5
6
use
Bitrix\Catalog\StoreTable
;
7
use
Bitrix\Main\Localization\Loc
;
8
9
abstract
class
StoreInfo
10
{
11
private
static
array $storeNameList = [];
12
13
private
int
$storeId;
14
15
public
function
__construct
(
int
$storeId)
16
{
17
$this->storeId = $storeId;
18
}
19
20
public
function
getStoreId
(): int
21
{
22
return
$this->storeId;
23
}
24
31
public
function
getStoreName
(): string
32
{
33
if
(!isset(self::$storeNameList[$this->storeId]))
34
{
35
self::loadStoreName
($this->storeId);
36
}
37
38
return
self::$storeNameList[$this->storeId];
39
}
40
49
public
static
function
loadStoreName
(
int
...$storeIds): void
50
{
51
$storeNamesData = StoreTable::getList([
52
'select'
=> [
'ID'
,
'TITLE'
],
53
'filter'
=> [
'=ID'
=> $storeIds],
54
])->fetchAll();
55
56
foreach
($storeIds as $storeId)
57
{
58
if
(!isset(self::$storeNameList[$storeId]))
59
{
60
self::setStoreName
($storeId,
Loc::getMessage
(
'STORE_INFO_DEFAULT_STORE_NAME'
));
61
}
62
}
63
64
foreach
($storeNamesData as $storeNameData)
65
{
66
if
(!empty($storeNameData[
'TITLE'
]))
67
{
68
self::setStoreName
($storeNameData[
'ID'
], $storeNameData[
'TITLE'
]);
69
}
70
}
71
}
72
73
public
static
function
setStoreName
(
int
$storeId,
string
$storeName): void
74
{
75
self::$storeNameList[$storeId] = $storeName;
76
}
77
82
abstract
public
function
getCalculatedSumPrice
(): float;
83
}
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo
Definition
storeinfo.php:10
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\getStoreId
getStoreId()
Definition
storeinfo.php:20
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\getCalculatedSumPrice
getCalculatedSumPrice()
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\loadStoreName
static loadStoreName(int ... $storeIds)
Definition
storeinfo.php:49
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\setStoreName
static setStoreName(int $storeId, string $storeName)
Definition
storeinfo.php:73
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\__construct
__construct(int $storeId)
Definition
storeinfo.php:15
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\getStoreName
getStoreName()
Definition
storeinfo.php:31
Bitrix\Catalog\StoreTable
Definition
store.php:55
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store
Definition
storeinfo.php:3
modules
catalog
lib
integration
report
storestock
entity
store
storeinfo.php
Создано системой
1.10.0