You are here

ItemsCountConstraint.php in Media entity slideshow 8

Same filename and directory in other branches
  1. 8.2 src/Plugin/Validation/Constraint/ItemsCountConstraint.php

File

src/Plugin/Validation/Constraint/ItemsCountConstraint.php
View source
<?php

namespace Drupal\media_entity_slideshow\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Check number of slideshow items.
 *
 * @Constraint(
 *   id = "ItemsCount",
 *   label = @Translation("Slideshow items count", context = "Validation"),
 * )
 */
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.';

}

Classes

Namesort descending Description
ItemsCountConstraint Check number of slideshow items.