Mercurial > hg > cmmr2012-drupal-site
annotate core/modules/quickedit/src/Plugin/InPlaceEditorInterface.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\quickedit\Plugin; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Component\Plugin\PluginInspectionInterface; |
Chris@0 | 6 use Drupal\Core\Field\FieldItemListInterface; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Defines an interface for in-place editors plugins. |
Chris@0 | 10 * |
Chris@0 | 11 * @see \Drupal\quickedit\Annotation\InPlaceEditor |
Chris@0 | 12 * @see \Drupal\quickedit\Plugin\InPlaceEditorBase |
Chris@0 | 13 * @see \Drupal\quickedit\Plugin\InPlaceEditorManager |
Chris@0 | 14 * @see plugin_api |
Chris@0 | 15 */ |
Chris@0 | 16 interface InPlaceEditorInterface extends PluginInspectionInterface { |
Chris@0 | 17 |
Chris@0 | 18 /** |
Chris@0 | 19 * Checks whether this in-place editor is compatible with a given field. |
Chris@0 | 20 * |
Chris@0 | 21 * @param \Drupal\Core\Field\FieldItemListInterface $items |
Chris@0 | 22 * The field values to be in-place edited. |
Chris@0 | 23 * |
Chris@0 | 24 * @return bool |
Chris@0 | 25 * TRUE if it is compatible, FALSE otherwise. |
Chris@0 | 26 */ |
Chris@0 | 27 public function isCompatible(FieldItemListInterface $items); |
Chris@0 | 28 |
Chris@0 | 29 /** |
Chris@0 | 30 * Generates metadata that is needed specifically for this editor. |
Chris@0 | 31 * |
Chris@0 | 32 * Will only be called by \Drupal\quickedit\MetadataGeneratorInterface::generate() |
Chris@0 | 33 * when the passed in field & item values will use this editor. |
Chris@0 | 34 * |
Chris@0 | 35 * @param \Drupal\Core\Field\FieldItemListInterface $items |
Chris@0 | 36 * The field values to be in-place edited. |
Chris@0 | 37 * |
Chris@0 | 38 * @return array |
Chris@0 | 39 * A keyed array with metadata. Each key should be prefixed with the plugin |
Chris@0 | 40 * ID of the editor. |
Chris@0 | 41 */ |
Chris@0 | 42 public function getMetadata(FieldItemListInterface $items); |
Chris@0 | 43 |
Chris@0 | 44 /** |
Chris@0 | 45 * Returns the attachments for this editor. |
Chris@0 | 46 * |
Chris@0 | 47 * @return array |
Chris@0 | 48 * An array of attachments, for use with #attached. |
Chris@0 | 49 * |
Chris@0 | 50 * @see \Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments() |
Chris@0 | 51 */ |
Chris@0 | 52 public function getAttachments(); |
Chris@0 | 53 |
Chris@0 | 54 } |