Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapper between json and php class

I'm starting a new project that uses couchbase (a noSQL database that stores objects in json format), together with php.

The thing is that it would be really easy to work with them both if I could have something that maps json into one of my own php classes (and vice versa).

Do you know any library for that?

like image 981
ThisIsErico Avatar asked Nov 25 '25 12:11

ThisIsErico


1 Answers

One way to start is to look (or use) the "Basement" Library that is available here: https://github.com/Basement/Basement

This library uses json_decode/encode. Hope that will help you.

like image 181
Tug Grall Avatar answered Nov 27 '25 00:11

Tug Grall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!