PluginInstance.php in Plugin 8.2
File
src/Plugin/DataType/PluginInstance.php
View source
<?php
namespace Drupal\plugin\Plugin\DataType;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\TypedData\TypedData;
class PluginInstance extends TypedData {
protected $value;
public function setValue($value, $notify = TRUE) {
if (!$value instanceof PluginInspectionInterface) {
$value = NULL;
}
parent::setValue($value, $notify);
}
public function __clone() {
if ($this
->getValue()) {
$this
->setValue(clone $this->value);
}
}
}