broklyngagah / zohocrmclient
提供对 Zoho Rest API 的清晰易读的 PHP API
0.9.4
2016-11-17 08:54 UTC
Requires
- php: >=5.3.3
- kriswallsmith/buzz: ~0.10
- psr/log: ~1.0.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-23 13:57:38 UTC
README
主仓库已不再维护。我使用它来处理我的自定义项目。
提供对 Zoho Rest API 的清晰易读的 PHP API。
用法
use Christiaan\ZohoCRMClient\ZohoCRMClient; $client = new ZohoCRMClient('Leads', 'yourAuthKey'); $records = $client->getRecords() ->selectColumns('First Name', 'Last Name', 'Email') ->sortBy('Last Name')->sortAsc() ->since(date_create('last week')) ->request(); echo 'Content: ' . print_r($records, true) . PHP_EOL;
使用自定义传输设置启用日志记录
$buzzTransport = new BuzzTransport( new \Buzz\Browser(new \Buzz\Client\Curl()), 'https://crm.zoho.com/crm/private/xml/' ); $buzzTransport->setLogger($logger); $transport = new XmlDataTransportDecorator( new AuthenticationTokenTransportDecorator( 'yourAuthKey', $buzzTransport ) ); $client = new ZohoCRMClient('Leads', $transport);
已实现的调用
目前仅支持以下调用
- getRecords
- getRecordById
- insertRecords
- updateRecords
- getFields
添加新的调用相对容易,请查看 Request 目录中的某个类作为示例。在创建 Request 类之后,可能需要修改 XmlDataTransportDecorator 类中对响应 XML 的解析。