ToolbarItemDependencyConstraint.php

Same filename in other branches
  1. 10 core/modules/ckeditor5/src/Plugin/Validation/Constraint/ToolbarItemDependencyConstraint.php
  2. 11.x core/modules/ckeditor5/src/Plugin/Validation/Constraint/ToolbarItemDependencyConstraint.php

Namespace

Drupal\ckeditor5\Plugin\Validation\Constraint

File

core/modules/ckeditor5/src/Plugin/Validation/Constraint/ToolbarItemDependencyConstraint.php

View source
<?php

declare (strict_types=1);
namespace Drupal\ckeditor5\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * A CKEditor 5 toolbar item.
 *
 * @Constraint(
 *   id = "CKEditor5ToolbarItemDependencyConstraint",
 *   label = @Translation("CKEditor 5 toolbar item dependency", context = "Validation"),
 * )
 *
 * @internal
 */
class ToolbarItemDependencyConstraint extends Constraint {
    
    /**
     * The default violation message.
     *
     * @var string
     */
    public $message = 'Depends on %toolbar_item, which is not enabled.';
    
    /**
     * The toolbar item that this validation constraint requires to be enabled.
     *
     * @var null|string
     */
    public $toolbarItem = NULL;
    
    /**
     * {@inheritdoc}
     */
    public function getRequiredOptions() {
        return [
            'toolbarItem',
        ];
    }

}

Classes

Title Deprecated Summary
ToolbarItemDependencyConstraint A CKEditor 5 toolbar item.

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