ValueUpdatedCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\entity_browser\Ajax;
4
5
use Drupal\Core\Ajax\CommandInterface;
6
7
/**
8
 * AJAX command to refresh an entity_browser_entity_reference field widget.
9
 */
10
class ValueUpdatedCommand implements CommandInterface {
11
12
  /**
13
   * The ID for the details element.
14
   *
15
   * @var string
16
   */
17
  protected $details_id;
18
19
  /**
20
   * Constructor.
21
   *
22
   * @param string $details_id
23
   *   The ID for the details element.
24
   */
25
  public function __construct($details_id) {
26
    $this->details_id = $details_id;
27
  }
28
29
  /**
30
   * {@inheritdoc}
31
   */
32
  public function render() {
33
    return [
34
      'command' => 'entity_browser_value_updated',
35
      'details_id' => $this->details_id,
36
    ];
37
  }
38
39
}
40