web/lib/Zend/Validate/Db/Abstract.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Validate
    16  * @package    Zend_Validate
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Abstract.php 24593 2012-01-05 20:35:02Z matthew $
    19  * @version    $Id$
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @see Zend_Validate_Abstract
    23  * @see Zend_Validate_Abstract
    24  */
    24  */
    28  * Class for Database record validation
    28  * Class for Database record validation
    29  *
    29  *
    30  * @category   Zend
    30  * @category   Zend
    31  * @package    Zend_Validate
    31  * @package    Zend_Validate
    32  * @uses       Zend_Validate_Abstract
    32  * @uses       Zend_Validate_Abstract
    33  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    33  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    35  */
    35  */
    36 abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
    36 abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
    37 {
    37 {
    38     /**
    38     /**
    95      * 'field'   => The field to check for a match
    95      * 'field'   => The field to check for a match
    96      * 'exclude' => An optional where clause or field/value pair to exclude from the query
    96      * 'exclude' => An optional where clause or field/value pair to exclude from the query
    97      * 'adapter' => An optional database adapter to use
    97      * 'adapter' => An optional database adapter to use
    98      *
    98      *
    99      * @param array|Zend_Config $options Options to use for this validator
    99      * @param array|Zend_Config $options Options to use for this validator
       
   100      * @throws Zend_Validate_Exception
   100      */
   101      */
   101     public function __construct($options)
   102     public function __construct($options)
   102     {
   103     {
   103         if ($options instanceof Zend_Db_Select) {
   104         if ($options instanceof Zend_Db_Select) {
   104             $this->setSelect($options);
   105             $this->setSelect($options);
   150     }
   151     }
   151 
   152 
   152     /**
   153     /**
   153      * Returns the set adapter
   154      * Returns the set adapter
   154      *
   155      *
       
   156      * @throws Zend_Validate_Exception
   155      * @return Zend_Db_Adapter
   157      * @return Zend_Db_Adapter
   156      */
   158      */
   157     public function getAdapter()
   159     public function getAdapter()
   158     {
   160     {
   159         /**
   161         /**
   171 
   173 
   172     /**
   174     /**
   173      * Sets a new database adapter
   175      * Sets a new database adapter
   174      *
   176      *
   175      * @param  Zend_Db_Adapter_Abstract $adapter
   177      * @param  Zend_Db_Adapter_Abstract $adapter
       
   178      * @throws Zend_Validate_Exception
   176      * @return Zend_Validate_Db_Abstract
   179      * @return Zend_Validate_Db_Abstract
   177      */
   180      */
   178     public function setAdapter($adapter)
   181     public function setAdapter($adapter)
   179     {
   182     {
   180         if (!($adapter instanceof Zend_Db_Adapter_Abstract)) {
   183         if (!($adapter instanceof Zend_Db_Adapter_Abstract)) {
   276 
   279 
   277     /**
   280     /**
   278      * Sets the select object to be used by the validator
   281      * Sets the select object to be used by the validator
   279      *
   282      *
   280      * @param Zend_Db_Select $select
   283      * @param Zend_Db_Select $select
       
   284      * @throws Zend_Validate_Exception
   281      * @return Zend_Validate_Db_Abstract
   285      * @return Zend_Validate_Db_Abstract
   282      */
   286      */
   283     public function setSelect($select)
   287     public function setSelect($select)
   284     {
   288     {
   285         if (!$select instanceof Zend_Db_Select) {
   289         if (!$select instanceof Zend_Db_Select) {