Search and retrieve statements


require('vendor/autoload.php');
use Emis\Http\Client;
use Emis\Company\Api\Proxy\Search;
use Emis\Company\Api\Proxy\Statements;

$client = new Client();
$client->setApi(Client::COMPANY_API);
$client->setToken("YOUR_TOKEN");

$search = new Search($client);
$filter = array();
$filter[] = "country:PL";
$filter[] = "year:LY";
$accountFilter = array();
$accountFilter[] = "TR>50000000";

$result = $search->queryStatement($filter, $accountFilter);

//Get the stmtId of the first statement in the result.
$firstStatementId = $result->getResultList()[0]->getStmtId();

//Get extended information for the statement by using the "Statements" class.
$statements = new Statements($client);
$extendedStatement = $statements->getStatementById($firstStatementId, "usd", true);