This PHP library providing a simple way to translate the result of danielmewes/php-rql
library.
composer require th3mouk/rethinkdb-translator
It exists three transformations:
Translate::cursorToAssociativeArray
Translate::arrayObjectToAssociativeArray
Translate::arrayOfArrayObjectToAssociativeArray
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);
Feel free to improve this library.