PluginWithFormsTrait.php in Drupal 8
File
core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php
View source
<?php
namespace Drupal\Core\Plugin;
trait PluginWithFormsTrait {
public function getFormClass($operation) {
if (isset($this
->getPluginDefinition()['forms'][$operation])) {
return $this
->getPluginDefinition()['forms'][$operation];
}
elseif ($operation === 'configure' && $this instanceof PluginFormInterface) {
return static::class;
}
}
public function hasFormClass($operation) {
return !empty($this
->getFormClass($operation));
}
}