extraParams = $extraParams + array('error_code' => $error_code); } // custom string representation of object public function __toString() { return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; } public function getExtraParams() { return $this->extraParams; } public function getErrorCodes(){ return array( 2000 => '$params was not an array', 2001 => 'Invalid Value for Date field', 2100 => 'String value is longer than permitted length' ); } }