public static function attrToArray($object){
        if(is_array($object) || is_object($object)) {
            $result = [];
            foreach ($object as $key => $value) {
                $result[$key] = self::attrToArray($value);
            }
            return $result;
        }
        return $object;
    }