public function errorStack($stack = null) { if ($stack !== null) { if (!$stack instanceof Doctrine_Validator_ErrorStack) { throw new Doctrine_Record_Exception('Argument should be an instance of Doctrine_Validator_ErrorStack.'); } $this->_errorStack = $stack; } else { return $this->getErrorStack(); } }