Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Core\Validator;
- use DoctrineModule\Validator\UniqueObject;
- /**
- * Class that validates if objects exist in a given repository with a given list of matched fields only once.
- *
- * @license MIT
- * @link http://www.doctrine-project.org/
- * @author Oskar Bley <oskar@programming-php.net>
- */
- class MyUniqueObject extends UniqueObject
- {
- /**
- * @param string $messageKey
- * @param string $value OPTIONAL
- * @return void
- */
- protected function error($messageKey, $value = null)
- {
- if ($messageKey === null) {
- $keys = array_keys($this->abstractOptions['messageTemplates']);
- $messageKey = current($keys);
- }
- if ($value === null) {
- $value = $this->value;
- }
- $this->abstractOptions['messages'][$messageKey] = $this->createMessage($messageKey, $value['servico']);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement