Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Plural.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\API\Repository\Values\Translation;
8
9 use eZ\Publish\API\Repository\Values\Translation;
10
32 class Plural extends Translation
33 {
40 protected $singular;
41
48 protected $plural;
49
56 protected $values;
57
65 public function __construct($singular, $plural, array $values)
66 {
67 $this->singular = $singular;
68 $this->plural = $plural;
69 $this->values = $values;
70 }
71
75 public function __toString()
76 {
77 return strtr(current($this->values) == 1 ? $this->plural : $this->singular, $this->values);
78 }
79 }
eZ\Publish\API\Repository\Values\Translation\Plural
Class for translatable messages, which may contain plural forms.
Definition: Plural.php:33
eZ\Publish\API\Repository\Values\Translation\Plural\__toString
__toString()
{}
Definition: Plural.php:75
eZ\Publish\API\Repository\Values\Translation\Plural\$singular
$singular
Definition: Plural.php:40
eZ\Publish\API\Repository\Values\Translation\Plural\$values
$values
Definition: Plural.php:56
eZ\Publish\API\Repository\Values\Translation\Plural\__construct
__construct($singular, $plural, array $values)
Construct plural message from singular, plural and value array.
Definition: Plural.php:65
eZ\Publish\API\Repository\Values\Translation\Plural\$plural
$plural
Definition: Plural.php:48
eZ\Publish\API\Repository\Values\Translation
Base class fro translation messages.
Definition: Translation.php:15
eZ\Publish\API\Repository\Values\Translation
Definition: API/Repository/Values/Translation/Message.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.