vdmi/afas-client

此包的最新版本(dev-master)没有可用的许可证信息。

用于简单SOAP连接的Afas客户端。

安装: 7

依赖者: 0

建议者: 0

安全性: 0

星星: 0

关注者: 2

分支: 0

公开问题: 1

类型:

dev-master 2017-04-04 10:36 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:30:04 UTC


README

AfasClient是一个简化SOAP请求的包。目前只支持NuSoap请求,并移除了NTLM认证和CURL登录。以后将会提供配置选项。

使用方法

首先,您需要“配置”AfasClient以进行调用。您可以通过在新的AfasClient对象中添加数组中的信息来完成此操作。

$this->afas = new AfasClient([
      'urlBase' => 'https://example.com/profitservices/',
      'environmentId' => 'YourEnviromentId',
      'useWSDL' => TRUE,
      'userId' => 'YourUserId',
      'password' => 'YourPassword',
    ]);

要执行调用,您需要构造一个查询。这将通过链式调用函数来完成。您可以使用以下函数:

  • range
  • filter
  • orderBy
  • option
$query = $this->afas->get('some_connector')
      ->range(10, 10) // Take 10, Skip 10.
      ->filter('title', 'WIP:%', AfasClient::OP_STARTS_WITH) // Title starts with "WIP:".
      ->orderBy('title', AfasClient::OP_ASC) // Order by title ascending.
      ->option('Outputmode', AfasClient::GET_OUTPUTMODE_ARRAY) // Return array.

最后,您想要执行调用。

$result = $query->execute();

安装

您可以使用composer通过执行以下命令安装此包:$ composer install vdmi/afas-client