- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/db/connection.php
- Класс: BitrixMainDBConnection
- Вызов: Connection::getAffectedRowsCount
public function getAffectedRowsCount();
/*********************************************************
* DDL
*********************************************************/
/**
* Checks if a table exists.
*
* @param string $tableName The table name.
*
* @return boolean
*/
abstract public function isTableExists($tableName);
/**
* Checks if an index exists.
* Actual columns in the index may differ from requested.
* $columns may present a "prefix" of actual index columns.
*
* @param string $tableName A table name.
* @param array $columns An array of columns in the index.
*
* @return boolean
* @throws SqlQueryException
*/
abstract public function isIndexExists($tableName, array $columns);
/**
* Returns the name of an index.
*
* @param string $tableName A table name.
* @param array $columns An array of columns in the index.
* @param bool $strict The flag indicating that the columns in the index must exactly match the columns in the $arColumns parameter.
*
* @return string|null Name of the index or null if the index doesn't exist.
*/
abstract public function getIndexName($tableName, array $columns, $strict = false);
/**
* Returns fields objects according to the columns of a table.
* Table must exist.
*
* @param string $tableName The table name.
*
* @return ScalarField[] An array of objects with columns information.
* @throws SqlQueryException
*/
abstract public function getTableFields($tableName);
/**
* @param string $tableName Name of the new table.
* @param ScalarField[] $fields Array with columns descriptions.
* @param string[] $primary Array with primary key column names.
* @param string[] $autoincrement Which columns will be auto incremented ones.
*
* @return void
* @throws SqlQueryException
*/
abstract public function createTable($tableName, $fields, $primary = array(), $autoincrement = array());
/**
* Creates primary index on column(s)
* @api
*
* @param string $tableName Name of the table.
* @param string|string[] $columnNames Name of the column or array of column names to be included into the index.
*
* @return Result
* @throws SqlQueryException
*/
public function createPrimaryIndex($tableName, $columnNames)
{
if (!is_array($columnNames))
{
$columnNames = array($columnNames);
}
foreach ($columnNames as &$columnName)
{
$columnName = $this->getSqlHelper()->quote($columnName);
}
$sql = 'ALTER TABLE '.$this->getSqlHelper()->quote($tableName).' ADD PRIMARY KEY('.join(', ', $columnNames).')';
return $this->query($sql);
}