public static function insertMultiple($table, $data)
    {
        $columns = [];
        $i = 0;

        foreach($data as $dataRow)
        {
            foreach($dataRow as $key=>$value)
            {
                if(!array_key_exists($key, $columns))
                {
                    $columns[$key] = $i;
                    $i++;
                }
            }
        }

        $rows = [];

        foreach($data as $dataRow)
        {
            $row = [];
            foreach($columns as $key=>$i)
            {
                $row[$i] = array_key_exists($key, $dataRow) ? $dataRow[$key] : null;
            }
            $rows[] = $row;
        }
        return self::db()->createCommand()->batchInsert($table, array_keys($columns), $rows)->execute();
    }