grixu / socius-client
此软件包已废弃,不再维护。未建议替代软件包。
Socius API的PHP客户端
2.7.2
2021-11-18 11:31 UTC
Requires
- php: ^8.0
- ext-json: *
- grixu/api-client: ^3.4
- grixu/socius-dto: ^1.1
- grixu/socius-models: ^3.1
- grixu/synchronizer: ^5.2
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.8
- brianium/paratest: ^6.3
- friendsofphp/php-cs-fixer: ^3.1
- grixu/data-factories: ^1.1
- nunomaduro/larastan: ^0.7.12 || ^1.0.0
- nunomaduro/phpinsights: ^2.0
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
- spatie/x-ray: ^1.1
- dev-main
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/github_actions/shivammathur/setup-php-2.23.0
- dev-dependabot/github_actions/8398a7/action-slack-3.15.0
- dev-dependabot/github_actions/dependabot/fetch-metadata-1.3.5
- dev-dependabot/github_actions/actions/cache-3.0.11
- dev-dependabot/github_actions/actions/checkout-3.1.0
- dev-dev/2.x
This package is auto-updated.
Last update: 2023-01-26 01:06:12 UTC
README
Socius客户端是Socius API易于使用的客户端
安装
使用[composer(https://getcomposer.org.cn/)在项目中安装。
composer require grixu/socius-client
基本用法
首先用适当的数据填充你的.env
文件,用于连接到Socius API
SOCIUS_BASE_URL=""
SOCIUS_OAUTH=""
SOCIUS_CLIENT_ID=""
SOCIUS_CLIENT_KEY=""
然后你可以使用门面SociusClient
并简单地对API进行调用
use Grixu\SociusClient\SociusClientFacade as SociusClient; $query = SociusClient::product()->compose()->addFilter('name', 'SZKLO'); $query->fetch(); $data = $query->parse(DtoClass::class);
可以使用SociusClient
门面开始对Socius API进行查询,选择你想要查询的模块
product
productType
category
brand
description
language
operator
operatorRole
branch
customer
warehouse
order
order_element
调用上述函数之一后,您可以通过调用compose()
和以下方法之一添加过滤器、排序或请求相关数据
addFilter('column_name', ...'values')
addSort('column_name')
addInclude('column_name')
之后,只需调用fetch(page_number)
(或省略page_number
以获取所有数据)和getResults
来接收包含从Socius API接收到的数据的DataTransferObjectCollection
对象。
您还可以进行关系调用,下载包含模型之间关系详细信息的额外数据。通过在SociusClient
上调用这些方法之一,它们很容易使用
product_relationship
category_relationship
description_relationship
operator_relationship
warehouse_relationship
stock_relationship
order_relationship
order_element_relationship
更新日志
请参阅更新日志获取有关最近更改的更多信息。
贡献
请参阅贡献以获取详细信息。
安全性
如果您发现任何与安全相关的问题,请通过电子邮件mateusz.gostanski@gmail.com联系,而不是使用问题跟踪器。
鸣谢
许可
MIT许可(MIT)。请参阅许可文件获取更多信息。