. */ Doctrine::autoload('Doctrine_Access'); /** * Doctrine_Validator_ErrorStack * * @author Konsta Vesterinen * @license LGPL * @package Doctrine */ class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable, IteratorAggregate { private $errors = array(); public function merge($stack) { if(is_array($stack)) { $this->errors = array_merge($this->errors, $stack); } } public function get($name) { if(isset($this->errors[$name])) return $this->errors[$name]; return null; } public function set($name, $value) { $this->errors[$name] = $value; } public function getIterator() { return new ArrayIterator($this->errors); } public function count() { return count($this->errors); } }