. */ /** * Doctrine_Validator_Driver * * @package Doctrine * @subpackage Validator * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.phpdoctrine.com * @since 1.0 * @version $Revision: 1080 $ * @author Konsta Vesterinen */ class Doctrine_Validator_Driver { /** * @var array $_args an array of plugin specific args */ protected $_args = array(); /** * __get * an alias for getOption * * @param string $arg */ public function __get($arg) { if (isset($this->_args[$arg])) { return $this->_args[$arg]; } return null; } /** * __isset * * @param string $arg */ public function __isset($arg) { return isset($this->_args[$arg]); } /** * sets given value to an argument * * @param $arg the name of the option to be changed * @param $value the value of the option * @return Doctrine_Validator_Driver this object */ public function __set($arg, $value) { $this->_args[$arg] = $value; return $this; } /** * returns the value of an argument * * @param $arg the name of the option to retrieve * @return mixed the value of the option */ public function getArg($arg) { if ( ! isset($this->_args[$arg])) { throw new Doctrine_Plugin_Exception('Unknown option ' . $arg); } return $this->_args[$arg]; } /** * sets given value to an argument * * @param $arg the name of the option to be changed * @param $value the value of the option * @return Doctrine_Validator_Driver this object */ public function setArg($arg, $value) { $this->_args[$arg] = $value; return $this; } /** * returns all args and their associated values * * @return array all args as an associative array */ public function getArgs() { return $this->_args; } }