Beispiel #1
0
 public function setValue($newValue)
 {
     if (!empty($newValue)) {
         $validator = new EmailValidator($newValue);
         if (!$validator->isValid()) {
             throw new \InvalidArgumentException(sprintf('Not an email: "%s"', $newValue));
         }
     }
     return parent::setValue($newValue);
 }
Beispiel #2
0
 public function setValue($newValue)
 {
     if (!$this->isUniq($newValue)) {
         throw new \ForbiddenException('Login `' . $newValue . '` already used');
     }
     if (empty($newValue)) {
         throw new \InvalidArgumentException('Login can`t be empty');
     }
     parent::setValue($newValue);
 }