ste80pa / suitecrm-client
SuiteCRM Soap和Rest客户端
dev-master
2017-10-14 23:23 UTC
Requires
- php: >=5.3.0
- ext-openssl: *
- ext-soap: *
Requires (Dev)
- php-coveralls/php-coveralls: ^1.0
- phpunit/phpunit: ~4.8|~5.0|~6.0
This package is not auto-updated.
Last update: 2024-09-29 05:07:55 UTC
README
摘要
一个简单的库,用于通过Soap或Restful端点与SuiteCRM通信
代码示例
使用Soap端点
<?php include('vendor/autoload.php'); use ste80pa\SuiteCRMClient\Types\Requests\GetEntryListRequest; use ste80pa\SuiteCRMClient\Types\Requests\LoginRequest; use ste80pa\SuiteCRMClient\SoapClient; use ste80pa\SuiteCRMClient\Session; $url = 'your sugar crm host'; $username = 'your username'; $password = 'your password'; $session = new Session($url, $username, $password); $client = new SoapClient($session); $client->login(); $request = new GetEntryListRequest(); $request->module_name = 'Accounts'; $request->select_fields = array('id', 'name'); $request->max_results = 100; $request->favorites = false; $request->deleted = 1; $accounts = $client->getEntryList($request); print_r($accounts);
使用Rest端点
<?php include('vendor/autoload.php'); use ste80pa\SuiteCRMClient\Types\Requests\GetEntryListRequest; use ste80pa\SuiteCRMClient\Types\Requests\LoginRequest; use ste80pa\SuiteCRMClient\RestClient; use ste80pa\SuiteCRMClient\Session; $url = 'your sugar crm host'; $username = 'your username'; $password = 'your password'; $session = new Session($url, $username, $password); $client = new RestClient($session); $client->login(); $request = new GetEntryListRequest(); $request->module_name = 'Accounts'; $request->select_fields = array('id', 'name'); $request->max_results = 100; $request->favorites = false; $request->deleted = 1; $accounts = $client->getEntryList($request); print_r($accounts);
动机
安装
composer require ste80pa/suitecrm-client:dev-master
API参考
测试
运行所有测试
phpunit