]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/FormError.php
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Form
;
15 * Wraps errors in forms
17 * @author Bernhard Schussek <bschussek@gmail.com>
27 * The template for the error message
30 protected $messageTemplate;
33 * The parameters that should be substituted in the message template
36 protected $messageParameters;
39 * The value for error message pluralization
42 protected $messagePluralization;
47 * Any array key in $messageParameters will be used as a placeholder in
50 * @param string $message The translated error message
51 * @param string|null $messageTemplate The template for the error message
52 * @param array $messageParameters The parameters that should be
53 * substituted in the message template.
54 * @param integer|null $messagePluralization The value for error message pluralization
56 * @see \Symfony\Component\Translation\Translator
58 public function __construct($message, $messageTemplate = null, array $messageParameters = array(), $messagePluralization = null)
60 $this->message
= $message;
61 $this->messageTemplate
= $messageTemplate ?: $message;
62 $this->messageParameters
= $messageParameters;
63 $this->messagePluralization
= $messagePluralization;
67 * Returns the error message
71 public function getMessage()
73 return $this->message
;
77 * Returns the error message template
81 public function getMessageTemplate()
83 return $this->messageTemplate
;
87 * Returns the parameters to be inserted in the message template
91 public function getMessageParameters()
93 return $this->messageParameters
;
97 * Returns the value for error message pluralization.
99 * @return integer|null
101 public function getMessagePluralization()
103 return $this->messagePluralization
;