class Count

@author Bernhard Schussek <bschussek@gmail.com>

@api

Hierarchy

  • class \Symfony\Component\Validator\Constraint
    • class \Symfony\Component\Validator\Constraints\Count

Expanded class hierarchy of Count

1 file declares its use of Count
CountValidatorTest.php in drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CountValidatorTest.php
2 string references to 'Count'
dblog_top in drupal/core/modules/dblog/dblog.admin.inc
Page callback: Shows the most frequent log messages of a given event type.
Sql::getAggregationInfo in drupal/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
Get aggregation info for group by queries.

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Constraints/Count.php, line 24

Namespace

Symfony\Component\Validator\Constraints
View source
class Count extends Constraint {
  public $minMessage = 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.';
  public $maxMessage = 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.';
  public $exactMessage = 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.';
  public $min;
  public $max;
  public function __construct($options = null) {
    if (null !== $options && !is_array($options)) {
      $options = array(
        'min' => $options,
        'max' => $options,
      );
    }
    parent::__construct($options);
    if (null === $this->min && null === $this->max) {
      throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), array(
        'min',
        'max',
      ));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Constraint::$groups public property
Constraint::addImplicitGroupName public function Adds the given group if this constraint is in the Default group
Constraint::CLASS_CONSTRAINT constant Marks a constraint that can be put onto classes
Constraint::DEFAULT_GROUP constant The name of the group given to all constraints with no explicit group
Constraint::getDefaultOption public function Returns the name of the default option 12
Constraint::getRequiredOptions public function Returns the name of the required options 10
Constraint::getTargets public function Returns whether the constraint can be put onto classes, properties or both 7
Constraint::PROPERTY_CONSTRAINT constant Marks a constraint that can be put onto properties
Constraint::validatedBy public function Returns the name of the class that validates this constraint 2
Constraint::__set public function Unsupported operation.
Count::$exactMessage public property
Count::$max public property
Count::$maxMessage public property
Count::$min public property
Count::$minMessage public property
Count::__construct public function Initializes the constraint with options. Overrides Constraint::__construct