Download the PHP package abgeo/json-to-popo without Composer
On this page you can find all versions of the php package abgeo/json-to-popo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abgeo/json-to-popo
More information about abgeo/json-to-popo
Files in abgeo/json-to-popo
Package json-to-popo
Short Description Fill Plain Old PHP Object with JSON content.
License MIT
Homepage https://github.com/ABGEO07/json-to-popo
Informations about the package json-to-popo
json-to-popo
Fill Plain Old PHP Object with JSON content.
Installation
You can install this library with Composer:
composer require abgeo/json-to-popo
Usage
Include composer autoloader in your main file (Ex.: index.php)
require __DIR__.'/../vendor/autoload.php';
Consider that you have example.json
with the following content:
and several POPO classes to represent this JSON data:
Department.php
Position.php
Person.php
Note: All POPO properties must have full qualified @var
annotation with the correct data type.
Now you want to convert this JSON to POPO with relations. This package gives you this ability.
Let's create new ABGEO\POPO\Composer
object and read example.json
content:
Time for magic! Call composeObject()
with the contents of JSON and the main class, and this will give you POPO:
Print $resultObject
:
See full example here.
Changelog
Please see CHANGELOG for details.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Authors
- Temuri Takalandze - Initial work
License
Copyright © 2020 Temuri Takalandze.
Released under the MIT license.
All versions of json-to-popo with dependencies
ext-json Version *