ConstraintViolationBuilder::setPlural

public ConstraintViolationBuilder::setPlural($number)

Sets the number which determines how the plural form of the violation message is chosen when it is translated.

Parameters

int $number The number for determining the plural form:

Return value

ConstraintViolationBuilderInterface This builder

Overrides ConstraintViolationBuilderInterface::setPlural

See also

\Symfony\Component\Translation\TranslatorInterface::transChoice()

File

core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php, line 186

Class

ConstraintViolationBuilder
Defines a constraint violation builder for the Typed Data validator.

Namespace

Drupal\Core\TypedData\Validation

Code

1
2
3
4
5
6
public function setPlural($number)
 {
  $this->plural = $number;
 
  return $this;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.