PHP Class ApiClient

Afficher le fichier Open project: fubralimited/php-oara Class Usage Examples

Méthodes publiques

Méthode Description
factory ( string $protocol = PROTOCOL_DEFAULT, string $version = VERSION_DEFAULT ) : mixed Factory function returns a static instance of the ApiClient.

Private Methods

Méthode Description
__construct ( ) : void Make the constructor private to prevent the class being instantiated directly.
getInterface ( string $version, string $protocol ) : mixed Automatically includes the required ApiClient protocol class.

Method Details

factory() public static méthode

You can choose between three different api protocols. JSON, XML and SOAP are supported by the zanox api. If no version is given the latest version is always used. --- Usage example: creating api instance use soap api interface and the latest version $api = ApiClient::factory(PROTOCOL_SOAP, VERSION_DEFAULT); use xml api interface and the latest vesion $api = ApiClient::factory(PROTOCOL_XML, VERSION_DEFAULT); use json api interface and latest version $api = ApiClient::factory(PROTOCOL_JSON); ---
public static factory ( string $protocol = PROTOCOL_DEFAULT, string $version = VERSION_DEFAULT ) : mixed
$protocol string api protocol type (XML,JSON or SOAP)
$version string api version is optional
Résultat mixed object on successful instantiation or false