You are here

class Braintree_Error_Validation in Commerce Braintree 7

error object returned as part of a validation error collection provides read-only access to $attribute, $code, and $message

<b>== More information ==</b>

For more detailed information on Validation errors, see {@link http://www.braintreepayments.com/gateway/validation-errors http://www.braintreepaymentsolutions.com/gateway/validation-errors}

@package Braintree @subpackage Error @copyright 2010 Braintree Payment Solutions

@property-read string $attribute @property-read string $code @property-read string $message

Hierarchy

Expanded class hierarchy of Braintree_Error_Validation

File

braintree_php/lib/Braintree/Error/Validation.php, line 26

View source
class Braintree_Error_Validation {
  private $_attribute;
  private $_code;
  private $_message;

  /**
   * @ignore
   * @param array $attributes
   */
  public function __construct($attributes) {
    $this
      ->_initializeFromArray($attributes);
  }

  /**
   * initializes instance properties from the keys/values of an array
   * @ignore
   * @access protected
   * @param array $attributes array of properties to set - single level
   * @return none
   */
  private function _initializeFromArray($attributes) {
    foreach ($attributes as $name => $value) {
      $varName = "_{$name}";
      $this->{$varName} = Braintree_Util::delimiterToCamelCase($value, '_');
    }
  }

  /**
   *
   * @ignore
   */
  public function __get($name) {
    $varName = "_{$name}";
    return isset($this->{$varName}) ? $this->{$varName} : null;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Braintree_Error_Validation::$_attribute private property
Braintree_Error_Validation::$_code private property
Braintree_Error_Validation::$_message private property
Braintree_Error_Validation::_initializeFromArray private function initializes instance properties from the keys/values of an array @ignore @access protected
Braintree_Error_Validation::__construct public function @ignore
Braintree_Error_Validation::__get public function @ignore