public static function array_to_object($arr = null)
    {
        $obj = new stdClass();
        if ($arr) {
            foreach ($arr as $name => $value) {
                $obj->$name = $value;
            }
        }
        return $obj;
    }