Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
composition.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Controller\Livefeed\Spaces
;
4
5
use
Bitrix\Main\Engine\AutoWire\BinderArgumentException
;
6
use
Bitrix\Main\Engine\AutoWire\ExactParameter
;
7
use
Bitrix\Main\Engine\Controller
;
8
use
Bitrix\Main\Engine\CurrentUser
;
9
use \Bitrix\Socialnetwork\Space\Toolbar;
10
11
class
Composition
extends
Controller
12
{
13
private
int
$userId;
14
18
public
function
getAutoWiredParameters
(): array
19
{
20
return
[
21
new
ExactParameter
(
22
Toolbar\Composition::class,
23
'composition'
,
24
fn ($className, $composition): Toolbar\Composition =>
new
$className($this->userId, $composition),
25
),
26
];
27
}
28
32
public
function
setSettingsAction
(Toolbar\
Composition
$composition, array $settings = []): ?array
33
{
34
$result = $composition->setSettings($settings);
35
if
(!$result->isSuccess())
36
{
37
$this->
addErrors
($result->getErrors());
38
return
null
;
39
}
40
41
return
[
42
'settings'
=> $composition->getSettings(
false
),
43
];
44
}
45
49
public
function
getSettingsAction
(Toolbar\
Composition
$composition): ?array
50
{
51
return
[
52
'settings'
=> $composition->getSettings(
false
),
53
];
54
}
55
56
protected
function
init
(): void
57
{
58
parent::init();
59
$this->userId = CurrentUser::get()->getId();
60
}
61
}
Bitrix\Main\Engine\AutoWire\BinderArgumentException
Definition
binderargumentexception.php:9
Bitrix\Main\Engine\AutoWire\ExactParameter
Definition
exactparameter.php:9
Bitrix\Main\Engine\Controller
Definition
controller.php:32
Bitrix\Main\Engine\Controller\addErrors
addErrors(array $errors)
Definition
controller.php:1064
Bitrix\Main\Engine\CurrentUser
Definition
currentuser.php:8
Bitrix\Socialnetwork\Controller\Livefeed\Spaces\Composition
Definition
composition.php:12
Bitrix\Socialnetwork\Controller\Livefeed\Spaces\Composition\setSettingsAction
setSettingsAction(Toolbar\Composition $composition, array $settings=[])
Definition
composition.php:32
Bitrix\Socialnetwork\Controller\Livefeed\Spaces\Composition\getAutoWiredParameters
getAutoWiredParameters()
Definition
composition.php:18
Bitrix\Socialnetwork\Controller\Livefeed\Spaces\Composition\init
init()
Definition
composition.php:56
Bitrix\Socialnetwork\Controller\Livefeed\Spaces\Composition\getSettingsAction
getSettingsAction(Toolbar\Composition $composition)
Definition
composition.php:49
Bitrix\Sender\Internals\QueryController
Definition
action.php:8
Bitrix\Socialnetwork\Controller\Livefeed\Spaces
Definition
composition.php:3
modules
socialnetwork
lib
controller
livefeed
spaces
composition.php
Создано системой
1.10.0