3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Validator\Db
;
12 use Zend\Validator\Exception
;
15 * Confirms a record does not exist in a table.
17 class NoRecordExists
extends AbstractDb
19 public function isValid($value)
22 * Check for an adapter being defined. If not, throw an exception.
24 if (null === $this->adapter
) {
25 throw new Exception\
RuntimeException('No database adapter present');
29 $this->setValue($value);
31 $result = $this->query($value);
34 $this->error(self
::ERROR_RECORD_FOUND
);