Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
catalogstore.php
1
<?php
7
namespace
Bitrix\Iblock\Template\Entity
;
8
9
class
CatalogStore
extends
Base
10
{
14
public
function
__construct
($id)
15
{
16
parent::__construct($id);
17
$this->fieldMap = array(
18
"name"
=>
"TITLE"
,
19
//not accessible from template engine
20
"ID"
=>
"ID"
,
21
);
22
}
23
31
public
function
resolve
($entity)
32
{
33
if
(intval($entity) > 0)
34
{
35
if
(\
Bitrix
\Main\Loader::includeModule(
'catalog'
))
36
return
new
CatalogStore
(intval($entity));
37
}
38
return
parent::resolve($entity);
39
}
40
48
public
function
setFields
(array $fields)
49
{
50
parent::setFields($fields);
51
if
(
52
is_array($this->fields)
53
//&& $this->fields["MEASURE"] > 0
54
)
55
{
56
//$this->fields["MEASURE"] = new ElementCatalogMeasure($this->fields["MEASURE"]);
57
//TODO
58
}
59
}
60
67
protected
function
loadFromDatabase
()
68
{
69
if
(!isset($this->fields) && ($this->
id
> 0))
70
{
71
$storeList = \CCatalogStore::getList(array(), array(
72
"ID"
=> $this->
id
,
73
),
false
,
false
, array(
"ID"
,
"TITLE"
));
74
$this->fields = $storeList->fetch();
75
}
76
return
is_array($this->fields);
77
}
78
}
Bitrix\Catalog\Product\Store\DistributionStrategy\Base
Definition
base.php:21
Bitrix\Iblock\Template\Entity\CatalogStore
Definition
catalogstore.php:10
Bitrix\Iblock\Template\Entity\CatalogStore\__construct
__construct($id)
Definition
catalogstore.php:14
Bitrix\Iblock\Template\Entity\CatalogStore\loadFromDatabase
loadFromDatabase()
Definition
catalogstore.php:67
Bitrix\Iblock\Template\Entity\CatalogStore\resolve
resolve($entity)
Definition
catalogstore.php:31
Bitrix\Iblock\Template\Entity\CatalogStore\setFields
setFields(array $fields)
Definition
catalogstore.php:48
Bitrix\Iblock\Template\Entity
Definition
base.php:7
Bitrix
modules
iblock
lib
template
entity
catalogstore.php
Создано системой
1.10.0