Image.php

Same filename in this branch
  1. 9 core/modules/media/src/Plugin/media/Source/Image.php
  2. 9 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php
  3. 9 core/modules/quickedit/src/Plugin/InPlaceEditor/Image.php
  4. 9 core/lib/Drupal/Core/Image/Image.php
  5. 9 core/lib/Drupal/Component/Utility/Image.php
Same filename in other branches
  1. 8.9.x core/modules/media/src/Plugin/media/Source/Image.php
  2. 8.9.x core/modules/image/src/Plugin/InPlaceEditor/Image.php
  3. 8.9.x core/lib/Drupal/Core/Image/Image.php
  4. 8.9.x core/lib/Drupal/Component/Utility/Image.php
  5. 10 core/modules/media/src/Plugin/media/Source/Image.php
  6. 10 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php
  7. 10 core/lib/Drupal/Core/Image/Image.php
  8. 10 core/lib/Drupal/Component/Utility/Image.php
  9. 11.x core/modules/media/src/Plugin/media/Source/Image.php
  10. 11.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php
  11. 11.x core/lib/Drupal/Core/Image/Image.php
  12. 11.x core/lib/Drupal/Component/Utility/Image.php

Namespace

Drupal\image\Plugin\InPlaceEditor

File

core/modules/image/src/Plugin/InPlaceEditor/Image.php

View source
<?php

namespace Drupal\image\Plugin\InPlaceEditor;

use Drupal\Core\Field\FieldItemListInterface;
use Drupal\quickedit\Plugin\InPlaceEditorBase;

/**
 * Defines the image text in-place editor.
 *
 * @InPlaceEditor(
 *   id = "image"
 * )
 *
 * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use the
 *   Drupal\quickedit\Plugin\InPlaceEditor\Image in-place editor instead.
 *
 * @see https://www.drupal.org/node/3271848
 */
class Image extends InPlaceEditorBase {
    
    /**
     * Constructs a Image object.
     */
    public function __construct(array $configuration, $plugin_id, $plugin_definition) {
        @trigger_error('Drupal\\image\\Plugin\\InPlaceEditor\\Image is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use Drupal\\quickedit\\Plugin\\InPlaceEditor\\Image instead. See https://www.drupal.org/node/3271848', E_USER_DEPRECATED);
        parent::__construct($configuration, $plugin_id, $plugin_definition);
    }
    
    /**
     * {@inheritdoc}
     */
    public function isCompatible(FieldItemListInterface $items) {
        $field_definition = $items->getFieldDefinition();
        // This editor is only compatible with single-value image fields.
        return $field_definition->getFieldStorageDefinition()
            ->getCardinality() === 1 && $field_definition->getType() === 'image';
    }
    
    /**
     * {@inheritdoc}
     */
    public function getAttachments() {
        return [
            'library' => [
                'image/quickedit.inPlaceEditor.image',
            ],
        ];
    }

}

Classes

Title Deprecated Summary
Image

in drupal:9.4.0 and is removed from drupal:10.0.0. Use the Drupal\quickedit\Plugin\InPlaceEditor\Image in-place editor instead.

Defines the image text in-place editor.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.