/** * Set the database object * * @param \Pop\Db\Db $db * @return \Pop\Db\Sql */ public function setDb(Db $db) { $this->db = $db; $adapter = strtolower($this->db->getAdapterType()); if (strpos($adapter, 'mysql') !== false) { $this->dbType = self::MYSQL; $this->quoteIdType = self::BACKTICK; } else { if (strpos($adapter, 'oracle') !== false) { $this->dbType = self::ORACLE; $this->quoteIdType = self::DOUBLE_QUOTE; } else { if (strpos($adapter, 'pgsql') !== false) { $this->dbType = self::PGSQL; $this->quoteIdType = self::DOUBLE_QUOTE; } else { if (strpos($adapter, 'sqlite') !== false) { $this->dbType = self::SQLITE; $this->quoteIdType = self::DOUBLE_QUOTE; } else { if (strpos($adapter, 'sqlsrv') !== false) { $this->dbType = self::SQLSRV; $this->quoteIdType = self::BRACKET; } } } } } return $this; }