class PlainTextEditor
Same name in other branches
- 9 core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor
Defines the plain text in-place editor.
Plugin annotation
@InPlaceEditor(
id = "plain_text"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\quickedit\Plugin\InPlaceEditorBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\quickedit\Plugin\InPlaceEditorInterface
- class \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor extends \Drupal\quickedit\Plugin\InPlaceEditorBase
- class \Drupal\quickedit\Plugin\InPlaceEditorBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\quickedit\Plugin\InPlaceEditorInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of PlainTextEditor
File
-
core/
modules/ quickedit/ src/ Plugin/ InPlaceEditor/ PlainTextEditor.php, line 15
Namespace
Drupal\quickedit\Plugin\InPlaceEditorView source
class PlainTextEditor extends InPlaceEditorBase {
/**
* {@inheritdoc}
*/
public function isCompatible(FieldItemListInterface $items) {
$field_definition = $items->getFieldDefinition();
// This editor is incompatible with multivalued fields.
return $field_definition->getFieldStorageDefinition()
->getCardinality() == 1;
}
/**
* {@inheritdoc}
*/
public function getAttachments() {
return [
'library' => [
'quickedit/quickedit.inPlaceEditor.plainText',
],
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
InPlaceEditorBase::getMetadata | public | function | Generates metadata that is needed specifically for this editor. | Overrides InPlaceEditorInterface::getMetadata | 1 |
PlainTextEditor::getAttachments | public | function | Returns the attachments for this editor. | Overrides InPlaceEditorInterface::getAttachments | |
PlainTextEditor::isCompatible | public | function | Checks whether this in-place editor is compatible with a given field. | Overrides InPlaceEditorInterface::isCompatible | |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 6 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin_id of the plugin instance. | 2 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.