PHP Class PayPal\Common\PayPalModel

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

Protected Properties

Property Type Description
$credential PayPal\Auth\OAuthTokenCredential OAuth Credentials to use for this call

Public Methods

Method Description
__construct ( null $data = null ) Default Constructor
__get ( $key ) : mixed Magic Get Method
__isset ( $key ) : boolean Magic isSet Method
__set ( $key, $value ) Magic Set Method
__toString ( ) : string Magic Method for toString
__unset ( $key ) Magic Unset Method
fromArray ( $arr ) Fills object value from Array list
fromJson ( $json ) Fills object value from Json string
getList ( mixed $data ) : array Returns a list of Object from Array or Json String. It is generally used when your json contains an array of this object
setCredential ( OAuthTokenCredential $credential ) Sets Credential
toArray ( ) : array Returns array representation of object
toJSON ( integer $options ) : string Returns object JSON representation

Private Methods

Method Description
_convertToArray ( $param ) : array Converts Params to Array
assignValue ( $key, $value )
convertToCamelCase ( $key ) : mixed Converts the input key into a valid Setter Method Name

Method Details

__construct() public method

You can pass data as a json representation or array object. This argument eliminates the need to do $obj->fromJson($data) later after creating the object.
public __construct ( null $data = null )
$data null

__get() public method

Magic Get Method
public __get ( $key ) : mixed
$key
return mixed

__isset() public method

Magic isSet Method
public __isset ( $key ) : boolean
$key
return boolean

__set() public method

Magic Set Method
public __set ( $key, $value )
$key
$value

__toString() public method

Magic Method for toString
public __toString ( ) : string
return string

__unset() public method

Magic Unset Method
public __unset ( $key )
$key

fromArray() public method

Fills object value from Array list
public fromArray ( $arr )
$arr

fromJson() public method

Fills object value from Json string
public fromJson ( $json )
$json

getList() public static method

Returns a list of Object from Array or Json String. It is generally used when your json contains an array of this object
public static getList ( mixed $data ) : array
$data mixed Array object or json string representation
return array

setCredential() public static method

Sets Credential
Deprecation: Pass ApiContext to create/get methods instead
public static setCredential ( OAuthTokenCredential $credential )
$credential PayPal\Auth\OAuthTokenCredential

toArray() public method

Returns array representation of object
public toArray ( ) : array
return array

toJSON() public method

Returns object JSON representation
public toJSON ( integer $options ) : string
$options integer http://php.net/manual/en/json.constants.php
return string

Property Details

$credential protected static property

OAuth Credentials to use for this call
protected static OAuthTokenCredential,PayPal\Auth $credential
return PayPal\Auth\OAuthTokenCredential