Simplify_FieldError

Represents a single error in a field of a request sent to the API.

Defined (1)

The class is defined in the following location(s).

/includes/gateways/simplify-commerce/includes/Simplify/Exceptions.php  
  1. class Simplify_FieldError { 
  2.  
  3. protected $field; 
  4. protected $code; 
  5. protected $message; 
  6.  
  7. /** 
  8. * @ignore 
  9. */ 
  10. function __construct($errorData) { 
  11.  
  12. $this->field = $errorData['field']; 
  13. $this->code = $errorData['code']; 
  14. $this->message = $errorData['message']; 
  15.  
  16. /** 
  17. * Returns the name of the field with the error. 
  18. * @return string the field name. 
  19. */ 
  20. function getFieldName() { 
  21. return $this->field; 
  22.  
  23. /** 
  24. * Returns the code for the error. 
  25. * @return string the error code. 
  26. */ 
  27. function getErrorCode() { 
  28. return $this->code; 
  29.  
  30. /** 
  31. * Returns a description of the error. 
  32. * @return string description of the error. 
  33. */ 
  34. function getMessage() { 
  35. return $this->message; 
  36.  
  37.  
  38. function __toString() { 
  39. return "Field error: " . $this->getFieldName() . "\"" . $this->getMessage() . "\" (" . $this->getErrorCode() . ")"; 
  40.