1 | <?php |
||
16 | class TransactionalCommand extends AbstractCommand implements |
||
17 | \IteratorAggregate, |
||
18 | ContextualCommandInterface |
||
19 | { |
||
20 | /** |
||
21 | * Nested commands. |
||
22 | * |
||
23 | * @var CommandInterface[] |
||
24 | */ |
||
25 | private $commands = []; |
||
26 | |||
27 | /** |
||
28 | * @var ContextualCommandInterface |
||
29 | */ |
||
30 | private $leadingCommand; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function addCommand(CommandInterface $command, bool $leading = false) |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function getContext(): array |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function addContext(string $name, $value) |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function getLeading(): ContextualCommandInterface |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function getIterator() |
||
101 | } |
||
102 |