PHP Класс ApiClient

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
factory ( string $protocol = PROTOCOL_DEFAULT, string $version = VERSION_DEFAULT ) : mixed Factory function returns a static instance of the ApiClient.

Приватные методы

Метод Описание
__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.

Описание методов

factory() публичный статический Метод

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
Результат mixed object on successful instantiation or false