Mercurial > hg > isophonics-drupal-site
view core/modules/toolbar/src/Ajax/SetSubtreesCommand.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Drupal\toolbar\Ajax; use Drupal\Core\Ajax\CommandInterface; /** * Defines an AJAX command that sets the toolbar subtrees. */ class SetSubtreesCommand implements CommandInterface { /** * The toolbar subtrees. * * @var array */ protected $subtrees; /** * Constructs a SetSubtreesCommand object. * * @param array $subtrees * The toolbar subtrees that will be set. */ public function __construct($subtrees) { $this->subtrees = $subtrees; } /** * {@inheritdoc} */ public function render() { return [ 'command' => 'setToolbarSubtrees', 'subtrees' => array_map('strval', $this->subtrees), ]; } }