RethinkDB Translator
This PHP library providing a simple way to translate the result of danielmewes/php-rql
library.
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.