Skip to content

Th3Mouk/rethinkdb-translator

Repository files navigation

RethinkDB Translator

This PHP library providing a simple way to translate the result of danielmewes/php-rql library.

Latest Stable Version Latest Unstable Version Total Downloads License

Build Status Scrutinizer Code Quality

Installation

composer require th3mouk/rethinkdb-translator

Usage

It exists three transformations:

  • Translate::cursorToAssociativeArray
  • Translate::arrayObjectToAssociativeArray
  • Translate::arrayOfArrayObjectToAssociativeArray

Options

You can pass an array of options to each of the available methods, here are the available options :

Option Description Value Default
dateTimeToString Should the dateTime instances be converted to strings (ISO8601) boolean true

An example :

$options = ['dateTimeToString' => false];

// raw $data from RethinkDB
Translate::cursorToAssociativeArray($data, $options);

Please

Feel free to improve this library.