ayctor / sireneapi

Sirene API 的小型 PHP 客户端库

1.1.1 2020-05-26 12:33 UTC

README

这是一个用于使用 Sirene API 的小型 PHP 客户端库。

有关可用方法的详细信息,请参阅官方文档

安装

composer require ayctor/sireneapi

使用

V1

文档即将到来

V3

use SireneApi\SireneApi;

$api = new SireneApi;

// Get all companies
$companies = $api->companies()->all();
// Get company by SIREN number
$company = $api->companies()->getBySiren('552081317');
// Get companies by other fields
$companies = SirenApi::companies()->getBy('code_postal', 77100);
// Get companies by other fields
$companies = $api->companies()->getBy([
    'code_postal' => 77100,
]);

// Get all estabslishments
$establishments = $api->establishments()->all();
// Get establishments by SIREN number
$establishments = $api->establishments()->getBySiren('552081317');
// Get establishment by SIRET number
$establishment = $api->establishments()->getBySiret('55208131785027');
// Get establishments by other fields
$establishments = $api->establishments()->getBy('code_postal', 77100);
// Get establishments by other fields
$establishments = SirenApi::establishments()->getBy([
    'code_postal' => 77100,
]);

错误

getBySiret()

如果您使用此函数检索公司,它将抛出异常

getBy()

如果您使用此函数,并且第一个参数是字符串而没有第二个参数,它将抛出异常

许可证

MIT