コード例 #1
0
 /**
  * Returns the latest primary inserted using this statement.
  *
  * @param string|null $table table name or sequence to get last insert value from
  * @param string|null $column the name of the column representing the primary key
  * @return string
  */
 public function lastInsertId($table = null, $column = null)
 {
     $row = null;
     if ($column && $this->columnCount()) {
         $row = $this->fetch('assoc');
     }
     if (isset($row[$column])) {
         return $row[$column];
     }
     return $this->_driver->lastInsertId($table, $column);
 }
コード例 #2
0
 /**
  * Quotes identifiers in "order by" expression objects
  *
  * @param \Cake\Database\Expression\IdentifierExpression $expression
  * @return void
  */
 protected function _quoteIndetifierExpression(IdentifierExpression $expression)
 {
     $expression->setIdentifier($this->_driver->quoteIdentifier($expression->getIdentifier()));
 }
コード例 #3
0
ファイル: Connection.php プロジェクト: wepbunny/cake2
 /**
  * Quotes a database identifier (a column name, table name, etc..) to
  * be used safely in queries without the risk of using reserved words.
  *
  * @param string $identifier The identifier to quote.
  * @return string
  */
 public function quoteIdentifier($identifier)
 {
     return $this->_driver->quoteIdentifier($identifier);
 }
コード例 #4
0
 /**
  * Generate the SQL to drop a table.
  *
  * @param \Cake\Database\Schema\Table $table Table instance
  * @return array SQL statements to drop a table.
  */
 public function dropTableSql(Table $table)
 {
     $sql = sprintf('DROP TABLE %s', $this->_driver->quoteIdentifier($table->name()));
     return [$sql];
 }