th3mouk/rethinkdb-translator

Convert cursor and array objects to associative array

1.1.1 2019-07-24 14:27 UTC

This package is auto-updated.

Last update: 2024-03-27 22:21:37 UTC


README

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.