errors)>0 ? false : true ); } function add($message, $arg0 = '', $arg1 = '') { $patterns = array ("/\{0\}/","/\{1\}/"); $replace = array ($arg0, $arg1); $message = preg_replace ($patterns, $replace, $message); $this->errors[]["message"] = $message; } function addAll($arr) { if (is_array($arr)) { foreach ($arr as $k=>$v) { $this->errors[$k] = $v; } } } function get($key) { return $this->errors["$key"]["message"]; } function dump() { print_r($this->errors); } function getErrors() { return $this->errors; } }