public function hasJoin($aliasOrTable)
    {
        if ($this->join) {
            foreach ($this->join as $join) {
                $secondJoinParam = $join[1];
                if (is_array($secondJoinParam)) {
                    list($key, $val) = each($secondJoinParam);
                    if ($key == $aliasOrTable) {
                        return true;
                    }
                }
                if (is_string($secondJoinParam)) {
                    if ($secondJoinParam == $aliasOrTable) {
                        return true;
                    } else {
                        $pos = strrpos($secondJoinParam, ' ');
                        if ($pos) {
                            $alias = substr($secondJoinParam, $pos);
                            $alias = trim($alias, " \t`");
                            $table = substr($secondJoinParam, 0, $pos);
                            $table = trim($table);

                            if ($alias == $aliasOrTable || $table == $aliasOrTable) {
                                return true;
                            }
                        }
                    }
                }
            }
        }
        return false;
    }