src/Jaspersoft/Dto/DTOObject.php
public static function createFromJSON($json_obj)
    {
        $source_class = get_called_class();
        $result = new $source_class();

        foreach ($json_obj as $k => $v) {
            if (!empty($v)) {
                $result->$k = $v;
            }
        }
        return $result;
    }
public static function createFromJSON($json_obj)
    {
        $source_class = get_called_class();
        $result = new $source_class();

        foreach ($json_obj as $k => $v) {
            if (!empty($v)) {
                $result->$k = $v;
            }
        }
        return $result;
    }
public static function createFromJSON ( $ json_obj ) { $ source_class = get_called_class ( ) ; $ result = new $ source_class ( ) ; foreach ( $ json_obj as $ k => $ v ) { if ( ! empty ( $ v ) ) { $ result -> $ k = $ v ; } } return $ result ; }
If an object is composed of only properties, this will handle setting those properties as they match their field
names. If a class expects to have subcomponents or arrays, it should be overridden.


@param \stdClass $json_obj A decoded JSON response
@return mixed Some type of \Jaspersoft\Dto\* object
If an object is composed of only properties this will handle setting those properties as they match their field names . If a class expects to have subcomponents or arrays it should be overridden .