__findMethods['sql'] = true; parent::__construct($id, $table, $ds); } function _findSql($state, $query, $results = array()) { if ($state == 'before') { // prepend the table with the database name $this->_tablePrefix = $this->tablePrefix; $conn =& ConnectionManager::getInstance(); $db_name = $conn->config->{$this->useDbConfig}['database']; $this->tablePrefix = $db_name .'.'. $this->_tablePrefix; $query['returnSQL'] = true; return $query; } elseif ($state == 'after') { $this->tablePrefix = $this->_tablePrefix; return $results; } } } ?>