Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
inventorymanagementsourcebuilder.php
1
<?php
2
3
namespace
Bitrix\Catalog\Url
;
4
5
class
InventoryManagementSourceBuilder
6
{
7
private
const
INVENTORY_MANAGEMENT_SOURCE_PARAM_NAME =
'inventoryManagementSource'
;
8
9
private
static
?
InventoryManagementSourceBuilder
$instance =
null
;
10
private
?
string
$inventoryManagementSource;
11
12
public
static
function
getInstance
():
InventoryManagementSourceBuilder
13
{
14
if
(!self::$instance)
15
{
16
self::$instance =
new
self
();
17
}
18
19
return
self::$instance;
20
}
21
22
public
function
__construct
()
23
{
24
$param =
25
\Bitrix\Main\Context::getCurrent()
26
->getRequest()
27
->get(self::INVENTORY_MANAGEMENT_SOURCE_PARAM_NAME)
28
;
29
30
$this->inventoryManagementSource = $param ? urlencode((
string
)$param) :
null
;
31
}
32
38
public
function
getInventoryManagementSource
(): ?string
39
{
40
return
$this->inventoryManagementSource;
41
}
42
49
public
function
addInventoryManagementSourceParam
(
string
$uri): string
50
{
51
if
(!$this->inventoryManagementSource)
52
{
53
return
$uri;
54
}
55
56
$uriEntity = new \Bitrix\Main\Web\Uri($uri);
57
$uriEntity->addParams([self::INVENTORY_MANAGEMENT_SOURCE_PARAM_NAME => $this->inventoryManagementSource]);
58
59
return
$uriEntity->getUri();
60
}
61
}
Bitrix\Catalog\Url\InventoryManagementSourceBuilder
Definition
inventorymanagementsourcebuilder.php:6
Bitrix\Catalog\Url\InventoryManagementSourceBuilder\__construct
__construct()
Definition
inventorymanagementsourcebuilder.php:22
Bitrix\Catalog\Url\InventoryManagementSourceBuilder\getInventoryManagementSource
getInventoryManagementSource()
Definition
inventorymanagementsourcebuilder.php:38
Bitrix\Catalog\Url\InventoryManagementSourceBuilder\addInventoryManagementSourceParam
addInventoryManagementSourceParam(string $uri)
Definition
inventorymanagementsourcebuilder.php:49
Bitrix\Catalog\Url\InventoryManagementSourceBuilder\getInstance
static getInstance()
Definition
inventorymanagementsourcebuilder.php:12
Bitrix\Catalog\Url
modules
catalog
lib
url
inventorymanagementsourcebuilder.php
Создано системой
1.10.0