PHP Class Braintree\Error\ErrorCollection

Contains a read-only property $error which is a ValidationErrorCollection
Inheritance: implements Countable
显示文件 Open project: braintree/braintree_php

Public Methods

Method Description
__construct ( $errorData )
__get ( $name )
__toString ( )
count ( ) : integer Return count of items in collection Implements countable
deepAll ( ) Returns all of the validation errors at all levels of nesting in a single, flat array.
deepSize ( ) : integer Returns the total number of validation errors at all levels of nesting. For example, if creating a customer with a credit card and a billing address, and each of the customer, credit card, and billing address has 1 error, this method will return 3.
forKey ( string $key ) : mixed return errors for the passed key name
onHtmlField ( string $field ) : array return errors for the passed html field.
shallowAll ( ) Returns the errors at the given nesting level (see forKey) in a single, flat array:

Method Details

__construct() public method

public __construct ( $errorData )

__get() public method

public __get ( $name )

__toString() public method

public __toString ( )

count() public method

Return count of items in collection Implements countable
public count ( ) : integer
return integer

deepAll() public method

Returns all of the validation errors at all levels of nesting in a single, flat array.
public deepAll ( )

deepSize() public method

Returns the total number of validation errors at all levels of nesting. For example, if creating a customer with a credit card and a billing address, and each of the customer, credit card, and billing address has 1 error, this method will return 3.
public deepSize ( ) : integer
return integer size

forKey() public method

return errors for the passed key name
public forKey ( string $key ) : mixed
$key string
return mixed

onHtmlField() public method

For example, $result->errors->onHtmlField("transaction[customer][last_name]")
public onHtmlField ( string $field ) : array
$field string
return array

shallowAll() public method

$result = Customer::create(...); $customerErrors = $result->errors->forKey('customer')->shallowAll();
public shallowAll ( )