getAdapterType() 공개 메소드

Get the database adapter type.
public getAdapterType ( ) : string
리턴 string
예제 #1
0
 /**
  * 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;
 }