You are here

MediaItemsCountConstraint.php in Varbase Media 9.0.x

Same filename and directory in other branches
  1. 8.7 src/Plugin/Validation/Constraint/MediaItemsCountConstraint.php

File

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

namespace Drupal\varbase_media\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Check number of media items.
 *
 * @Constraint(
 *   id = "MediaItemsCount",
 *   label = @Translation("Media items count", context = "Validation"),
 * )
 */
class MediaItemsCountConstraint extends Constraint {

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

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

}

Classes

Namesort descending Description
MediaItemsCountConstraint Check number of media items.