12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- class ChadoDatabaseConnection extends DatabaseConnection_pgsql {
-
- function __construct(array $connection_options = array()) {
- parent::__construct($connection_options);
-
-
- $psearch = $this->prefixSearch;
- $preplace = $this->prefixReplace;
-
- $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;
- }
- }
|