final class CKEditor5PluginDefinition extends PluginDefinition implements PluginDefinitionInterface (View source)

Provides an implementation of a CKEditor 5 plugin definition.

Traits

Provides a trait for checking configuration schema.

Properties

protected string $id

The plugin ID.

from  PluginDefinition
protected string $class

A fully qualified class name.

from  PluginDefinition
protected string $provider

The plugin provider.

from  PluginDefinition
protected Element $schema

The config schema wrapper object for the configuration object under test.

from  SchemaCheckTrait
protected string $configName

The configuration object name under test.

from  SchemaCheckTrait

Methods

string
id()

Gets the unique identifier of the plugin.

setClass(string $class)

Sets the class.

string
getClass()

Gets the class.

string
getProvider()

Gets the plugin provider.

array|bool
checkConfigSchema(TypedConfigManagerInterface $typed_config, string $config_name, array $config_data)

Checks the TypedConfigManager has a valid schema for the configuration.

array
checkValue(string $key, mixed $value)

Helper method to check data type.

__construct(array $definition)

CKEditor5PluginDefinition constructor.

array
toArray()

Gets an array representation of this CKEditor 5 plugin definition.

bool
isConfigurable()

Whether this plugin is configurable by the user.

label()

Gets the human-readable name of the CKEditor plugin.

array
getConditions()

Gets the list of conditions to enable this plugin.

bool
hasConditions()

Whether this plugin has conditions.

array
getToolbarItems()

Gets the list of toolbar items this plugin provides.

bool
hasToolbarItems()

Whether this plugin has toolbar items.

string
getLibrary()

Gets the asset library this plugin needs to be loaded.

bool
hasLibrary()

Whether this plugin has an asset library to load.

string
getAdminLibrary()

Gets the asset library this plugin needs to be loaded on the admin UI.

bool
hasAdminLibrary()

Whether this plugin has an asset library to load on the admin UI.

string[]|false
getElements()

Gets the list of elements and attributes this plugin allows to create/edit.

bool
hasElements()

Whether this plugin allows creating/editing elements and attributes.

array
getCKEditor5Plugins()

Gets the list of CKEditor 5 plugin classes this plugin needs to load.

bool
hasCKEditor5Plugins()

Whether this plugin loads CKEditor 5 plugin classes.

array
getCKEditor5Config()

Gets keyed array of additional values for the CKEditor5 constructor config.

bool
hasCKEditor5Config()

Whether this plugin has additional values for the CKEditor5 constructor.

Details

string id()

Gets the unique identifier of the plugin.

Return Value

string

The unique identifier of the plugin.

PluginDefinitionInterface setClass(string $class)

Sets the class.

Parameters

string $class

A fully qualified class name.

Return Value

PluginDefinitionInterface

Exceptions

InvalidArgumentException

string getClass()

Gets the class.

Return Value

string

A fully qualified class name.

See also

DrupalAspectsOfCKEditor5Plugin::$class

string getProvider()

Gets the plugin provider.

The provider is the name of the module that provides the plugin, or "core', or "component".

Return Value

string

The provider.

array|bool checkConfigSchema(TypedConfigManagerInterface $typed_config, string $config_name, array $config_data)

Checks the TypedConfigManager has a valid schema for the configuration.

Parameters

TypedConfigManagerInterface $typed_config

The TypedConfigManager.

string $config_name

The configuration name.

array $config_data

The configuration data, assumed to be data for a top-level config object.

Return Value

array|bool

FALSE if no schema found. List of errors if any found. TRUE if fully valid.

protected array checkValue(string $key, mixed $value)

Helper method to check data type.

Parameters

string $key

A string of configuration key.

mixed $value

Value of given key.

Return Value

array

List of errors found while checking with the corresponding schema.

__construct(array $definition)

CKEditor5PluginDefinition constructor.

Parameters

array $definition

An array of values from the annotation/YAML.

Exceptions

InvalidPluginDefinitionException

array toArray()

Gets an array representation of this CKEditor 5 plugin definition.

Return Value

array

bool isConfigurable()

Whether this plugin is configurable by the user.

Return Value

bool

TRUE if it is configurable, FALSE otherwise.

See also

CKEditor5PluginConfigurableInterface

TranslatableMarkup label()

Gets the human-readable name of the CKEditor plugin.

Return Value

TranslatableMarkup

See also

DrupalAspectsOfCKEditor5Plugin::$label

array getConditions()

Gets the list of conditions to enable this plugin.

Return Value

array

An array of conditions.

Exceptions

LogicException

See also

DrupalAspectsOfCKEditor5Plugin::$conditions

bool hasConditions()

Whether this plugin has conditions.

Return Value

bool

See also

DrupalAspectsOfCKEditor5Plugin::$conditions

array getToolbarItems()

Gets the list of toolbar items this plugin provides.

Return Value

array

An array of toolbar items.

See also

DrupalAspectsOfCKEditor5Plugin::$toolbar_items

bool hasToolbarItems()

Whether this plugin has toolbar items.

Return Value

bool

See also

DrupalAspectsOfCKEditor5Plugin::$toolbar_items

string getLibrary()

Gets the asset library this plugin needs to be loaded.

Return Value

string

An asset library ID.

Exceptions

LogicException

See also

DrupalAspectsOfCKEditor5Plugin::$library

bool hasLibrary()

Whether this plugin has an asset library to load.

Return Value

bool

See also

DrupalAspectsOfCKEditor5Plugin::$library

string getAdminLibrary()

Gets the asset library this plugin needs to be loaded on the admin UI.

Return Value

string

An asset library ID.

Exceptions

LogicException

See also

DrupalAspectsOfCKEditor5Plugin::$admin_library

bool hasAdminLibrary()

Whether this plugin has an asset library to load on the admin UI.

Return Value

bool

See also

DrupalAspectsOfCKEditor5Plugin::$admin_library

string[]|false getElements()

Gets the list of elements and attributes this plugin allows to create/edit.

Return Value

string[]|false

FALSE if this plugin does not create/edit any elements or attributes. Otherwise a list.

See also

DrupalAspectsOfCKEditor5Plugin::$elements

bool hasElements()

Whether this plugin allows creating/editing elements and attributes.

Return Value

bool

See also

DrupalAspectsOfCKEditor5Plugin::$elements

array getCKEditor5Plugins()

Gets the list of CKEditor 5 plugin classes this plugin needs to load.

Return Value

array

CKEditor 5 plugin classes.

See also

CKEditor5AspectsOfCKEditor5Plugin::$plugins

bool hasCKEditor5Plugins()

Whether this plugin loads CKEditor 5 plugin classes.

Return Value

bool

See also

CKEditor5AspectsOfCKEditor5Plugin::$plugins

array getCKEditor5Config()

Gets keyed array of additional values for the CKEditor5 constructor config.

Return Value

array

The CKEditor 5 constructor config.

See also

CKEditor5AspectsOfCKEditor5Plugin::$config

bool hasCKEditor5Config()

Whether this plugin has additional values for the CKEditor5 constructor.

Return Value

bool

See also

CKEditor5AspectsOfCKEditor5Plugin::$config