class AddParagraphTypeCommand in Paragraphs Browser 8
AJAX command to trigger related paragraph add on host form.
Hierarchy
- class \Drupal\paragraphs_browser\Ajax\AddParagraphTypeCommand implements CommandInterface
Expanded class hierarchy of AddParagraphTypeCommand
1 file declares its use of AddParagraphTypeCommand
File
- src/
Ajax/ AddParagraphTypeCommand.php, line 10
Namespace
Drupal\paragraphs_browser\AjaxView source
class AddParagraphTypeCommand implements CommandInterface {
/**
* A unique identifier.
*
* @var string
*/
protected $uuid;
/**
* A paragraphs bundle name.
*
* @var array
*/
protected $paragraph_type;
/**
* Constructs a \Drupal\entity_browser\Ajax\AddParagraphTypeCommand object.
*
* @param string $uuid
* Entity browser instance UUID.
* @param array $paragraph_type
* The type of paragraph that was selected.
*/
public function __construct($uuid, $paragraph_type) {
$this->uuid = $uuid;
$this->paragraph_type = $paragraph_type;
}
/**
* Implements \Drupal\Core\Ajax\CommandInterface::render().
*/
public function render() {
return [
'command' => 'paragraphs_browser_add_paragraph',
'uuid' => $this->uuid,
'paragraph_type' => $this->paragraph_type,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AddParagraphTypeCommand:: |
protected | property | A paragraphs bundle name. | |
AddParagraphTypeCommand:: |
protected | property | A unique identifier. | |
AddParagraphTypeCommand:: |
public | function |
Implements \Drupal\Core\Ajax\CommandInterface::render(). Overrides CommandInterface:: |
|
AddParagraphTypeCommand:: |
public | function | Constructs a \Drupal\entity_browser\Ajax\AddParagraphTypeCommand object. |