Pop\Db\Sql::getDbType PHP Метод

getDbType() публичный Метод

Get the current database type.
public getDbType ( ) : integer
Результат integer
    public function getDbType()
    {
        return $this->dbType;
    }

Usage Example

Пример #1
0
 /**
  * Set the ORDER BY value
  *
  * @param mixed  $by
  * @param string $order
  * @return AbstractSql
  */
 public function orderBy($by, $order = 'ASC')
 {
     $byColumns = null;
     if (is_array($by)) {
         $quotedAry = [];
         foreach ($by as $value) {
             $quotedAry[] = $this->sql->quoteId(trim($value));
         }
         $byColumns = implode(', ', $quotedAry);
     } else {
         if (strpos($by, ',') !== false) {
             $ary = explode(',', $by);
             $quotedAry = [];
             foreach ($ary as $value) {
                 $quotedAry[] = $this->sql->quoteId(trim($value));
             }
             $byColumns = implode(', ', $quotedAry);
         } else {
             $byColumns = $this->sql->quoteId(trim($by));
         }
     }
     $this->orderBy .= (null !== $this->orderBy ? ', ' : '') . $byColumns;
     $order = strtoupper($order);
     if (strpos($order, 'RAND') !== false) {
         $this->orderBy = $this->sql->getDbType() == \Pop\Db\Sql::SQLITE ? ' RANDOM()' : ' RAND()';
     } else {
         if ($order == 'ASC' || $order == 'DESC') {
             $this->orderBy .= ' ' . $order;
         }
     }
     return $this;
 }
All Usage Examples Of Pop\Db\Sql::getDbType