You are here

class ItemsCountConstraint in Media entity slideshow 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Validation/Constraint/ItemsCountConstraint.php \Drupal\media_entity_slideshow\Plugin\Validation\Constraint\ItemsCountConstraint

Check number of slideshow items.

Plugin annotation


@Constraint(
  id = "ItemsCount",
  label = @Translation("Slideshow items count", context = "Validation"),
)

Hierarchy

  • class \Drupal\media_entity_slideshow\Plugin\Validation\Constraint\ItemsCountConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of ItemsCountConstraint

1 file declares its use of ItemsCountConstraint
ConstraintsTest.php in tests/src/Unit/ConstraintsTest.php

File

src/Plugin/Validation/Constraint/ItemsCountConstraint.php, line 15

Namespace

Drupal\media_entity_slideshow\Plugin\Validation\Constraint
View source
class ItemsCountConstraint extends Constraint {

  /**
   * Source field name.
   *
   * @var string
   */
  public $sourceFieldName;

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'At least one slideshow item must exist.';

}

Members

Namesort descending Modifiers Type Description Overrides
ItemsCountConstraint::$message public property The default violation message.
ItemsCountConstraint::$sourceFieldName public property Source field name.