prefixSearch; $preplace = $this->prefixReplace; // Reset the prefix serach and replace $this->prefixSearch = array(); $this->prefixReplace = array(); $tables = chado_get_table_names(TRUE); foreach ($tables as $table) { $this->prefixSearch[] = '{' . $table . '}'; $this->prefixReplace[] = 'chado.' . $table; } $this->prefixSearch = array_merge($this->prefixSearch, $psearch); $this->prefixReplace = array_merge($this->prefixReplace, $preplace); } public function prefixTables($sql) { $sql = str_replace($this->prefixSearch, $this->prefixReplace, $sql); return $sql; } }