library zorro-data-schema
Tool to convert objects to arrays and vice versa according to data schema
wookieb/zorro-data-schema
Tool to convert objects to arrays and vice versa according to data schema
- Tuesday, September 17, 2013
- by wookieb
- Repository
- 2 Watchers
- 2 Stars
- 10 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 1 Open issues
- 3 Versions
- 0 % Grown
Zorro Data Schema
Tool to convert objects to arrays and vice versa according to data schema, (*1)
Use cases
- Retrieving and sending data to many environments
- REST API
- Serialization layer for json and other formats
Example
Just run, (*2)
php example/test.php
Example result, (*3)
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, (*4)
dev-master
9999999-dev
Tool to convert objects to arrays and vice versa according to data schema
Sources
Download
MIT
The Requires
The Development Requires
schema
serialization
deserialization
data schema
0.2
0.2.0.0
Tool to convert objects to arrays and vice versa according to data schema
Sources
Download
MIT
The Requires
The Development Requires
schema
serialization
deserialization
data schema
0.1
0.1.0.0
Tool to convert objects to arrays and vice versa according to data schema
Sources
Download
MIT
The Requires
The Development Requires
schema
serialization
deserialization
data schema