Skip to content

A PHP wrapper for the DofusDb API, providing an easy and efficient way to access and interact with Dofus game data in PHP applications. It simplifies API calls and data handling for developers working on Dofus-related projects.

License

Notifications You must be signed in to change notification settings

dofus-odyssey/dofusdb-php-wrapper

Repository files navigation

DofusDB PHP Wrapper

CI Status

Installation

composer require dofus-odyssey/dofusdb-php-wrapper

Usage

use DofusOdyssey\DofusdbPhpWrapper\QueryBuilder;
use DofusOdyssey\DofusdbPhpWrapper\ApiEndpoint;

// Find all breeds
$queryBuilder = new QueryBuilder(ApiEndpoint::BREEDS);
$queryBuilder->getQuery()->execute();

// Find all breed with a name equals to "Feca"
$queryBuilder = new QueryBuilder(ApiEndpoint::BREEDS);
$queryBuilder
    ->andWhere([
        ['field' => 'shortName.en', 'operator' => '=', 'value' => 'Feca'],
    ])
    ->getQuery()
    ->execute();

// Find all breed with a name equals to "Feca" or "Enutrof"
$queryBuilder = new QueryBuilder(ApiEndpoint::BREEDS);
$queryBuilder
    ->orWhere([
        ['field' => 'shortName.en', 'operator' => '=', 'value' => 'Feca'],
        ['field' => 'shortName.en', 'operator' => '=', 'value' => 'Enutrof'],
    ])
    ->getQuery()
    ->execute();

// Get the query parameters in string format
$queryBuilder = new QueryBuilder(ApiEndpoint::BREEDS);
$queryBuilder
    ->orWhere([
        ['field' => 'shortName.en', 'operator' => '=', 'value' => 'Feca'],
        ['field' => 'shortName.en', 'operator' => '=', 'value' => 'Enutrof'],
    ])
    ->getQuery()
    ->getRawQueryString();
// $or[0][shortName.en]=Feca&$or[1][shortName.en]=Enutrof

License

This project is licensed under the MIT License. For more details, see the LICENSE file.

About

A PHP wrapper for the DofusDb API, providing an easy and efficient way to access and interact with Dofus game data in PHP applications. It simplifies API calls and data handling for developers working on Dofus-related projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages