2017 © Pedro Peláez
 

library koop

Uitvragen Officiële Publicaties DROP / GVOP Koop

image

simplyadmire/koop

Uitvragen Officiële Publicaties DROP / GVOP Koop

  • Monday, September 25, 2017
  • by simplyadmire
  • Repository
  • 2 Watchers
  • 1 Stars
  • 2,191 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 28 % Grown

The README.md

Koop Client

PHP Client for the Koop publications API. Allows doing combined queries and returns an iteratable result object., (*1)

Currently only a simple publication object with a title, publication date and original url is returned. But this is perfectly suitable for a website search client pointing to the official source on officielebekendmakingen.nl., (*2)

The query result will fetch a single document, (*3)

Official API document can be found at http://koop.overheid.nl/producten/gvop/documentatie, (*4)

Code examples

Find the latest 10 (default limit) items for Barneveld, (*5)

    $client = new \SimplyAdmire\Koop\Client(
        new \SimplyAdmire\Koop\Configuration()
    );

    $query = new \SimplyAdmire\Koop\Search\Query();
    $query
        ->matching(
            $query->exactMatch('creator', 'Barneveld')
        );

    $result = $client->execute($query);

Find the latest 10 items for either Barneveld or Ede, (*6)

    $query
        ->matching(
            $query->logicalOr(
                $query->exactMatch('creator', 'Barneveld'),
                $query->exactMatch('creator', 'Ede')
            )
        );

Find max 50 items about the term 'paspoort' published by Barneveld or Ede where: * Barneveld published since 01-01-2014 * Ede published since 01-01-2015, (*7)

    $query
        ->setLimit(50)
        ->matching(
            $query->logicalOr(
                $query->logicalAnd(
                    $query->exactMatch('creator', 'Barneveld'),
                    $query->since(new \DateTime('2014-01-01')),
                    $query->fullText('paspoort')
                ),
                $query->logicalAnd(
                    $query->exactMatch('creator', 'Ede'),
                    $query->since(new \DateTime('2015-01-01')),
                    $query->fullText('paspoort')
                )
            )
        );

Iterating over the resut:, (*8)

    ...
    $result = $client->execute($query);

    /** @var \SimplyAdmire\Koop\Model\Publication $publication */
    foreach ($result as $publication)
    {
        echo $publication->getPublicationDate()->format('d-m-Y') . ' ' . $publication->getTitle() . PHP_EOL;
    }

The Versions

25/09 2017

dev-master

9999999-dev

Uitvragen Officiële Publicaties DROP / GVOP Koop

  Sources   Download

MIT

The Requires

 

by Rens Admiraal

drop gvop koop officiele bekendmakingen

25/09 2017

0.0.2

0.0.2.0

Uitvragen Officiële Publicaties DROP / GVOP Koop

  Sources   Download

MIT

The Requires

 

by Rens Admiraal

drop gvop koop officiele bekendmakingen

23/03 2017

0.0.1

0.0.1.0

Uitvragen Officiële Publicaties DROP / GVOP Koop

  Sources   Download

MIT

The Requires

 

by Rens Admiraal

drop gvop koop officiele bekendmakingen