
| Current Path : /var/www/html/ift/web/core/lib/Drupal/Core/Plugin/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/ift/web/core/lib/Drupal/Core/Plugin/PluginWithFormsTrait.php |
<?php
namespace Drupal\Core\Plugin;
/**
* Provides a trait with typical behavior for plugins which have forms.
*/
trait PluginWithFormsTrait {
/**
* {@inheritdoc}
*/
public function getFormClass($operation) {
if (isset($this->getPluginDefinition()['forms'][$operation])) {
return $this->getPluginDefinition()['forms'][$operation];
}
elseif ($operation === 'configure' && $this instanceof PluginFormInterface) {
return static::class;
}
}
/**
* {@inheritdoc}
*/
public function hasFormClass($operation) {
return !empty($this->getFormClass($operation));
}
}