You are here

private static function Braintree_Address::_validateId in Commerce Braintree 7

verifies that a valid address id is being used @ignore

Parameters

string $id address id:

Throws

InvalidArgumentException

3 calls to Braintree_Address::_validateId()
Braintree_Address::delete in braintree_php/lib/Braintree/Address.php
delete an address by id
Braintree_Address::find in braintree_php/lib/Braintree/Address.php
find an address by id
Braintree_Address::update in braintree_php/lib/Braintree/Address.php
updates the address record

File

braintree_php/lib/Braintree/Address.php, line 244

Class

Braintree_Address
Creates and manages Braintree Addresses

Code

private static function _validateId($id = null) {
  if (empty($id) || trim($id) == "") {
    throw new InvalidArgumentException('expected address id to be set');
  }
  if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) {
    throw new InvalidArgumentException($id . ' is an invalid address id.');
  }
}