2017 © Pedro Peláez
 

library php-gson

PHP GSON equivalent - simple entity mapper. JSON to object and object to JSON

image

archangeldesign/php-gson

PHP GSON equivalent - simple entity mapper. JSON to object and object to JSON

  • Thursday, May 10, 2018
  • by ArchangelDesign
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

php-gson

Build Status Coverage Status, (*1)

Zero dependency simple PHP entity mapper. JSON String to Objcet and Object to JSON String., (*2)

Installation, (*3)

composer require archangeldesign/php-gson

or download and include autoload.php, (*4)

include 'php-gson/src/PHPGson/autoload.php';

Usage, (*5)

Without instance. Object will be created using given class name., (*6)

$complexObject = null;
$success = \PHPGson\Gson::fromJson(
    $complexObject,
    '{"age":35, "hydratorTestObject":{"username":"raff"}}',
    \PHPGson\Extractor::EXTRACTION_MODE_METHOD,
    ComplexHydrationObject::class
);

With manual instantiation. Sub-objects will be created automatically in both cases., (*7)

$complexObject = new ComplexHydrationObject();
$success = \PHPGson\Gson::fromJson(
    $complexObject,
    '{"age":35, "hydratorTestObject":{"username":"raff"}}'
);
$object = new MainObject();
$jsonString = Gson::toJson($object);

The Versions

10/05 2018

dev-master

9999999-dev http://archangel-design.com

PHP GSON equivalent - simple entity mapper. JSON to object and object to JSON

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

by Rafal Martinez-Marjanski

entity mapper gson

10/05 2018

0.1.0-rc1

0.1.0.0-RC1 http://archangel-design.com

PHP GSON equivalent - simple entity mapper. JSON to object and object to JSON

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

by Rafal Martinez-Marjanski

entity mapper gson