3 namespace Drupal\toolbar\Ajax;
5 use Drupal\Core\Ajax\CommandInterface;
8 * Defines an AJAX command that sets the toolbar subtrees.
10 class SetSubtreesCommand implements CommandInterface {
13 * The toolbar subtrees.
20 * Constructs a SetSubtreesCommand object.
22 * @param array $subtrees
23 * The toolbar subtrees that will be set.
25 public function __construct($subtrees) {
26 $this->subtrees = $subtrees;
32 public function render() {
34 'command' => 'setToolbarSubtrees',
35 'subtrees' => array_map('strval', $this->subtrees),