h4kuna/ares

Provides information about subjects by their identification number from the ARES database (in Czech Republic).

v1.4.12 2021-05-19 09:32 UTC

README

Build Status Scrutinizer Code Quality Downloads this Month Latest Stable Version Coverage Status Total Downloads License

More information about versions is in changelog.

Installation to project

The best way to install h4kuna/ares is using Composer:

$ composer require h4kuna/ares

Download information about customer via his IN.

Example

Load data by one identification number

$ares = new h4kuna\Ares\Ares();
try {
    $response = $ares->loadData('87744473');
    /* @var $response h4kuna\Ares\Data */
    var_dump($response);
} catch (h4kuna\Ares\Exceptions\IdentificationNumberNotFoundException $e) {
    // log identification number, why is bad? Or make nothing.
}

Load data by many identification numbers

/** @var \h4kuna\Ares\Ares $ares */
$numbers = ['25596641', '26713250', '27082440', '11111111'];
$res = $ares->loadByIdentificationNumbers($numbers);

if ($res[$ares::RESULT_FAILED] !== []) {
    var_dump($res[$ares::RESULT_FAILED]);
}

foreach ($res[$ares::RESULT_SUCCESS] as $r) {
    var_dump($r->company);
}