定制 simplyadmire/koop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

simplyadmire/koop

最新稳定版本:1.0.3

Composer 安装命令:

composer require simplyadmire/koop

包简介

Uitvragen Officiële Publicaties DROP / GVOP Koop

README 文档

README

PHP Client for the Koop publications API. Allows doing combined queries and returns an iteratable result object.

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.

The query result will fetch a single document

Official API document can be found at http://koop.overheid.nl/producten/gvop/documentatie

Code examples

Find the latest 10 (default limit) items for Barneveld

    $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

    $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
    $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:

    ...
    $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;
    }

统计信息

  • 总下载量: 24.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-23