/** * 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); }
/** * 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())); }
/** * 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); }
/** * 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]; }