Get list of dictionary entities

The example code prints the country code and country name, and can be easily modify to return results for any other Dictionary method.


require('vendor/autoload.php');

use Emis\Http\Client;
use Emis\Document\Api\Proxy\Dictionary;
 
$client = new Client();
$client->setApi(Client::DOCUMENTS_API);
$client->setToken("YOUR_TOKEN");
 
$dictionary = new Dictionary($client);
 
foreach ($dictionary->getCountries() as $country) {
    echo $country->getCode() . " : " . $country->getName() . "\n";
}