devilcius/eventful-api

PHP API client for EventFul webservices

v0.4 2016-10-11 11:53 UTC

This package is not auto-updated.

Last update: 2024-11-23 20:04:37 UTC


README

CircleCI Php EventFul Api Client

A PHP client library for the EventFul API

Installation

composer require devilcius/eventful-api

Quick Start

The main entry point of the library is the EventFul\EventFulApiClient class. Once you have an EventFulApiClient instance, you can easily access all the API services and call their methods. Any use of the Eventful API requires a valid, current application key. You can obtain one here

Let's try to find an event using the search method of the Event service:

<?php

// options:
$apiKey = 'secretAppKey'; // mandatory
$endPoint = 'http://api.evdb.com'; // optional
$timeout = 10; // optional
$userAgent = 'EventFul PHP Client'; // optional
$apiClient = new EventFulApiClient($apiKey, $endPoint, $timeout, $userAgent);

$service = $apiClient->getEventService();
$params['page_number'] = 1;
$params['page_size'] = 10;
$params['category'] = 'music';
$params['location'] = 'Madrid';
$result = $service->search($params);
foreach ($result->events->event as $event) {
    echo $event->title;
}

Tests

phpunit

Methods