Skip to content

elbcoast/ECNRiftConnector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECNRiftConnector

Build Status

Installation

Install the RiftConnector via composer:

$ composer require ecn/riftconnector:0.1.*

Usage

The RiftConnector comes along with a RiftService class that allows easy access to shards, zones and events.

Setup

To get a running RiftService instance, pass a connector instance to the constructor:

<?php

use GuzzleHttp\Client;
use Ecn\RiftConnector\Connector;
use Ecn\RiftConnector\RiftService;

$connector = new Connector(new Client(), Connector::EU_SERVER);
$service = new RiftService($connector);
        

Retrieving shard data

To retrieve a shard object, use the getShard() method:

// returns a Shard object
$shard = $service->getShard('Brutwacht');
        

Retrieving zones

You can query zones from the shard object:

// returns an array of Zone objects
$zones = $shard->getZones();
        

Alternatively, you can retrieve zones directly from the RiftService:

// returns an array of Zone objects
$zones = $service->getZones('Brutwacht');
        

Retrieving events

Similar to zones, events can be retrieved from the shard object or from the RiftConnector directly:

// returns an array of Event objects
$events = $shard->getEvents();

// returns an array of Event objects
$events = $service->getEvents('Brutwacht');
        

Additionally, you can check a zone directly for an event:

$zones = $shard->getZones();
 
if ($zones[0]->hasEvent()) {
    $event = $zones[0]->getEvent();
}
        

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages