1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Map.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
7use Attribute;
10
11#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
12class Map
13{
14 protected string $fieldNewName;
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
46 }
47}
ValueMapperInterface $valueMapper
Определения Map.php:15
__construct(string $fieldNewName, ?string $valueMapperClass=null)
Определения Map.php:20
getNameAndValue(mixed $propertyValue)
Определения Map.php:38
</td ></tr ></table ></td ></tr ><?endif?><? $propertyIndex=0;foreach( $arGlobalProperties as $propertyCode=> $propertyValue
Определения file_new.php:729
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804