1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
MaskImportPersonal.php
См. документацию.
1
<?php
2
namespace
Bitrix\UI\Integration\Rest;
3
4
use Bitrix\Main\Error;
5
use Bitrix\UI\Avatar;
6
7
class
MaskImportPersonal
extends
ImportStep
8
{
9
protected
int
$ownerId
;
10
protected
Avatar\Mask\Owner\DefaultOwner
$owner
;
11
12
public
function
init
(
$event
): void
13
{
14
$this->ownerId = (int)
$event
->getParameter(
'USER_ID'
);
15
if
($this->ownerId <= 0)
16
{
17
$this->errorCollection->setError(
new
Error
(
'User owner is not set'
));
18
return
;
19
}
20
$this->owner =
new
Avatar\Mask\Owner\User
($this->ownerId);
21
}
22
23
public
function
makeAStep
(): void
24
{
25
foreach
($this->data as
$res
)
26
{
27
$fileInfo = $this->structure->getUnpackFile((
int
)
$res
[
'FILE_ID'
]);
28
$file = !empty($fileInfo[
'PATH'
]) ? \CFile::makeFileArray($fileInfo[
'PATH'
]) :
null
;
29
$file[
'name'
] = $fileInfo[
'NAME'
];
30
if
($file)
31
{
32
$result
=
Avatar\Mask\Item::create
(
33
$this->owner,
34
$file,
35
[
36
'TITLE'
=>
$res
[
'TITLE'
],
37
'DESCRIPTION'
=>
$res
[
'DESCRIPTION'
],
38
'ACCESS_CODE'
=> $this->owner->getDefaultAccess()
39
]
40
);
41
if
(!
$result
->isSuccess())
42
{
43
$this->errorCollection->add(
$result
->getErrors());
44
}
45
}
46
}
47
}
48
}
Bitrix\Main\Error
Определения
error.php:15
Bitrix\UI\Avatar\Mask\Item\create
static create(Owner\DefaultOwner $owner, array $file, ?array $descriptionParams=[])
Определения
Item.php:152
Bitrix\UI\Avatar\Mask\Owner\DefaultOwner
Определения
DefaultOwner.php:8
Bitrix\UI\Avatar\Mask\Owner\User
Определения
User.php:8
Bitrix\UI\Integration\Rest\ImportStep
Определения
ImportStep.php:8
Bitrix\UI\Integration\Rest\MaskImportPersonal
Определения
MaskImportPersonal.php:8
Bitrix\UI\Integration\Rest\MaskImportPersonal\$ownerId
int $ownerId
Определения
MaskImportPersonal.php:9
Bitrix\UI\Integration\Rest\MaskImportPersonal\$owner
Avatar Mask Owner DefaultOwner $owner
Определения
MaskImportPersonal.php:10
Bitrix\UI\Integration\Rest\MaskImportPersonal\init
init($event)
Определения
MaskImportPersonal.php:12
Bitrix\UI\Integration\Rest\MaskImportPersonal\makeAStep
makeAStep()
Определения
MaskImportPersonal.php:23
$res
$res
Определения
filter_act.php:7
$result
$result
Определения
get_property_values.php:14
$event
$event
Определения
prolog_after.php:141
bitrix
modules
ui
lib
Integration
Rest
MaskImportPersonal.php
Создано системой
1.14.0