_failures = $failures; // give the exception a somewhat readable error string foreach ($failures as $field => $problem) { $error_message = $field . ' ' . $problem; } parent::__construct($error_message); } /** * @return associative array of validation failures */ public function getErrors () { return $this->_failures; } }