ValueUpdatedCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A render() 0 6 1
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