$value) { if (is_array($value)) { $r->data[$key] = $this->hydrate($value, $model, $config, $key); } else { $r->data[$key] = $value; } } $collection->data[] = $r; } return $collection; } }