prefixTables($table); $this->query->select($table, $alias, $options); return $this; } public function join($table, $alias = NULL, $condition = NULL, $arguments = []) { $table = $this->prefixTables($table); $this->query->join($table, $alias, $condition, $arguments); return $this; } public function prefixTables($sql) { $chado_schema_name = chado_get_schema_name('chado'); $drupal_schema_name = chado_get_schema_name('drupal'); $sql = preg_replace('/\{(.*?)\}/', $chado_schema_name.'.$1', $sql); $sql = preg_replace('/\[(\w+)\]/', $drupal_schema_name.'.$1', $sql); return $sql; } }