private function _createObjectFromData($name, $data)
    {
        try {
            $cls = new $name();
            foreach ($data as $key => $value) {
                if ($name !== 'stdClass' && !array_key_exists(strtolower($key), get_object_vars($cls))) {
                    var_dump(get_object_vars($cls));
                    continue;
                }
                $key = strtolower($key);
                $cls->$key = $value;
            }
            return $cls;
        } catch (\Exception $e) {
            return null;
        }
    }
private function _createObjectFromData($name, $data)
    {
        try {
            $cls = new $name();
            foreach ($data as $key => $value) {
                if ($name !== 'stdClass' && !array_key_exists(strtolower($key), get_object_vars($cls))) {
                    var_dump(get_object_vars($cls));
                    continue;
                }
                $key = strtolower($key);
                $cls->$key = $value;
            }
            return $cls;
        } catch (\Exception $e) {
            return null;
        }
    }
private function _createObjectFromData ( $ name , $ data ) { try { $ cls = new $ name ( ) ; foreach ( $ data as $ key => $ value ) { if ( $ name !== 'stdClass' && ! array_key_exists ( strtolower ( $ key ) , get_object_vars ( $ cls ) ) ) { var_dump ( get_object_vars ( $ cls ) ) ; continue ; } $ key = strtolower ( $ key ) ; $ cls -> $ key = $ value ; } return $ cls ; } catch ( \ Exception $ e ) { return null ; } }
Create a new object from data

@param string $name class name
@param mixed  $data data to use on class

@return new object
Create a new object from data