Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views / src / Ajax / HighlightCommand.php
1 <?php
2
3 namespace Drupal\views\Ajax;
4
5 use Drupal\Core\Ajax\CommandInterface;
6
7 /**
8  * Provides an AJAX command for highlighting a certain new piece of html.
9  *
10  * This command is implemented in Drupal.AjaxCommands.prototype.viewsHighlight.
11  */
12 class HighlightCommand implements CommandInterface {
13
14   /**
15    * A CSS selector string.
16    *
17    * @var string
18    */
19   protected $selector;
20
21   /**
22    * Constructs a \Drupal\views\Ajax\HighlightCommand object.
23    *
24    * @param string $selector
25    *   A CSS selector.
26    */
27   public function __construct($selector) {
28     $this->selector = $selector;
29   }
30
31   /**
32    * {@inheritdoc}
33    */
34   public function render() {
35     return [
36       'command' => 'viewsHighlight',
37       'selector' => $this->selector,
38     ];
39   }
40
41 }