aklump / collection_json
Php objects for working with hypermedia Collection+JSON (http://amundsen.com/media-types/)
0.9.1
2023-01-25 04:51 UTC
Requires
- php: >=7.3
- ext-json: *
- spatie/array-to-xml: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.5
README
Creating objects from JSON strings
The key method will be \AKlump\Http\CollectionJson\CollectionBase::import
, which converts JSON strings into the appropriate object based on it's format.
You can also create a Collection object from json using Collection->setContent().
Converting objects to JSON
Cast any object to string to get it's JSON equivalent.
Converting from Collection+JSON to JSON
Take a look at the class CollectionJsonToJson
.