1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Map.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Socialnetwork\Control\Mapper\Attribute
;
6
7
use
Attribute
;
8
use
Bitrix\Main\ArgumentException
;
9
use
Bitrix\Socialnetwork\Control\Mapper\Field\ValueMapperInterface
;
10
11
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
12
class
Map
13
{
14
protected
string
$fieldNewName
;
15
protected
?
ValueMapperInterface
$valueMapper
=
null
;
16
20
public
function
__construct
(
21
string
$fieldNewName
,
22
?
string
$valueMapperClass =
null
23
)
24
{
25
if
($valueMapperClass !==
null
)
26
{
27
if
(!is_subclass_of($valueMapperClass, ValueMapperInterface::class))
28
{
29
throw
new
ArgumentException
(
'Wrong value mapper class'
);
30
}
31
32
$this->valueMapper =
new
$valueMapperClass();
33
}
34
35
$this->fieldNewName =
$fieldNewName
;
36
}
37
38
public
function
getNameAndValue
(mixed
$propertyValue
):
array
39
{
40
if
($this->valueMapper !==
null
)
41
{
42
$propertyValue
= $this->valueMapper->getValue(
$propertyValue
);
43
}
44
45
return
[
$this->fieldNewName
,
$propertyValue
];
46
}
47
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Socialnetwork\Control\Mapper\Attribute\Map
Определения
Map.php:13
Bitrix\Socialnetwork\Control\Mapper\Attribute\Map\$valueMapper
ValueMapperInterface $valueMapper
Определения
Map.php:15
Bitrix\Socialnetwork\Control\Mapper\Attribute\Map\__construct
__construct(string $fieldNewName, ?string $valueMapperClass=null)
Определения
Map.php:20
Bitrix\Socialnetwork\Control\Mapper\Attribute\Map\$fieldNewName
string $fieldNewName
Определения
Map.php:14
Bitrix\Socialnetwork\Control\Mapper\Attribute\Map\getNameAndValue
getNameAndValue(mixed $propertyValue)
Определения
Map.php:38
$propertyValue
</td ></tr ></table ></td ></tr ><?endif?><? $propertyIndex=0;foreach( $arGlobalProperties as $propertyCode=> $propertyValue
Определения
file_new.php:729
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Socialnetwork\Control\Mapper\Field\ValueMapperInterface
Определения
ValueMapperInterface.php:6
Bitrix\Socialnetwork\Control\Mapper\Attribute
Определения
Map.php:5
bitrix
modules
socialnetwork
lib
Control
Mapper
Attribute
Map.php
Создано системой
1.14.0