src/Jaspersoft/Dto/Resource/CompositeResource.php
public static function createFromJSON($json_data, $type = null)
    {
        $className = explode('\\', $type);
        $className = lcfirst(end($className));

        $allFields = parent::createFromJSON($json_data, $type);
        $compositeFields = CompositeDTOMapper::compositeFields(get_class($allFields));
        foreach ($compositeFields as $key) {
            if (isset($allFields->$key)) {
                $allFields->$key = self::synthesizeSubresource($key, $json_data[$key], $className);
            }
        }
        return $allFields;

    }
public static function createFromJSON($json_data, $type = null)
    {
        $className = explode('\\', $type);
        $className = lcfirst(end($className));

        $allFields = parent::createFromJSON($json_data, $type);
        $compositeFields = CompositeDTOMapper::compositeFields(get_class($allFields));
        foreach ($compositeFields as $key) {
            if (isset($allFields->$key)) {
                $allFields->$key = self::synthesizeSubresource($key, $json_data[$key], $className);
            }
        }
        return $allFields;

    }
public static function createFromJSON ( $ json_data , $ type = null ) { $ className = explode ( '\\' , $ type ) ; $ className = lcfirst ( end ( $ className ) ) ; $ allFields = parent :: createFromJSON ( $ json_data , $ type ) ; $ compositeFields = CompositeDTOMapper :: compositeFields ( get_class ( $ allFields ) ) ; foreach ( $ compositeFields as $ key ) { if ( isset ( $ allFields -> $ key ) ) { $ allFields -> $ key = self :: synthesizeSubresource ( $ key , $ json_data [ $ key ] , $ className ) ; } } return $ allFields ; }
This function takes an array of elements provided by a decoded response from the server and uses
it to create a DTO representing the resource being deserialized.


@param $json_data array
@param $type string The class type to be created
@return array
This function takes an array of elements provided by a decoded response from the server and uses it to create a DTO representing the resource being deserialized .