class CKEditor5Plugin

Same name in this branch
  1. 10 core/modules/ckeditor5/src/Attribute/CKEditor5Plugin.php \Drupal\ckeditor5\Attribute\CKEditor5Plugin
Same name in other branches
  1. 9 core/modules/ckeditor5/src/Annotation/CKEditor5Plugin.php \Drupal\ckeditor5\Annotation\CKEditor5Plugin
  2. 11.x core/modules/ckeditor5/src/Annotation/CKEditor5Plugin.php \Drupal\ckeditor5\Annotation\CKEditor5Plugin
  3. 11.x core/modules/ckeditor5/src/Attribute/CKEditor5Plugin.php \Drupal\ckeditor5\Attribute\CKEditor5Plugin

Defines a CKEditor5Plugin annotation object.

Plugin Namespace: Plugin\CKEditor5Plugin.

Hierarchy

Expanded class hierarchy of CKEditor5Plugin

See also

\Drupal\ckeditor5\Plugin\CKEditor5PluginInterface

\Drupal\ckeditor5\Plugin\CKEditor5PluginManagerInterface

Plugin API

\Drupal\ckeditor5\Annotation\CKEditor5AspectsOfCKEditor5Plugin

\Drupal\ckeditor5\Annotation\DrupalAspectsOfCKEditor5Plugin

Related topics

1 file declares its use of CKEditor5Plugin
SmartDefaultSettingsTest.php in core/modules/ckeditor5/tests/src/Unit/SmartDefaultSettingsTest.php

File

core/modules/ckeditor5/src/Annotation/CKEditor5Plugin.php, line 23

Namespace

Drupal\ckeditor5\Annotation
View source
class CKEditor5Plugin extends Plugin {
    
    /**
     * The plugin ID.
     *
     * @var string
     */
    public $id;
    
    /**
     * The CKEditor 5 aspects of the plugin definition.
     *
     * @var \Drupal\ckeditor5\Annotation\CKEditor5AspectsOfCKEditor5Plugin
     */
    public $ckeditor5;
    
    /**
     * The Drupal aspects of the plugin definition.
     *
     * @var \Drupal\ckeditor5\Annotation\DrupalAspectsOfCKEditor5Plugin
     */
    public $drupal;
    
    /**
     * {@inheritdoc}
     *
     * Overridden for compatibility with the AnnotationBridgeDecorator, which
     * ensures YAML-defined CKEditor 5 plugin definitions are also processed by
     * annotations. Unfortunately it does not (yet) support nested annotations.
     * Force YAML-defined plugin definitions to be parsed by the
     * annotations, to ensure consistent handling of defaults.
     *
     * @see \Drupal\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecorator::getDefinitions()
     */
    public function __construct($values) {
        if (isset($values['ckeditor5']) && is_array($values['ckeditor5'])) {
            $values['ckeditor5'] = new CKEditor5AspectsOfCKEditor5Plugin($values['ckeditor5']);
        }
        if (isset($values['drupal']) && is_array($values['drupal'])) {
            $values['drupal'] = new DrupalAspectsOfCKEditor5Plugin($values['drupal']);
        }
        parent::__construct($values);
    }
    
    /**
     * {@inheritdoc}
     */
    public function getClass() {
        return $this->definition['drupal']['class'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function setClass($class) {
        $this->definition['drupal']['class'] = $class;
    }
    
    /**
     * {@inheritdoc}
     */
    public function get() : CKEditor5PluginDefinition {
        return new CKEditor5PluginDefinition($this->definition);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
CKEditor5Plugin::$ckeditor5 public property The CKEditor 5 aspects of the plugin definition.
CKEditor5Plugin::$drupal public property The Drupal aspects of the plugin definition.
CKEditor5Plugin::$id public property The plugin ID.
CKEditor5Plugin::get public function Gets the value of an annotation. Overrides Plugin::get
CKEditor5Plugin::getClass public function Gets the class of the annotated class. Overrides Plugin::getClass
CKEditor5Plugin::setClass public function Sets the class of the annotated class. Overrides Plugin::setClass
CKEditor5Plugin::__construct public function Overridden for compatibility with the AnnotationBridgeDecorator, which
ensures YAML-defined CKEditor 5 plugin definitions are also processed by
annotations. Unfortunately it does not (yet) support nested annotations.
Force YAML-defined plugin…
Overrides Plugin::__construct
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider 1
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider

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