1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?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;
- }
- }
|