PHP Class PayPal\Core\PPUtils

Show file Open project: paypal/sdk-core-php Class Usage Examples

Public Methods

Method Description
array_match_key ( array $map, string $key ) : boolean Returns true if the array contains a key like $key
escapeInvalidXmlCharsRegex ( $textContent ) : string Escapes invalid xml characters
filterKeyPrefix ( array $map, string $keyPrefix ) : array Filter an array based on keys that match given prefix
getLocalIPAddress ( ) Get the local IP address. The client address is a required request parameter for some API calls
isAttributeProperty ( string $class, string $propertyName ) : string Determine if a property in a given class is a attribute type.
isIPv4 ( $ip ) : boolean Determines if valid IPv4 or not
isPropertyArray ( string $class, string $propertyName ) : string Determine if a property in a given class is a collection type.
lowerKeys ( array $array ) : array Convert all array keys to lowercase
nvpToMap ( string $nvpString ) : array Convert a Name Value Pair (NVP) formatted string into an associative array taking care to urldecode array values
objectProperties ( object $object ) : array
propertyAnnotations ( string $class, string $propertyName ) : string Get property annotations for a certain property in a class
propertyType ( string $class, string $propertyName ) : string Get data type of a property in a given class
xmlToArray ( string $xmlInput ) Convert xml string to an intermediate nested array representation that can be iterated

Private Methods

Method Description
xmlNodeToArray ( DOMNode $node ) Convert a DOM node to an intermediate nested array representation that can be iterated

Method Details

array_match_key() public static method

Returns true if the array contains a key like $key
public static array_match_key ( array $map, string $key ) : boolean
$map array
$key string
return boolean

escapeInvalidXmlCharsRegex() public static method

Escapes invalid xml characters
public static escapeInvalidXmlCharsRegex ( $textContent ) : string
$textContent = xml data to be escaped
return string

filterKeyPrefix() public static method

Filter an array based on keys that match given prefix
public static filterKeyPrefix ( array $map, string $keyPrefix ) : array
$map array
$keyPrefix string
return array

getLocalIPAddress() public static method

Get the local IP address. The client address is a required request parameter for some API calls
public static getLocalIPAddress ( )

isAttributeProperty() public static method

Determine if a property in a given class is a attribute type.
public static isAttributeProperty ( string $class, string $propertyName ) : string
$class string
$propertyName string
return string

isIPv4() public static method

Determines if valid IPv4 or not
public static isIPv4 ( $ip ) : boolean
$ip
return boolean

isPropertyArray() public static method

Determine if a property in a given class is a collection type.
public static isPropertyArray ( string $class, string $propertyName ) : string
$class string
$propertyName string
return string

lowerKeys() public static method

Convert all array keys to lowercase
public static lowerKeys ( array $array ) : array
$array array
return array

nvpToMap() public static method

Convert a Name Value Pair (NVP) formatted string into an associative array taking care to urldecode array values
public static nvpToMap ( string $nvpString ) : array
$nvpString string
return array

objectProperties() public static method

public static objectProperties ( object $object ) : array
$object object
return array

propertyAnnotations() public static method

Get property annotations for a certain property in a class
public static propertyAnnotations ( string $class, string $propertyName ) : string
$class string
$propertyName string
return string

propertyType() public static method

Get data type of a property in a given class
public static propertyType ( string $class, string $propertyName ) : string
$class string
$propertyName string
return string

xmlToArray() public static method

Convert xml string to an intermediate nested array representation that can be iterated
public static xmlToArray ( string $xmlInput )
$xmlInput string XML string to convert