Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function existsInvalidRecord($validator,$values)
- {
- $errors = array();
- foreach($values as $k => $v)
- {
- if($k === $this->getCSRFFieldName())
- {
- continue;
- }
- if(!$v)
- {
- continue;
- }
- $hasInvalidRecord = Doctrine::getTable('anyTable')->existsDuplicateEntry($v);
- if($hasInvalidRecord)
- {
- $error = new sfValidatorError($validator,'anyMessage');
- $errors[$k] = $error;
- }
- }
- if($errors)
- {
- throw new sfValidatorErrorSchema($validator, $errors);
- }
- return $values;
- }
Add Comment
Please, Sign In to add comment