PHP code example of itk-dev / datafordeler-php-client

1. Go to this page and download the library: Download itk-dev/datafordeler-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

itk-dev / datafordeler-php-client example snippets


use ItkDev\Datafordeler\Client;
use ItkDev\Datafordeler\Service\CVR\HentCVRData\V1 as HentCVRDataV1;
use ItkDev\Datafordeler\Service\BBR\BBRPublic\V1 as BBRPublicV1;

$certPath = «path to pem certificate»;
$client = Client::createFromCertPath($certPath);
$service = new HentCVRDataV1($client);

// Get data from just a CVR.
$data = $hentCVRData->hentVirksomhedMedCVRNummer(12345678);
…
// Get data using more parameters.
$data = $hentCVRData->hentVirksomhedMedCVRNummer([
  'pCVRNummer' => 12345678,
  'pInkluderBeskaeftigelse' => true,
  'pInkluderProduktionsenhedsnumre' => false,
]);

$username = '…';
$password = '…'
$client = Client::createFromUsernameAndPassword($username, $password);
$service = new BBRPublicV1($client);
$service->bbrsag([]);