You are here

public function Key::setPlugin in Key 8

Sets a plugin of the requested type and plugin ID.

Parameters

string $type: The plugin type.

string $id: The plugin ID.

Overrides KeyInterface::setPlugin

File

src/Entity/Key.php, line 178

Class

Key
Defines the Key entity.

Namespace

Drupal\key\Entity

Code

public function setPlugin($type, $id) {
  $this->{$type} = $id;
  $this
    ->getPluginCollection($type)
    ->addInstanceId($id);
}