public static function getLastSQL($type = self::SQL_RETURN_TYPE_STRING, $withEagerLoading = false)
    {
        $queries = DB::getQueryLog();
        $ret = [' -------- last queries --------'];
        if ($withEagerLoading) {
            foreach ($queries as $query) {
                if (self::SQL_RETURN_TYPE_STRING == $type) {
                    $queryString = DBUtil::bindDataToQuery($query);
                    $ret[] = $queryString;
                } else {
                    $ret[] = $query;
                }
            }
        } else {
            $last_query = end($queries);
            if ($type == 'str') $last_query = DBUtil::bindDataToQuery($last_query);
            $ret[] = $last_query;
        }
        $ret = implode("\n\t\t", $ret);
        $ret = "\n" . $ret;
        return $ret;
    }