Mercurial > hg > isophonics-drupal-site
comparison core/modules/toolbar/src/Ajax/SetSubtreesCommand.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\toolbar\Ajax; | |
4 | |
5 use Drupal\Core\Ajax\CommandInterface; | |
6 | |
7 /** | |
8 * Defines an AJAX command that sets the toolbar subtrees. | |
9 */ | |
10 class SetSubtreesCommand implements CommandInterface { | |
11 | |
12 /** | |
13 * The toolbar subtrees. | |
14 * | |
15 * @var array | |
16 */ | |
17 protected $subtrees; | |
18 | |
19 /** | |
20 * Constructs a SetSubtreesCommand object. | |
21 * | |
22 * @param array $subtrees | |
23 * The toolbar subtrees that will be set. | |
24 */ | |
25 public function __construct($subtrees) { | |
26 $this->subtrees = $subtrees; | |
27 } | |
28 | |
29 /** | |
30 * {@inheritdoc} | |
31 */ | |
32 public function render() { | |
33 return [ | |
34 'command' => 'setToolbarSubtrees', | |
35 'subtrees' => array_map('strval', $this->subtrees), | |
36 ]; | |
37 } | |
38 | |
39 } |