Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wookieb/zorro-data-schema
Tool to convert objects to arrays and vice versa according to data schema
https://github.com/wookieb/zorro-data-schema
Last synced: about 1 month ago
JSON representation
Tool to convert objects to arrays and vice versa according to data schema
- Host: GitHub
- URL: https://github.com/wookieb/zorro-data-schema
- Owner: wookieb
- License: mit
- Created: 2013-07-28T07:30:06.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-16T23:09:50.000Z (over 11 years ago)
- Last Synced: 2024-04-17T21:32:07.557Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 684 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Zorro Data Schema
[![Build Status](https://travis-ci.org/wookieb/zorro-data-schema.png?branch=master)](https://travis-ci.org/wookieb/zorro-data-schema)
Tool to convert objects to arrays and vice versa according to data schema## Use cases
* Retrieving and sending data to many environments
* REST API
* Serialization layer for json and other formats## Example
Just run
```
php example/test.php
```Example result
```
Raw data
Array
(
[name] => Łukasz
[registrationDate] => 1123818123
[status] => ACTIVE
[addresses] => Array
(
[0] => Array
(
[street] => Sportowa
[city] => Gdynia
)[1] => Array
(
[street] => Zamkowa
[city] => Gdańsk
))
)
Transformed to "User" type:
User Object
(
[name:User:private] => Łukasz
[registrationDate:User:private] => DateTime Object
(
[date] => 2005-08-12 03:42:03
[timezone_type] => 1
[timezone] => +00:00
)[status:User:private] => 1
[addresses:User:private] => Array
(
[0] => Address Object
(
[street:Address:private] => Sportowa
[city:Address:private] => Gdynia
)[1] => Address Object
(
[street:Address:private] => Zamkowa
[city:Address:private] => Gdańsk
))
)
Extracted data from object of "User" type:
Array
(
[name] => Łukasz
[registrationDate] => 2005-08-12T03:42:03+0000
[status] => ACTIVE
[addresses] => Array
(
[0] => Array
(
[street] => Sportowa
[city] => Gdynia
)[1] => Array
(
[street] => Zamkowa
[city] => Gdańsk
))
)
```## Documentation
[see documentation](docs/getting_started.md)