Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
MultiplyAction.php
1
<?php
2
3
namespace
Bitrix\Landing\History\Action
;
4
5
use
Bitrix\Landing\Block
;
6
use
Bitrix\Landing\History\ActionFactory
;
7
use
Bitrix\Landing\Node
;
8
use
Bitrix\Main\Web\Json
;
9
10
class
MultiplyAction
extends
BaseAction
11
{
12
protected
const
JS_COMMAND
=
'multiply'
;
13
14
public
function
execute
(
bool
$undo =
true
): bool
15
{
16
foreach
($this->params as $param)
17
{
18
if
(is_array($param) && $param[
'ACTION'
] && $param[
'ACTION_PARAMS'
])
19
{
20
$action =
ActionFactory::getAction
($param[
'ACTION'
], $undo);
21
if
($action)
22
{
23
$action->setParams($param[
'ACTION_PARAMS'
],
true
);
24
$action->execute($undo);
25
}
26
}
27
}
28
29
return
true
;
30
}
31
32
public
static
function
enrichParams
(array
$params
): array
33
{
34
return
$params
;
35
}
36
41
public
function
getJsCommand
(
bool
$undo =
true
): array
42
{
43
$command = parent::getJsCommand($undo);
44
$command[
'params'
] = [];
45
46
foreach
($this->params as $param)
47
{
48
if
(is_array($param) && $param[
'ACTION'
] && $param[
'ACTION_PARAMS'
])
49
{
50
$action =
ActionFactory::getAction
($param[
'ACTION'
], $undo);
51
if
($action)
52
{
53
$action->setParams($param[
'ACTION_PARAMS'
],
true
);
54
$command[
'params'
][] = $action->getJsCommand($undo);
55
}
56
}
57
}
58
59
return
$command;
60
}
61
}
Bitrix\Landing\History\Action\BaseAction
Definition
BaseAction.php:5
Bitrix\Landing\History\Action\BaseAction\$params
array $params
Definition
BaseAction.php:7
Bitrix\Landing\History\Action\MultiplyAction
Definition
MultiplyAction.php:11
Bitrix\Landing\History\Action\MultiplyAction\getJsCommand
getJsCommand(bool $undo=true)
Definition
MultiplyAction.php:41
Bitrix\Landing\History\Action\MultiplyAction\enrichParams
static enrichParams(array $params)
Definition
MultiplyAction.php:32
Bitrix\Landing\History\Action\MultiplyAction\execute
execute(bool $undo=true)
Definition
MultiplyAction.php:14
Bitrix\Landing\History\Action\MultiplyAction\JS_COMMAND
const JS_COMMAND
Definition
MultiplyAction.php:12
Bitrix\Landing\History\ActionFactory
Definition
ActionFactory.php:32
Bitrix\Landing\History\ActionFactory\getAction
static getAction(string $actionName, ?bool $undo=false)
Definition
ActionFactory.php:129
Bitrix\Main\Web\Json
Definition
json.php:11
Bitrix\Landing\Block
Definition
cache.php:2
Bitrix\Landing\History\Action
Definition
AddBlockAction.php:3
Bitrix\Landing\Node
Definition
component.php:2
modules
landing
lib
History
Action
MultiplyAction.php
Создано системой
1.10.0