map nested JSON structures onto PHP classes