repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.getDatabasePlatformVersion | private function getDatabasePlatformVersion()
{
// Driver does not support version specific platforms.
if (! $this->_driver instanceof VersionAwarePlatformDriver) {
return null;
}
// Explicit platform version requested (supersedes auto-detection).
if (isset($this... | php | private function getDatabasePlatformVersion()
{
// Driver does not support version specific platforms.
if (! $this->_driver instanceof VersionAwarePlatformDriver) {
return null;
}
// Explicit platform version requested (supersedes auto-detection).
if (isset($this... | [
"private",
"function",
"getDatabasePlatformVersion",
"(",
")",
"{",
"// Driver does not support version specific platforms.",
"if",
"(",
"!",
"$",
"this",
"->",
"_driver",
"instanceof",
"VersionAwarePlatformDriver",
")",
"{",
"return",
"null",
";",
"}",
"// Explicit platf... | Returns the version of the related platform if applicable.
Returns null if either the driver is not capable to create version
specific platform instances, no explicit server version was specified
or the underlying driver connection cannot determine the platform
version without having to query it (performance reasons).... | [
"Returns",
"the",
"version",
"of",
"the",
"related",
"platform",
"if",
"applicable",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L403-L452 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.getServerVersion | private function getServerVersion()
{
$connection = $this->getWrappedConnection();
// Automatic platform version detection.
if ($connection instanceof ServerInfoAwareConnection && ! $connection->requiresQueryForServerVersion()) {
return $connection->getServerVersion();
}... | php | private function getServerVersion()
{
$connection = $this->getWrappedConnection();
// Automatic platform version detection.
if ($connection instanceof ServerInfoAwareConnection && ! $connection->requiresQueryForServerVersion()) {
return $connection->getServerVersion();
}... | [
"private",
"function",
"getServerVersion",
"(",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getWrappedConnection",
"(",
")",
";",
"// Automatic platform version detection.",
"if",
"(",
"$",
"connection",
"instanceof",
"ServerInfoAwareConnection",
"&&",
"!",
... | Returns the database server version if the underlying driver supports it.
@return string|null | [
"Returns",
"the",
"database",
"server",
"version",
"if",
"the",
"underlying",
"driver",
"supports",
"it",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L459-L470 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.setAutoCommit | public function setAutoCommit($autoCommit)
{
$autoCommit = (bool) $autoCommit;
// Mode not changed, no-op.
if ($autoCommit === $this->autoCommit) {
return;
}
$this->autoCommit = $autoCommit;
// Commit all currently active transactions if any when switch... | php | public function setAutoCommit($autoCommit)
{
$autoCommit = (bool) $autoCommit;
// Mode not changed, no-op.
if ($autoCommit === $this->autoCommit) {
return;
}
$this->autoCommit = $autoCommit;
// Commit all currently active transactions if any when switch... | [
"public",
"function",
"setAutoCommit",
"(",
"$",
"autoCommit",
")",
"{",
"$",
"autoCommit",
"=",
"(",
"bool",
")",
"$",
"autoCommit",
";",
"// Mode not changed, no-op.",
"if",
"(",
"$",
"autoCommit",
"===",
"$",
"this",
"->",
"autoCommit",
")",
"{",
"return"... | Sets auto-commit mode for this connection.
If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual
transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either
the method commit or the method rollback. By defa... | [
"Sets",
"auto",
"-",
"commit",
"mode",
"for",
"this",
"connection",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L498-L515 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.fetchAssoc | public function fetchAssoc($statement, array $params = [], array $types = [])
{
return $this->executeQuery($statement, $params, $types)->fetch(FetchMode::ASSOCIATIVE);
} | php | public function fetchAssoc($statement, array $params = [], array $types = [])
{
return $this->executeQuery($statement, $params, $types)->fetch(FetchMode::ASSOCIATIVE);
} | [
"public",
"function",
"fetchAssoc",
"(",
"$",
"statement",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"array",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"executeQuery",
"(",
"$",
"statement",
",",
"$",
"params",
",",
... | Prepares and executes an SQL query and returns the first row of the result
as an associative array.
@param string $statement The SQL query.
@param mixed[] $params The query parameters.
@param int[]|string[] $types The query parameter types.
@return mixed[]|false False is returned if no rows are ... | [
"Prepares",
"and",
"executes",
"an",
"SQL",
"query",
"and",
"returns",
"the",
"first",
"row",
"of",
"the",
"result",
"as",
"an",
"associative",
"array",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L541-L544 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.fetchArray | public function fetchArray($statement, array $params = [], array $types = [])
{
return $this->executeQuery($statement, $params, $types)->fetch(FetchMode::NUMERIC);
} | php | public function fetchArray($statement, array $params = [], array $types = [])
{
return $this->executeQuery($statement, $params, $types)->fetch(FetchMode::NUMERIC);
} | [
"public",
"function",
"fetchArray",
"(",
"$",
"statement",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"array",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"executeQuery",
"(",
"$",
"statement",
",",
"$",
"params",
",",
... | Prepares and executes an SQL query and returns the first row of the result
as a numerically indexed array.
@param string $statement The SQL query to be executed.
@param mixed[] $params The prepared statement params.
@param int[]|string[] $types The query parameter types.
@return mixed[]|false Fa... | [
"Prepares",
"and",
"executes",
"an",
"SQL",
"query",
"and",
"returns",
"the",
"first",
"row",
"of",
"the",
"result",
"as",
"a",
"numerically",
"indexed",
"array",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L556-L559 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.addIdentifierCondition | private function addIdentifierCondition(
array $identifier,
array &$columns,
array &$values,
array &$conditions
) : void {
$platform = $this->getDatabasePlatform();
foreach ($identifier as $columnName => $value) {
if ($value === null) {
$c... | php | private function addIdentifierCondition(
array $identifier,
array &$columns,
array &$values,
array &$conditions
) : void {
$platform = $this->getDatabasePlatform();
foreach ($identifier as $columnName => $value) {
if ($value === null) {
$c... | [
"private",
"function",
"addIdentifierCondition",
"(",
"array",
"$",
"identifier",
",",
"array",
"&",
"$",
"columns",
",",
"array",
"&",
"$",
"values",
",",
"array",
"&",
"$",
"conditions",
")",
":",
"void",
"{",
"$",
"platform",
"=",
"$",
"this",
"->",
... | Adds identifier condition to the query components
@param mixed[] $identifier Map of key columns to their values
@param string[] $columns Column names
@param mixed[] $values Column values
@param string[] $conditions Key conditions
@throws DBALException | [
"Adds",
"identifier",
"condition",
"to",
"the",
"query",
"components"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L609-L627 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.delete | public function delete($tableExpression, array $identifier, array $types = [])
{
if (empty($identifier)) {
throw InvalidArgumentException::fromEmptyCriteria();
}
$columns = $values = $conditions = [];
$this->addIdentifierCondition($identifier, $columns, $values, $condit... | php | public function delete($tableExpression, array $identifier, array $types = [])
{
if (empty($identifier)) {
throw InvalidArgumentException::fromEmptyCriteria();
}
$columns = $values = $conditions = [];
$this->addIdentifierCondition($identifier, $columns, $values, $condit... | [
"public",
"function",
"delete",
"(",
"$",
"tableExpression",
",",
"array",
"$",
"identifier",
",",
"array",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"identifier",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"from... | Executes an SQL DELETE statement on a table.
Table expression and columns are not escaped and are not safe for user-input.
@param string $tableExpression The expression of the table on which to delete.
@param mixed[] $identifier The deletion criteria. An associative array containing column-value p... | [
"Executes",
"an",
"SQL",
"DELETE",
"statement",
"on",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L643-L658 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.setTransactionIsolation | public function setTransactionIsolation($level)
{
$this->transactionIsolationLevel = $level;
return $this->executeUpdate($this->getDatabasePlatform()->getSetTransactionIsolationSQL($level));
} | php | public function setTransactionIsolation($level)
{
$this->transactionIsolationLevel = $level;
return $this->executeUpdate($this->getDatabasePlatform()->getSetTransactionIsolationSQL($level));
} | [
"public",
"function",
"setTransactionIsolation",
"(",
"$",
"level",
")",
"{",
"$",
"this",
"->",
"transactionIsolationLevel",
"=",
"$",
"level",
";",
"return",
"$",
"this",
"->",
"executeUpdate",
"(",
"$",
"this",
"->",
"getDatabasePlatform",
"(",
")",
"->",
... | Sets the transaction isolation level.
@param int $level The level to set.
@return int | [
"Sets",
"the",
"transaction",
"isolation",
"level",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L679-L684 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.getTransactionIsolation | public function getTransactionIsolation()
{
if ($this->transactionIsolationLevel === null) {
$this->transactionIsolationLevel = $this->getDatabasePlatform()->getDefaultTransactionIsolationLevel();
}
return $this->transactionIsolationLevel;
} | php | public function getTransactionIsolation()
{
if ($this->transactionIsolationLevel === null) {
$this->transactionIsolationLevel = $this->getDatabasePlatform()->getDefaultTransactionIsolationLevel();
}
return $this->transactionIsolationLevel;
} | [
"public",
"function",
"getTransactionIsolation",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"transactionIsolationLevel",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"transactionIsolationLevel",
"=",
"$",
"this",
"->",
"getDatabasePlatform",
"(",
")",
"->",
"... | Gets the currently active transaction isolation level.
@return int The current transaction isolation level. | [
"Gets",
"the",
"currently",
"active",
"transaction",
"isolation",
"level",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L691-L698 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.update | public function update($tableExpression, array $data, array $identifier, array $types = [])
{
$columns = $values = $conditions = $set = [];
foreach ($data as $columnName => $value) {
$columns[] = $columnName;
$values[] = $value;
$set[] = $columnName . ' = ?'... | php | public function update($tableExpression, array $data, array $identifier, array $types = [])
{
$columns = $values = $conditions = $set = [];
foreach ($data as $columnName => $value) {
$columns[] = $columnName;
$values[] = $value;
$set[] = $columnName . ' = ?'... | [
"public",
"function",
"update",
"(",
"$",
"tableExpression",
",",
"array",
"$",
"data",
",",
"array",
"$",
"identifier",
",",
"array",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"$",
"columns",
"=",
"$",
"values",
"=",
"$",
"conditions",
"=",
"$",
"set",... | Executes an SQL UPDATE statement on a table.
Table expression and columns are not escaped and are not safe for user-input.
@param string $tableExpression The expression of the table to update quoted or unquoted.
@param mixed[] $data An associative array containing column-value pairs.
@param ... | [
"Executes",
"an",
"SQL",
"UPDATE",
"statement",
"on",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L714-L734 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.extractTypeValues | private function extractTypeValues(array $columnList, array $types)
{
$typeValues = [];
foreach ($columnList as $columnIndex => $columnName) {
$typeValues[] = $types[$columnName] ?? ParameterType::STRING;
}
return $typeValues;
} | php | private function extractTypeValues(array $columnList, array $types)
{
$typeValues = [];
foreach ($columnList as $columnIndex => $columnName) {
$typeValues[] = $types[$columnName] ?? ParameterType::STRING;
}
return $typeValues;
} | [
"private",
"function",
"extractTypeValues",
"(",
"array",
"$",
"columnList",
",",
"array",
"$",
"types",
")",
"{",
"$",
"typeValues",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"columnList",
"as",
"$",
"columnIndex",
"=>",
"$",
"columnName",
")",
"{",
"$",... | Extract ordered type list from an ordered column list and type map.
@param int[]|string[] $columnList
@param int[]|string[] $types
@return int[]|string[] | [
"Extract",
"ordered",
"type",
"list",
"from",
"an",
"ordered",
"column",
"list",
"and",
"type",
"map",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L781-L790 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.fetchAll | public function fetchAll($sql, array $params = [], $types = [])
{
return $this->executeQuery($sql, $params, $types)->fetchAll();
} | php | public function fetchAll($sql, array $params = [], $types = [])
{
return $this->executeQuery($sql, $params, $types)->fetchAll();
} | [
"public",
"function",
"fetchAll",
"(",
"$",
"sql",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"types",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"executeQuery",
"(",
"$",
"sql",
",",
"$",
"params",
",",
"$",
"types",
")",
... | Prepares and executes an SQL query and returns the result as an associative array.
@param string $sql The SQL query.
@param mixed[] $params The query parameters.
@param int[]|string[] $types The query parameter types.
@return mixed[] | [
"Prepares",
"and",
"executes",
"an",
"SQL",
"query",
"and",
"returns",
"the",
"result",
"as",
"an",
"associative",
"array",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L832-L835 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.executeQuery | public function executeQuery($query, array $params = [], $types = [], ?QueryCacheProfile $qcp = null)
{
if ($qcp !== null) {
return $this->executeCacheQuery($query, $params, $types, $qcp);
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLo... | php | public function executeQuery($query, array $params = [], $types = [], ?QueryCacheProfile $qcp = null)
{
if ($qcp !== null) {
return $this->executeCacheQuery($query, $params, $types, $qcp);
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLo... | [
"public",
"function",
"executeQuery",
"(",
"$",
"query",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"types",
"=",
"[",
"]",
",",
"?",
"QueryCacheProfile",
"$",
"qcp",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"qcp",
"!==",
"null",
")",
"{... | Executes an, optionally parametrized, SQL query.
If the query is parametrized, a prepared statement is used.
If an SQLLogger is configured, the execution is logged.
@param string $query The SQL query to execute.
@param mixed[] $params The parameters to bind to the query, if any.
@param... | [
"Executes",
"an",
"optionally",
"parametrized",
"SQL",
"query",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L874-L912 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.executeCacheQuery | public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
{
$resultCache = $qcp->getResultCacheDriver() ?? $this->_config->getResultCacheImpl();
if ($resultCache === null) {
throw CacheException::noResultDriverConfigured();
}
$connectionParams =... | php | public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
{
$resultCache = $qcp->getResultCacheDriver() ?? $this->_config->getResultCacheImpl();
if ($resultCache === null) {
throw CacheException::noResultDriverConfigured();
}
$connectionParams =... | [
"public",
"function",
"executeCacheQuery",
"(",
"$",
"query",
",",
"$",
"params",
",",
"$",
"types",
",",
"QueryCacheProfile",
"$",
"qcp",
")",
"{",
"$",
"resultCache",
"=",
"$",
"qcp",
"->",
"getResultCacheDriver",
"(",
")",
"??",
"$",
"this",
"->",
"_c... | Executes a caching query.
@param string $query The SQL query to execute.
@param mixed[] $params The parameters to bind to the query, if any.
@param int[]|string[] $types The types the previous parameters are in.
@param QueryCacheProfile $qcp The query cache profile.
@return ResultStatemen... | [
"Executes",
"a",
"caching",
"query",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L926-L958 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.exec | public function exec($statement)
{
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($statement);
}
try {
$result = $connection->exec($statement);
} catch (Throwable $ex)... | php | public function exec($statement)
{
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($statement);
}
try {
$result = $connection->exec($statement);
} catch (Throwable $ex)... | [
"public",
"function",
"exec",
"(",
"$",
"statement",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getWrappedConnection",
"(",
")",
";",
"$",
"logger",
"=",
"$",
"this",
"->",
"_config",
"->",
"getSQLLogger",
"(",
")",
";",
"if",
"(",
"$",
"l... | Executes an SQL statement and return the number of affected rows.
@param string $statement
@return int The number of affected rows.
@throws DBALException | [
"Executes",
"an",
"SQL",
"statement",
"and",
"return",
"the",
"number",
"of",
"affected",
"rows",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1078-L1098 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.setNestTransactionsWithSavepoints | public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints)
{
if ($this->transactionNestingLevel > 0) {
throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction();
}
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
... | php | public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints)
{
if ($this->transactionNestingLevel > 0) {
throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction();
}
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
... | [
"public",
"function",
"setNestTransactionsWithSavepoints",
"(",
"$",
"nestTransactionsWithSavepoints",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"transactionNestingLevel",
">",
"0",
")",
"{",
"throw",
"ConnectionException",
"::",
"mayNotAlterNestedTransactionWithSavepointsInT... | Sets if nested transactions should use savepoints.
@param bool $nestTransactionsWithSavepoints
@return void
@throws ConnectionException | [
"Sets",
"if",
"nested",
"transactions",
"should",
"use",
"savepoints",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1186-L1197 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.commitAll | private function commitAll()
{
while ($this->transactionNestingLevel !== 0) {
if ($this->autoCommit === false && $this->transactionNestingLevel === 1) {
// When in no auto-commit mode, the last nesting commit immediately starts a new transaction.
// Therefore we n... | php | private function commitAll()
{
while ($this->transactionNestingLevel !== 0) {
if ($this->autoCommit === false && $this->transactionNestingLevel === 1) {
// When in no auto-commit mode, the last nesting commit immediately starts a new transaction.
// Therefore we n... | [
"private",
"function",
"commitAll",
"(",
")",
"{",
"while",
"(",
"$",
"this",
"->",
"transactionNestingLevel",
"!==",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autoCommit",
"===",
"false",
"&&",
"$",
"this",
"->",
"transactionNestingLevel",
"===",
"1",... | Commits all current nesting transactions. | [
"Commits",
"all",
"current",
"nesting",
"transactions",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1307-L1320 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.rollBack | public function rollBack()
{
if ($this->transactionNestingLevel === 0) {
throw ConnectionException::noActiveTransaction();
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($this->transactionNestingLevel === 1) {
... | php | public function rollBack()
{
if ($this->transactionNestingLevel === 0) {
throw ConnectionException::noActiveTransaction();
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($this->transactionNestingLevel === 1) {
... | [
"public",
"function",
"rollBack",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"transactionNestingLevel",
"===",
"0",
")",
"{",
"throw",
"ConnectionException",
"::",
"noActiveTransaction",
"(",
")",
";",
"}",
"$",
"connection",
"=",
"$",
"this",
"->",
"get... | Cancels any database changes done during the current transaction.
@throws ConnectionException If the rollback operation failed. | [
"Cancels",
"any",
"database",
"changes",
"done",
"during",
"the",
"current",
"transaction",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1327-L1364 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.createSavepoint | public function createSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}
$this->getWrappedConnection()->exec($this->platform->createSavePoint($savepoint));
} | php | public function createSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}
$this->getWrappedConnection()->exec($this->platform->createSavePoint($savepoint));
} | [
"public",
"function",
"createSavepoint",
"(",
"$",
"savepoint",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getDatabasePlatform",
"(",
")",
"->",
"supportsSavepoints",
"(",
")",
")",
"{",
"throw",
"ConnectionException",
"::",
"savepointsNotSupported",
"(",
"... | Creates a new savepoint.
@param string $savepoint The name of the savepoint to create.
@return void
@throws ConnectionException | [
"Creates",
"a",
"new",
"savepoint",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1375-L1382 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.releaseSavepoint | public function releaseSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}
if (! $this->platform->supportsReleaseSavepoints()) {
return;
}
$this->getWrappedConnect... | php | public function releaseSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}
if (! $this->platform->supportsReleaseSavepoints()) {
return;
}
$this->getWrappedConnect... | [
"public",
"function",
"releaseSavepoint",
"(",
"$",
"savepoint",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getDatabasePlatform",
"(",
")",
"->",
"supportsSavepoints",
"(",
")",
")",
"{",
"throw",
"ConnectionException",
"::",
"savepointsNotSupported",
"(",
... | Releases the given savepoint.
@param string $savepoint The name of the savepoint to release.
@return void
@throws ConnectionException | [
"Releases",
"the",
"given",
"savepoint",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1393-L1404 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.rollbackSavepoint | public function rollbackSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}
$this->getWrappedConnection()->exec($this->platform->rollbackSavePoint($savepoint));
} | php | public function rollbackSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
}
$this->getWrappedConnection()->exec($this->platform->rollbackSavePoint($savepoint));
} | [
"public",
"function",
"rollbackSavepoint",
"(",
"$",
"savepoint",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getDatabasePlatform",
"(",
")",
"->",
"supportsSavepoints",
"(",
")",
")",
"{",
"throw",
"ConnectionException",
"::",
"savepointsNotSupported",
"(",
... | Rolls back to the given savepoint.
@param string $savepoint The name of the savepoint to rollback to.
@return void
@throws ConnectionException | [
"Rolls",
"back",
"to",
"the",
"given",
"savepoint",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1415-L1422 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.getSchemaManager | public function getSchemaManager()
{
if ($this->_schemaManager === null) {
$this->_schemaManager = $this->_driver->getSchemaManager($this);
}
return $this->_schemaManager;
} | php | public function getSchemaManager()
{
if ($this->_schemaManager === null) {
$this->_schemaManager = $this->_driver->getSchemaManager($this);
}
return $this->_schemaManager;
} | [
"public",
"function",
"getSchemaManager",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_schemaManager",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_schemaManager",
"=",
"$",
"this",
"->",
"_driver",
"->",
"getSchemaManager",
"(",
"$",
"this",
")",
";"... | Gets the SchemaManager that can be used to inspect or change the
database schema through the connection.
@return AbstractSchemaManager | [
"Gets",
"the",
"SchemaManager",
"that",
"can",
"be",
"used",
"to",
"inspect",
"or",
"change",
"the",
"database",
"schema",
"through",
"the",
"connection",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1443-L1450 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.convertToDatabaseValue | public function convertToDatabaseValue($value, $type)
{
return Type::getType($type)->convertToDatabaseValue($value, $this->getDatabasePlatform());
} | php | public function convertToDatabaseValue($value, $type)
{
return Type::getType($type)->convertToDatabaseValue($value, $this->getDatabasePlatform());
} | [
"public",
"function",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"$",
"type",
")",
"{",
"return",
"Type",
"::",
"getType",
"(",
"$",
"type",
")",
"->",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"getDatabasePlatform",
"(",
... | Converts a given value to its database representation according to the conversion
rules of a specific DBAL mapping type.
@param mixed $value The value to convert.
@param string $type The name of the DBAL mapping type.
@return mixed The converted value. | [
"Converts",
"a",
"given",
"value",
"to",
"its",
"database",
"representation",
"according",
"to",
"the",
"conversion",
"rules",
"of",
"a",
"specific",
"DBAL",
"mapping",
"type",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1493-L1496 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection._bindTypedValues | private function _bindTypedValues($stmt, array $params, array $types)
{
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if (is_int(key($params))) {
// Positional parameters
$typeOffset = array_key_exists(0, $types) ? -1 : 0;
... | php | private function _bindTypedValues($stmt, array $params, array $types)
{
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if (is_int(key($params))) {
// Positional parameters
$typeOffset = array_key_exists(0, $types) ? -1 : 0;
... | [
"private",
"function",
"_bindTypedValues",
"(",
"$",
"stmt",
",",
"array",
"$",
"params",
",",
"array",
"$",
"types",
")",
"{",
"// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.",
"if",
"(",
"is_int",
"(",
"key",
"(",
"$",
... | Binds a set of parameters, some or all of which are typed with a PDO binding type
or DBAL mapping type, to a given statement.
@internal Duck-typing used on the $stmt parameter to support driver statements as well as
raw PDOStatement instances.
@param \Doctrine\DBAL\Driver\Statement $stmt The statement to bind the v... | [
"Binds",
"a",
"set",
"of",
"parameters",
"some",
"or",
"all",
"of",
"which",
"are",
"typed",
"with",
"a",
"PDO",
"binding",
"type",
"or",
"DBAL",
"mapping",
"type",
"to",
"a",
"given",
"statement",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1525-L1555 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.getBindingInfo | private function getBindingInfo($value, $type)
{
if (is_string($type)) {
$type = Type::getType($type);
}
if ($type instanceof Type) {
$value = $type->convertToDatabaseValue($value, $this->getDatabasePlatform());
$bindingType = $type->getBindingType()... | php | private function getBindingInfo($value, $type)
{
if (is_string($type)) {
$type = Type::getType($type);
}
if ($type instanceof Type) {
$value = $type->convertToDatabaseValue($value, $this->getDatabasePlatform());
$bindingType = $type->getBindingType()... | [
"private",
"function",
"getBindingInfo",
"(",
"$",
"value",
",",
"$",
"type",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"$",
"type",
"=",
"Type",
"::",
"getType",
"(",
"$",
"type",
")",
";",
"}",
"if",
"(",
"$",
"type",
... | Gets the binding type of a given type. The given type can be a PDO or DBAL mapping type.
@param mixed $value The value to bind.
@param int|string|null $type The type to bind (PDO or DBAL).
@return mixed[] [0] => the (escaped) value, [1] => the binding type. | [
"Gets",
"the",
"binding",
"type",
"of",
"a",
"given",
"type",
".",
"The",
"given",
"type",
"can",
"be",
"a",
"PDO",
"or",
"DBAL",
"mapping",
"type",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1565-L1578 | train |
doctrine/dbal | lib/Doctrine/DBAL/Connection.php | Connection.resolveParams | public function resolveParams(array $params, array $types)
{
$resolvedParams = [];
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if (is_int(key($params))) {
// Positional parameters
$typeOffset = array_key_exists(0, $ty... | php | public function resolveParams(array $params, array $types)
{
$resolvedParams = [];
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if (is_int(key($params))) {
// Positional parameters
$typeOffset = array_key_exists(0, $ty... | [
"public",
"function",
"resolveParams",
"(",
"array",
"$",
"params",
",",
"array",
"$",
"types",
")",
"{",
"$",
"resolvedParams",
"=",
"[",
"]",
";",
"// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.",
"if",
"(",
"is_int",
"("... | Resolves the parameters to a format which can be displayed.
@internal This is a purely internal method. If you rely on this method, you are advised to
copy/paste the code as this method may change, or be removed without prior notice.
@param mixed[] $params
@param int[]|string[] $types
@return mixed[] | [
"Resolves",
"the",
"parameters",
"to",
"a",
"format",
"which",
"can",
"be",
"displayed",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L1591-L1625 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/DB2Platform.php | DB2Platform.gatherAlterColumnSQL | private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts)
{
$alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff);
if (empty($alterColumnClauses)) {
return;
}
// If we have a single column alteration, ... | php | private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts)
{
$alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff);
if (empty($alterColumnClauses)) {
return;
}
// If we have a single column alteration, ... | [
"private",
"function",
"gatherAlterColumnSQL",
"(",
"Identifier",
"$",
"table",
",",
"ColumnDiff",
"$",
"columnDiff",
",",
"array",
"&",
"$",
"sql",
",",
"array",
"&",
"$",
"queryParts",
")",
"{",
"$",
"alterColumnClauses",
"=",
"$",
"this",
"->",
"getAlterC... | Gathers the table alteration SQL for a given column diff.
@param Identifier $table The table to gather the SQL for.
@param ColumnDiff $columnDiff The column diff to evaluate.
@param string[] $sql The sequence of table alteration statements to fill.
@param mixed[] $queryParts The sequence of column alt... | [
"Gathers",
"the",
"table",
"alteration",
"SQL",
"for",
"a",
"given",
"column",
"diff",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/DB2Platform.php#L631-L652 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/DB2Platform.php | DB2Platform.getAlterColumnClausesSQL | private function getAlterColumnClausesSQL(ColumnDiff $columnDiff)
{
$column = $columnDiff->column->toArray();
$alterClause = 'ALTER COLUMN ' . $columnDiff->column->getQuotedName($this);
if ($column['columnDefinition']) {
return [$alterClause . ' ' . $column['columnDefinition']]... | php | private function getAlterColumnClausesSQL(ColumnDiff $columnDiff)
{
$column = $columnDiff->column->toArray();
$alterClause = 'ALTER COLUMN ' . $columnDiff->column->getQuotedName($this);
if ($column['columnDefinition']) {
return [$alterClause . ' ' . $column['columnDefinition']]... | [
"private",
"function",
"getAlterColumnClausesSQL",
"(",
"ColumnDiff",
"$",
"columnDiff",
")",
"{",
"$",
"column",
"=",
"$",
"columnDiff",
"->",
"column",
"->",
"toArray",
"(",
")",
";",
"$",
"alterClause",
"=",
"'ALTER COLUMN '",
".",
"$",
"columnDiff",
"->",
... | Returns the ALTER COLUMN SQL clauses for altering a column described by the given column diff.
@param ColumnDiff $columnDiff The column diff to evaluate.
@return string[] | [
"Returns",
"the",
"ALTER",
"COLUMN",
"SQL",
"clauses",
"for",
"altering",
"a",
"column",
"described",
"by",
"the",
"given",
"column",
"diff",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/DB2Platform.php#L661-L699 | train |
doctrine/dbal | lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php | CompositeExpression.add | public function add($part)
{
if (empty($part)) {
return $this;
}
if ($part instanceof self && count($part) === 0) {
return $this;
}
$this->parts[] = $part;
return $this;
} | php | public function add($part)
{
if (empty($part)) {
return $this;
}
if ($part instanceof self && count($part) === 0) {
return $this;
}
$this->parts[] = $part;
return $this;
} | [
"public",
"function",
"add",
"(",
"$",
"part",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"part",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"part",
"instanceof",
"self",
"&&",
"count",
"(",
"$",
"part",
")",
"===",
"0",
")",
... | Adds an expression to composite expression.
@param mixed $part
@return \Doctrine\DBAL\Query\Expression\CompositeExpression | [
"Adds",
"an",
"expression",
"to",
"composite",
"expression",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php#L72-L85 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.initializeAllDoctrineTypeMappings | private function initializeAllDoctrineTypeMappings()
{
$this->initializeDoctrineTypeMappings();
foreach (Type::getTypesMap() as $typeName => $className) {
foreach (Type::getType($typeName)->getMappedDatabaseTypes($this) as $dbType) {
$this->doctrineTypeMapping[$dbType] =... | php | private function initializeAllDoctrineTypeMappings()
{
$this->initializeDoctrineTypeMappings();
foreach (Type::getTypesMap() as $typeName => $className) {
foreach (Type::getType($typeName)->getMappedDatabaseTypes($this) as $dbType) {
$this->doctrineTypeMapping[$dbType] =... | [
"private",
"function",
"initializeAllDoctrineTypeMappings",
"(",
")",
"{",
"$",
"this",
"->",
"initializeDoctrineTypeMappings",
"(",
")",
";",
"foreach",
"(",
"Type",
"::",
"getTypesMap",
"(",
")",
"as",
"$",
"typeName",
"=>",
"$",
"className",
")",
"{",
"fore... | Initializes Doctrine Type Mappings with the platform defaults
and with all additional type mappings.
@return void | [
"Initializes",
"Doctrine",
"Type",
"Mappings",
"with",
"the",
"platform",
"defaults",
"and",
"with",
"all",
"additional",
"type",
"mappings",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L233-L242 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.registerDoctrineTypeMapping | public function registerDoctrineTypeMapping($dbType, $doctrineType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
if (! Types\Type::hasType($doctrineType)) {
throw DBALException::typeNotFound($doctrineType);
}
... | php | public function registerDoctrineTypeMapping($dbType, $doctrineType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
if (! Types\Type::hasType($doctrineType)) {
throw DBALException::typeNotFound($doctrineType);
}
... | [
"public",
"function",
"registerDoctrineTypeMapping",
"(",
"$",
"dbType",
",",
"$",
"doctrineType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"doctrineTypeMapping",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initializeAllDoctrineTypeMappings",
"(",
")",
";",
"}... | Registers a doctrine type to be used in conjunction with a column type of this platform.
@param string $dbType
@param string $doctrineType
@throws DBALException If the type is not found. | [
"Registers",
"a",
"doctrine",
"type",
"to",
"be",
"used",
"in",
"conjunction",
"with",
"a",
"column",
"type",
"of",
"this",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L396-L416 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDoctrineTypeMapping | public function getDoctrineTypeMapping($dbType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
$dbType = strtolower($dbType);
if (! isset($this->doctrineTypeMapping[$dbType])) {
throw new DBALException('Unknown dat... | php | public function getDoctrineTypeMapping($dbType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
$dbType = strtolower($dbType);
if (! isset($this->doctrineTypeMapping[$dbType])) {
throw new DBALException('Unknown dat... | [
"public",
"function",
"getDoctrineTypeMapping",
"(",
"$",
"dbType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"doctrineTypeMapping",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initializeAllDoctrineTypeMappings",
"(",
")",
";",
"}",
"$",
"dbType",
"=",
"strto... | Gets the Doctrine type that is mapped for the given database column type.
@param string $dbType
@return string
@throws DBALException | [
"Gets",
"the",
"Doctrine",
"type",
"that",
"is",
"mapped",
"for",
"the",
"given",
"database",
"column",
"type",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L427-L440 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.hasDoctrineTypeMappingFor | public function hasDoctrineTypeMappingFor($dbType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
$dbType = strtolower($dbType);
return isset($this->doctrineTypeMapping[$dbType]);
} | php | public function hasDoctrineTypeMappingFor($dbType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
$dbType = strtolower($dbType);
return isset($this->doctrineTypeMapping[$dbType]);
} | [
"public",
"function",
"hasDoctrineTypeMappingFor",
"(",
"$",
"dbType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"doctrineTypeMapping",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initializeAllDoctrineTypeMappings",
"(",
")",
";",
"}",
"$",
"dbType",
"=",
"st... | Checks if a database type is currently supported by this platform.
@param string $dbType
@return bool | [
"Checks",
"if",
"a",
"database",
"type",
"is",
"currently",
"supported",
"by",
"this",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L449-L458 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.isCommentedDoctrineType | public function isCommentedDoctrineType(Type $doctrineType)
{
if ($this->doctrineTypeComments === null) {
$this->initializeCommentedDoctrineTypes();
}
assert(is_array($this->doctrineTypeComments));
return in_array($doctrineType->getName(), $this->doctrineTypeComments);
... | php | public function isCommentedDoctrineType(Type $doctrineType)
{
if ($this->doctrineTypeComments === null) {
$this->initializeCommentedDoctrineTypes();
}
assert(is_array($this->doctrineTypeComments));
return in_array($doctrineType->getName(), $this->doctrineTypeComments);
... | [
"public",
"function",
"isCommentedDoctrineType",
"(",
"Type",
"$",
"doctrineType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"doctrineTypeComments",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initializeCommentedDoctrineTypes",
"(",
")",
";",
"}",
"assert",
"("... | Is it necessary for the platform to add a parsable type comment to allow reverse engineering the given type?
@return bool | [
"Is",
"it",
"necessary",
"for",
"the",
"platform",
"to",
"add",
"a",
"parsable",
"type",
"comment",
"to",
"allow",
"reverse",
"engineering",
"the",
"given",
"type?"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L485-L494 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.markDoctrineTypeCommented | public function markDoctrineTypeCommented($doctrineType)
{
if ($this->doctrineTypeComments === null) {
$this->initializeCommentedDoctrineTypes();
}
assert(is_array($this->doctrineTypeComments));
$this->doctrineTypeComments[] = $doctrineType instanceof Type ? $doctrineTy... | php | public function markDoctrineTypeCommented($doctrineType)
{
if ($this->doctrineTypeComments === null) {
$this->initializeCommentedDoctrineTypes();
}
assert(is_array($this->doctrineTypeComments));
$this->doctrineTypeComments[] = $doctrineType instanceof Type ? $doctrineTy... | [
"public",
"function",
"markDoctrineTypeCommented",
"(",
"$",
"doctrineType",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"doctrineTypeComments",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initializeCommentedDoctrineTypes",
"(",
")",
";",
"}",
"assert",
"(",
"is_... | Marks this type as to be commented in ALTER TABLE and CREATE TABLE statements.
@param string|Type $doctrineType
@return void | [
"Marks",
"this",
"type",
"as",
"to",
"be",
"commented",
"in",
"ALTER",
"TABLE",
"and",
"CREATE",
"TABLE",
"statements",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L503-L512 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getTrimExpression | public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false)
{
$expression = '';
switch ($mode) {
case TrimMode::LEADING:
$expression = 'LEADING ';
break;
case TrimMode::TRAILING:
$expression = 'TRAILI... | php | public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false)
{
$expression = '';
switch ($mode) {
case TrimMode::LEADING:
$expression = 'LEADING ';
break;
case TrimMode::TRAILING:
$expression = 'TRAILI... | [
"public",
"function",
"getTrimExpression",
"(",
"$",
"str",
",",
"$",
"mode",
"=",
"TrimMode",
"::",
"UNSPECIFIED",
",",
"$",
"char",
"=",
"false",
")",
"{",
"$",
"expression",
"=",
"''",
";",
"switch",
"(",
"$",
"mode",
")",
"{",
"case",
"TrimMode",
... | Returns the SQL snippet to trim a string.
@param string $str The expression to apply the trim to.
@param int $mode The position of the trim (leading/trailing/both).
@param string|bool $char The char to trim, has to be quoted already. Defaults to space.
@return string | [
"Returns",
"the",
"SQL",
"snippet",
"to",
"trim",
"a",
"string",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L791-L818 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDropTableSQL | public function getDropTableSQL($table)
{
$tableArg = $table;
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
if (! is_string($table)) {
throw new InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \D... | php | public function getDropTableSQL($table)
{
$tableArg = $table;
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
if (! is_string($table)) {
throw new InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \D... | [
"public",
"function",
"getDropTableSQL",
"(",
"$",
"table",
")",
"{",
"$",
"tableArg",
"=",
"$",
"table",
";",
"if",
"(",
"$",
"table",
"instanceof",
"Table",
")",
"{",
"$",
"table",
"=",
"$",
"table",
"->",
"getQuotedName",
"(",
"$",
"this",
")",
";... | Returns the SQL snippet to drop an existing table.
@param Table|string $table
@return string
@throws InvalidArgumentException | [
"Returns",
"the",
"SQL",
"snippet",
"to",
"drop",
"an",
"existing",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1411-L1439 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDropIndexSQL | public function getDropIndexSQL($index, $table = null)
{
if ($index instanceof Index) {
$index = $index->getQuotedName($this);
} elseif (! is_string($index)) {
throw new InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Do... | php | public function getDropIndexSQL($index, $table = null)
{
if ($index instanceof Index) {
$index = $index->getQuotedName($this);
} elseif (! is_string($index)) {
throw new InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Do... | [
"public",
"function",
"getDropIndexSQL",
"(",
"$",
"index",
",",
"$",
"table",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"index",
"instanceof",
"Index",
")",
"{",
"$",
"index",
"=",
"$",
"index",
"->",
"getQuotedName",
"(",
"$",
"this",
")",
";",
"}",
... | Returns the SQL to drop an index from a table.
@param Index|string $index
@param Table|string $table
@return string
@throws InvalidArgumentException | [
"Returns",
"the",
"SQL",
"to",
"drop",
"an",
"index",
"from",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1463-L1472 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDropConstraintSQL | public function getDropConstraintSQL($constraint, $table)
{
if (! $constraint instanceof Constraint) {
$constraint = new Identifier($constraint);
}
if (! $table instanceof Table) {
$table = new Identifier($table);
}
$constraint = $constraint->getQuot... | php | public function getDropConstraintSQL($constraint, $table)
{
if (! $constraint instanceof Constraint) {
$constraint = new Identifier($constraint);
}
if (! $table instanceof Table) {
$table = new Identifier($table);
}
$constraint = $constraint->getQuot... | [
"public",
"function",
"getDropConstraintSQL",
"(",
"$",
"constraint",
",",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"$",
"constraint",
"instanceof",
"Constraint",
")",
"{",
"$",
"constraint",
"=",
"new",
"Identifier",
"(",
"$",
"constraint",
")",
";",
"}",
... | Returns the SQL to drop a constraint.
@param Constraint|string $constraint
@param Table|string $table
@return string | [
"Returns",
"the",
"SQL",
"to",
"drop",
"a",
"constraint",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1482-L1496 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDropForeignKeySQL | public function getDropForeignKeySQL($foreignKey, $table)
{
if (! $foreignKey instanceof ForeignKeyConstraint) {
$foreignKey = new Identifier($foreignKey);
}
if (! $table instanceof Table) {
$table = new Identifier($table);
}
$foreignKey = $foreignKe... | php | public function getDropForeignKeySQL($foreignKey, $table)
{
if (! $foreignKey instanceof ForeignKeyConstraint) {
$foreignKey = new Identifier($foreignKey);
}
if (! $table instanceof Table) {
$table = new Identifier($table);
}
$foreignKey = $foreignKe... | [
"public",
"function",
"getDropForeignKeySQL",
"(",
"$",
"foreignKey",
",",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"$",
"foreignKey",
"instanceof",
"ForeignKeyConstraint",
")",
"{",
"$",
"foreignKey",
"=",
"new",
"Identifier",
"(",
"$",
"foreignKey",
")",
";... | Returns the SQL to drop a foreign key.
@param ForeignKeyConstraint|string $foreignKey
@param Table|string $table
@return string | [
"Returns",
"the",
"SQL",
"to",
"drop",
"a",
"foreign",
"key",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1506-L1520 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getInlineColumnCommentSQL | public function getInlineColumnCommentSQL($comment)
{
if (! $this->supportsInlineColumnComments()) {
throw DBALException::notSupported(__METHOD__);
}
return 'COMMENT ' . $this->quoteStringLiteral($comment);
} | php | public function getInlineColumnCommentSQL($comment)
{
if (! $this->supportsInlineColumnComments()) {
throw DBALException::notSupported(__METHOD__);
}
return 'COMMENT ' . $this->quoteStringLiteral($comment);
} | [
"public",
"function",
"getInlineColumnCommentSQL",
"(",
"$",
"comment",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"supportsInlineColumnComments",
"(",
")",
")",
"{",
"throw",
"DBALException",
"::",
"notSupported",
"(",
"__METHOD__",
")",
";",
"}",
"return",... | Returns the SQL to create inline comment on a column.
@param string $comment
@return string
@throws DBALException If not supported on this platform. | [
"Returns",
"the",
"SQL",
"to",
"create",
"inline",
"comment",
"on",
"a",
"column",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1653-L1660 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform._getCreateTableSQL | protected function _getCreateTableSQL($tableName, array $columns, array $options = [])
{
$columnListSql = $this->getColumnDeclarationListSQL($columns);
if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) {
foreach ($options['uniqueConstraints'] as $name =... | php | protected function _getCreateTableSQL($tableName, array $columns, array $options = [])
{
$columnListSql = $this->getColumnDeclarationListSQL($columns);
if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) {
foreach ($options['uniqueConstraints'] as $name =... | [
"protected",
"function",
"_getCreateTableSQL",
"(",
"$",
"tableName",
",",
"array",
"$",
"columns",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"columnListSql",
"=",
"$",
"this",
"->",
"getColumnDeclarationListSQL",
"(",
"$",
"columns",
")",
... | Returns the SQL used to create a table.
@param string $tableName
@param mixed[][] $columns
@param mixed[] $options
@return string[] | [
"Returns",
"the",
"SQL",
"used",
"to",
"create",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1671-L1708 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getCreateConstraintSQL | public function getCreateConstraintSQL(Constraint $constraint, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
$query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this);
$columnList = '(' . implode(', ', ... | php | public function getCreateConstraintSQL(Constraint $constraint, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
$query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this);
$columnList = '(' . implode(', ', ... | [
"public",
"function",
"getCreateConstraintSQL",
"(",
"Constraint",
"$",
"constraint",
",",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"instanceof",
"Table",
")",
"{",
"$",
"table",
"=",
"$",
"table",
"->",
"getQuotedName",
"(",
"$",
"this",
")",
";... | Returns the SQL to create a constraint on a table on this platform.
@param Table|string $table
@return string
@throws InvalidArgumentException | [
"Returns",
"the",
"SQL",
"to",
"create",
"a",
"constraint",
"on",
"a",
"table",
"on",
"this",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1751-L1781 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getCreateIndexSQL | public function getCreateIndexSQL(Index $index, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
$name = $index->getQuotedName($this);
$columns = $index->getColumns();
if (count($columns) === 0) {
throw new InvalidA... | php | public function getCreateIndexSQL(Index $index, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
$name = $index->getQuotedName($this);
$columns = $index->getColumns();
if (count($columns) === 0) {
throw new InvalidA... | [
"public",
"function",
"getCreateIndexSQL",
"(",
"Index",
"$",
"index",
",",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"instanceof",
"Table",
")",
"{",
"$",
"table",
"=",
"$",
"table",
"->",
"getQuotedName",
"(",
"$",
"this",
")",
";",
"}",
"$"... | Returns the SQL to create an index on a table on this platform.
@param Table|string $table The name of the table on which the index is to be created.
@return string
@throws InvalidArgumentException | [
"Returns",
"the",
"SQL",
"to",
"create",
"an",
"index",
"on",
"a",
"table",
"on",
"this",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1792-L1812 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.quoteIdentifier | public function quoteIdentifier($str)
{
if (strpos($str, '.') !== false) {
$parts = array_map([$this, 'quoteSingleIdentifier'], explode('.', $str));
return implode('.', $parts);
}
return $this->quoteSingleIdentifier($str);
} | php | public function quoteIdentifier($str)
{
if (strpos($str, '.') !== false) {
$parts = array_map([$this, 'quoteSingleIdentifier'], explode('.', $str));
return implode('.', $parts);
}
return $this->quoteSingleIdentifier($str);
} | [
"public",
"function",
"quoteIdentifier",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"str",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"$",
"parts",
"=",
"array_map",
"(",
"[",
"$",
"this",
",",
"'quoteSingleIdentifier'",
"]",
",",
"exp... | Quotes a string so that it can be safely used as a table or column name,
even if it is a reserved word of the platform. This also detects identifier
chains separated by dot and quotes them independently.
NOTE: Just because you CAN use quoted identifiers doesn't mean
you SHOULD use them. In general, they end up causing... | [
"Quotes",
"a",
"string",
"so",
"that",
"it",
"can",
"be",
"safely",
"used",
"as",
"a",
"table",
"or",
"column",
"name",
"even",
"if",
"it",
"is",
"a",
"reserved",
"word",
"of",
"the",
"platform",
".",
"This",
"also",
"detects",
"identifier",
"chains",
... | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1881-L1890 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getCreateForeignKeySQL | public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
return 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey);
} | php | public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
return 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey);
} | [
"public",
"function",
"getCreateForeignKeySQL",
"(",
"ForeignKeyConstraint",
"$",
"foreignKey",
",",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"instanceof",
"Table",
")",
"{",
"$",
"table",
"=",
"$",
"table",
"->",
"getQuotedName",
"(",
"$",
"this",
... | Returns the SQL to create a new foreign key.
@param ForeignKeyConstraint $foreignKey The foreign key constraint.
@param Table|string $table The name of the table on which the foreign key is to be created.
@return string | [
"Returns",
"the",
"SQL",
"to",
"create",
"a",
"new",
"foreign",
"key",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L1914-L1921 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getRenameIndexSQL | protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
{
return [
$this->getDropIndexSQL($oldIndexName, $tableName),
$this->getCreateIndexSQL($index, $tableName),
];
} | php | protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
{
return [
$this->getDropIndexSQL($oldIndexName, $tableName),
$this->getCreateIndexSQL($index, $tableName),
];
} | [
"protected",
"function",
"getRenameIndexSQL",
"(",
"$",
"oldIndexName",
",",
"Index",
"$",
"index",
",",
"$",
"tableName",
")",
"{",
"return",
"[",
"$",
"this",
"->",
"getDropIndexSQL",
"(",
"$",
"oldIndexName",
",",
"$",
"tableName",
")",
",",
"$",
"this"... | Returns the SQL for renaming an index on a table.
@param string $oldIndexName The name of the index to rename from.
@param Index $index The definition of the index to rename to.
@param string $tableName The table to rename the given index on.
@return string[] The sequence of SQL statements for renaming the... | [
"Returns",
"the",
"SQL",
"for",
"renaming",
"an",
"index",
"on",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2132-L2138 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform._getAlterTableIndexForeignKeySQL | protected function _getAlterTableIndexForeignKeySQL(TableDiff $diff)
{
return array_merge($this->getPreAlterTableIndexForeignKeySQL($diff), $this->getPostAlterTableIndexForeignKeySQL($diff));
} | php | protected function _getAlterTableIndexForeignKeySQL(TableDiff $diff)
{
return array_merge($this->getPreAlterTableIndexForeignKeySQL($diff), $this->getPostAlterTableIndexForeignKeySQL($diff));
} | [
"protected",
"function",
"_getAlterTableIndexForeignKeySQL",
"(",
"TableDiff",
"$",
"diff",
")",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"getPreAlterTableIndexForeignKeySQL",
"(",
"$",
"diff",
")",
",",
"$",
"this",
"->",
"getPostAlterTableIndexForeignKe... | Common code for alter table statement generation that updates the changed Index and Foreign Key definitions.
@return string[] | [
"Common",
"code",
"for",
"alter",
"table",
"statement",
"generation",
"that",
"updates",
"the",
"changed",
"Index",
"and",
"Foreign",
"Key",
"definitions",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2145-L2148 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getColumnDeclarationListSQL | public function getColumnDeclarationListSQL(array $fields)
{
$queryFields = [];
foreach ($fields as $fieldName => $field) {
$queryFields[] = $this->getColumnDeclarationSQL($fieldName, $field);
}
return implode(', ', $queryFields);
} | php | public function getColumnDeclarationListSQL(array $fields)
{
$queryFields = [];
foreach ($fields as $fieldName => $field) {
$queryFields[] = $this->getColumnDeclarationSQL($fieldName, $field);
}
return implode(', ', $queryFields);
} | [
"public",
"function",
"getColumnDeclarationListSQL",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"queryFields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"fieldName",
"=>",
"$",
"field",
")",
"{",
"$",
"queryFields",
"[",
"]",
"=",
... | Gets declaration of a number of fields in bulk.
@param mixed[][] $fields A multidimensional associative array.
The first dimension determines the field name, while the second
dimension is keyed with the name of the properties
of the field being declared as array indexes. Currently, the types
of supported field propert... | [
"Gets",
"declaration",
"of",
"a",
"number",
"of",
"fields",
"in",
"bulk",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2179-L2188 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getColumnDeclarationSQL | public function getColumnDeclarationSQL($name, array $field)
{
if (isset($field['columnDefinition'])) {
$columnDef = $this->getCustomTypeDeclarationSQL($field);
} else {
$default = $this->getDefaultValueDeclarationSQL($field);
$charset = isset($field['charset']) ... | php | public function getColumnDeclarationSQL($name, array $field)
{
if (isset($field['columnDefinition'])) {
$columnDef = $this->getCustomTypeDeclarationSQL($field);
} else {
$default = $this->getDefaultValueDeclarationSQL($field);
$charset = isset($field['charset']) ... | [
"public",
"function",
"getColumnDeclarationSQL",
"(",
"$",
"name",
",",
"array",
"$",
"field",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"field",
"[",
"'columnDefinition'",
"]",
")",
")",
"{",
"$",
"columnDef",
"=",
"$",
"this",
"->",
"getCustomTypeDeclarati... | Obtains DBMS specific SQL code portion needed to declare a generic type
field to be used in statements like CREATE TABLE.
@param string $name The name the field to be declared.
@param mixed[] $field An associative array with the name of the properties
of the field being declared as array indexes. Currently, the type... | [
"Obtains",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"declare",
"a",
"generic",
"type",
"field",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2223-L2253 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDecimalTypeDeclarationSQL | public function getDecimalTypeDeclarationSQL(array $columnDef)
{
$columnDef['precision'] = ! isset($columnDef['precision']) || empty($columnDef['precision'])
? 10 : $columnDef['precision'];
$columnDef['scale'] = ! isset($columnDef['scale']) || empty($columnDef['scale'])
?... | php | public function getDecimalTypeDeclarationSQL(array $columnDef)
{
$columnDef['precision'] = ! isset($columnDef['precision']) || empty($columnDef['precision'])
? 10 : $columnDef['precision'];
$columnDef['scale'] = ! isset($columnDef['scale']) || empty($columnDef['scale'])
?... | [
"public",
"function",
"getDecimalTypeDeclarationSQL",
"(",
"array",
"$",
"columnDef",
")",
"{",
"$",
"columnDef",
"[",
"'precision'",
"]",
"=",
"!",
"isset",
"(",
"$",
"columnDef",
"[",
"'precision'",
"]",
")",
"||",
"empty",
"(",
"$",
"columnDef",
"[",
"'... | Returns the SQL snippet that declares a floating point column of arbitrary precision.
@param mixed[] $columnDef
@return string | [
"Returns",
"the",
"SQL",
"snippet",
"that",
"declares",
"a",
"floating",
"point",
"column",
"of",
"arbitrary",
"precision",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2262-L2270 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getDefaultValueDeclarationSQL | public function getDefaultValueDeclarationSQL($field)
{
if (! isset($field['default'])) {
return empty($field['notnull']) ? ' DEFAULT NULL' : '';
}
$default = $field['default'];
if (! isset($field['type'])) {
return " DEFAULT '" . $default . "'";
}
... | php | public function getDefaultValueDeclarationSQL($field)
{
if (! isset($field['default'])) {
return empty($field['notnull']) ? ' DEFAULT NULL' : '';
}
$default = $field['default'];
if (! isset($field['type'])) {
return " DEFAULT '" . $default . "'";
}
... | [
"public",
"function",
"getDefaultValueDeclarationSQL",
"(",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"field",
"[",
"'default'",
"]",
")",
")",
"{",
"return",
"empty",
"(",
"$",
"field",
"[",
"'notnull'",
"]",
")",
"?",
"' DEFAULT NULL'"... | Obtains DBMS specific SQL code portion needed to set a default value
declaration to be used in statements like CREATE TABLE.
@param mixed[] $field The field definition array.
@return string DBMS specific SQL code portion needed to set a default value. | [
"Obtains",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"set",
"a",
"default",
"value",
"declaration",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2280-L2315 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getCheckDeclarationSQL | public function getCheckDeclarationSQL(array $definition)
{
$constraints = [];
foreach ($definition as $field => $def) {
if (is_string($def)) {
$constraints[] = 'CHECK (' . $def . ')';
} else {
if (isset($def['min'])) {
$con... | php | public function getCheckDeclarationSQL(array $definition)
{
$constraints = [];
foreach ($definition as $field => $def) {
if (is_string($def)) {
$constraints[] = 'CHECK (' . $def . ')';
} else {
if (isset($def['min'])) {
$con... | [
"public",
"function",
"getCheckDeclarationSQL",
"(",
"array",
"$",
"definition",
")",
"{",
"$",
"constraints",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"definition",
"as",
"$",
"field",
"=>",
"$",
"def",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"def... | Obtains DBMS specific SQL code portion needed to set a CHECK constraint
declaration to be used in statements like CREATE TABLE.
@param string[]|mixed[][] $definition The check definition.
@return string DBMS specific SQL code portion needed to set a CHECK constraint. | [
"Obtains",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"set",
"a",
"CHECK",
"constraint",
"declaration",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2325-L2343 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getUniqueConstraintDeclarationSQL | public function getUniqueConstraintDeclarationSQL($name, Index $index)
{
$columns = $index->getColumns();
$name = new Identifier($name);
if (count($columns) === 0) {
throw new InvalidArgumentException("Incomplete definition. 'columns' required.");
}
return 'C... | php | public function getUniqueConstraintDeclarationSQL($name, Index $index)
{
$columns = $index->getColumns();
$name = new Identifier($name);
if (count($columns) === 0) {
throw new InvalidArgumentException("Incomplete definition. 'columns' required.");
}
return 'C... | [
"public",
"function",
"getUniqueConstraintDeclarationSQL",
"(",
"$",
"name",
",",
"Index",
"$",
"index",
")",
"{",
"$",
"columns",
"=",
"$",
"index",
"->",
"getColumns",
"(",
")",
";",
"$",
"name",
"=",
"new",
"Identifier",
"(",
"$",
"name",
")",
";",
... | Obtains DBMS specific SQL code portion needed to set a unique
constraint declaration to be used in statements like CREATE TABLE.
@param string $name The name of the unique constraint.
@param Index $index The index definition.
@return string DBMS specific SQL code portion needed to set a constraint.
@throws Invalid... | [
"Obtains",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"set",
"a",
"unique",
"constraint",
"declaration",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2356-L2368 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getIndexFieldDeclarationListSQL | public function getIndexFieldDeclarationListSQL($columnsOrIndex) : string
{
if ($columnsOrIndex instanceof Index) {
return implode(', ', $columnsOrIndex->getQuotedColumns($this));
}
if (! is_array($columnsOrIndex)) {
throw new InvalidArgumentException('Fields argumen... | php | public function getIndexFieldDeclarationListSQL($columnsOrIndex) : string
{
if ($columnsOrIndex instanceof Index) {
return implode(', ', $columnsOrIndex->getQuotedColumns($this));
}
if (! is_array($columnsOrIndex)) {
throw new InvalidArgumentException('Fields argumen... | [
"public",
"function",
"getIndexFieldDeclarationListSQL",
"(",
"$",
"columnsOrIndex",
")",
":",
"string",
"{",
"if",
"(",
"$",
"columnsOrIndex",
"instanceof",
"Index",
")",
"{",
"return",
"implode",
"(",
"', '",
",",
"$",
"columnsOrIndex",
"->",
"getQuotedColumns",... | Obtains DBMS specific SQL code portion needed to set an index
declaration to be used in statements like CREATE TABLE.
@param mixed[]|Index $columnsOrIndex array declaration is deprecated, prefer passing Index to this method | [
"Obtains",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"set",
"an",
"index",
"declaration",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2415-L2436 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getForeignKeyDeclarationSQL | public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey)
{
$sql = $this->getForeignKeyBaseDeclarationSQL($foreignKey);
$sql .= $this->getAdvancedForeignKeyOptionsSQL($foreignKey);
return $sql;
} | php | public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey)
{
$sql = $this->getForeignKeyBaseDeclarationSQL($foreignKey);
$sql .= $this->getAdvancedForeignKeyOptionsSQL($foreignKey);
return $sql;
} | [
"public",
"function",
"getForeignKeyDeclarationSQL",
"(",
"ForeignKeyConstraint",
"$",
"foreignKey",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"getForeignKeyBaseDeclarationSQL",
"(",
"$",
"foreignKey",
")",
";",
"$",
"sql",
".=",
"$",
"this",
"->",
"getAdvan... | Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
of a field declaration to be used in statements like CREATE TABLE.
@return string DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
of a field declaration. | [
"Obtain",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"set",
"the",
"FOREIGN",
"KEY",
"constraint",
"of",
"a",
"field",
"declaration",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2476-L2482 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getAdvancedForeignKeyOptionsSQL | public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey)
{
$query = '';
if ($this->supportsForeignKeyOnUpdate() && $foreignKey->hasOption('onUpdate')) {
$query .= ' ON UPDATE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onUpdate'));
... | php | public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey)
{
$query = '';
if ($this->supportsForeignKeyOnUpdate() && $foreignKey->hasOption('onUpdate')) {
$query .= ' ON UPDATE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onUpdate'));
... | [
"public",
"function",
"getAdvancedForeignKeyOptionsSQL",
"(",
"ForeignKeyConstraint",
"$",
"foreignKey",
")",
"{",
"$",
"query",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"supportsForeignKeyOnUpdate",
"(",
")",
"&&",
"$",
"foreignKey",
"->",
"hasOption",
"("... | Returns the FOREIGN KEY query section dealing with non-standard options
as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
@param ForeignKeyConstraint $foreignKey The foreign key definition.
@return string | [
"Returns",
"the",
"FOREIGN",
"KEY",
"query",
"section",
"dealing",
"with",
"non",
"-",
"standard",
"options",
"as",
"MATCH",
"INITIALLY",
"DEFERRED",
"ON",
"UPDATE",
"..."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2492-L2503 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getForeignKeyBaseDeclarationSQL | public function getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint $foreignKey)
{
$sql = '';
if (strlen($foreignKey->getName())) {
$sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' ';
}
$sql .= 'FOREIGN KEY (';
if (count($foreignKey->getLocalColumns... | php | public function getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint $foreignKey)
{
$sql = '';
if (strlen($foreignKey->getName())) {
$sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' ';
}
$sql .= 'FOREIGN KEY (';
if (count($foreignKey->getLocalColumns... | [
"public",
"function",
"getForeignKeyBaseDeclarationSQL",
"(",
"ForeignKeyConstraint",
"$",
"foreignKey",
")",
"{",
"$",
"sql",
"=",
"''",
";",
"if",
"(",
"strlen",
"(",
"$",
"foreignKey",
"->",
"getName",
"(",
")",
")",
")",
"{",
"$",
"sql",
".=",
"'CONSTR... | Obtains DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
of a field declaration to be used in statements like CREATE TABLE.
@return string
@throws InvalidArgumentException | [
"Obtains",
"DBMS",
"specific",
"SQL",
"code",
"portion",
"needed",
"to",
"set",
"the",
"FOREIGN",
"KEY",
"constraint",
"of",
"a",
"field",
"declaration",
"to",
"be",
"used",
"in",
"statements",
"like",
"CREATE",
"TABLE",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2537-L2559 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.convertBooleans | public function convertBooleans($item)
{
if (is_array($item)) {
foreach ($item as $k => $value) {
if (! is_bool($value)) {
continue;
}
$item[$k] = (int) $value;
}
} elseif (is_bool($item)) {
$ite... | php | public function convertBooleans($item)
{
if (is_array($item)) {
foreach ($item as $k => $value) {
if (! is_bool($value)) {
continue;
}
$item[$k] = (int) $value;
}
} elseif (is_bool($item)) {
$ite... | [
"public",
"function",
"convertBooleans",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"foreach",
"(",
"$",
"item",
"as",
"$",
"k",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"value",
... | Some platforms need the boolean values to be converted.
The default conversion in this implementation converts to integers (false => 0, true => 1).
Note: if the input is not a boolean the original input might be returned.
There are two contexts when converting booleans: Literals and Prepared Statements.
This method ... | [
"Some",
"platforms",
"need",
"the",
"boolean",
"values",
"to",
"be",
"converted",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L2637-L2652 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.modifyLimitQuery | final public function modifyLimitQuery($query, $limit, $offset = null)
{
if ($limit !== null) {
$limit = (int) $limit;
}
$offset = (int) $offset;
if ($offset < 0) {
throw new DBALException(sprintf(
'Offset must be a positive integer or zero, ... | php | final public function modifyLimitQuery($query, $limit, $offset = null)
{
if ($limit !== null) {
$limit = (int) $limit;
}
$offset = (int) $offset;
if ($offset < 0) {
throw new DBALException(sprintf(
'Offset must be a positive integer or zero, ... | [
"final",
"public",
"function",
"modifyLimitQuery",
"(",
"$",
"query",
",",
"$",
"limit",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"limit",
"!==",
"null",
")",
"{",
"$",
"limit",
"=",
"(",
"int",
")",
"$",
"limit",
";",
"}",
"$",... | Adds an driver-specific LIMIT clause to the query.
@param string $query
@param int|null $limit
@param int|null $offset
@return string
@throws DBALException | [
"Adds",
"an",
"driver",
"-",
"specific",
"LIMIT",
"clause",
"to",
"the",
"query",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L3360-L3383 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.doModifyLimitQuery | protected function doModifyLimitQuery($query, $limit, $offset)
{
if ($limit !== null) {
$query .= ' LIMIT ' . $limit;
}
if ($offset > 0) {
$query .= ' OFFSET ' . $offset;
}
return $query;
} | php | protected function doModifyLimitQuery($query, $limit, $offset)
{
if ($limit !== null) {
$query .= ' LIMIT ' . $limit;
}
if ($offset > 0) {
$query .= ' OFFSET ' . $offset;
}
return $query;
} | [
"protected",
"function",
"doModifyLimitQuery",
"(",
"$",
"query",
",",
"$",
"limit",
",",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"limit",
"!==",
"null",
")",
"{",
"$",
"query",
".=",
"' LIMIT '",
".",
"$",
"limit",
";",
"}",
"if",
"(",
"$",
"offs... | Adds an platform-specific LIMIT clause to the query.
@param string $query
@param int|null $limit
@param int|null $offset
@return string | [
"Adds",
"an",
"platform",
"-",
"specific",
"LIMIT",
"clause",
"to",
"the",
"query",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L3394-L3405 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.getReservedKeywordsList | final public function getReservedKeywordsList()
{
// Check for an existing instantiation of the keywords class.
if ($this->_keywords) {
return $this->_keywords;
}
$class = $this->getReservedKeywordsClass();
$keywords = new $class();
if (! $keywords ins... | php | final public function getReservedKeywordsList()
{
// Check for an existing instantiation of the keywords class.
if ($this->_keywords) {
return $this->_keywords;
}
$class = $this->getReservedKeywordsClass();
$keywords = new $class();
if (! $keywords ins... | [
"final",
"public",
"function",
"getReservedKeywordsList",
"(",
")",
"{",
"// Check for an existing instantiation of the keywords class.",
"if",
"(",
"$",
"this",
"->",
"_keywords",
")",
"{",
"return",
"$",
"this",
"->",
"_keywords",
";",
"}",
"$",
"class",
"=",
"$... | Returns the keyword list instance of this platform.
@return KeywordList
@throws DBALException If no keyword list is specified. | [
"Returns",
"the",
"keyword",
"list",
"instance",
"of",
"this",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L3538-L3555 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.quoteStringLiteral | public function quoteStringLiteral($str)
{
$c = $this->getStringLiteralQuoteCharacter();
return $c . str_replace($c, $c . $c, $str) . $c;
} | php | public function quoteStringLiteral($str)
{
$c = $this->getStringLiteralQuoteCharacter();
return $c . str_replace($c, $c . $c, $str) . $c;
} | [
"public",
"function",
"quoteStringLiteral",
"(",
"$",
"str",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"getStringLiteralQuoteCharacter",
"(",
")",
";",
"return",
"$",
"c",
".",
"str_replace",
"(",
"$",
"c",
",",
"$",
"c",
".",
"$",
"c",
",",
"$",
... | Quotes a literal string.
This method is NOT meant to fix SQL injections!
It is only meant to escape this platform's string literal
quote character inside the given literal string.
@param string $str The literal string to be quoted.
@return string The quoted literal string. | [
"Quotes",
"a",
"literal",
"string",
".",
"This",
"method",
"is",
"NOT",
"meant",
"to",
"fix",
"SQL",
"injections!",
"It",
"is",
"only",
"meant",
"to",
"escape",
"this",
"platform",
"s",
"string",
"literal",
"quote",
"character",
"inside",
"the",
"given",
"... | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L3579-L3584 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | AbstractPlatform.escapeStringForLike | final public function escapeStringForLike(string $inputString, string $escapeChar) : string
{
return preg_replace(
'~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') . '])~u',
addcslashes($escapeChar, '\\') . '$1',
$inputString
);
} | php | final public function escapeStringForLike(string $inputString, string $escapeChar) : string
{
return preg_replace(
'~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') . '])~u',
addcslashes($escapeChar, '\\') . '$1',
$inputString
);
} | [
"final",
"public",
"function",
"escapeStringForLike",
"(",
"string",
"$",
"inputString",
",",
"string",
"$",
"escapeChar",
")",
":",
"string",
"{",
"return",
"preg_replace",
"(",
"'~(['",
".",
"preg_quote",
"(",
"$",
"this",
"->",
"getLikeWildcardCharacters",
"(... | Escapes metacharacters in a string intended to be used with a LIKE
operator.
@param string $inputString a literal, unquoted string
@param string $escapeChar should be reused by the caller in the LIKE
expression. | [
"Escapes",
"metacharacters",
"in",
"a",
"string",
"intended",
"to",
"be",
"used",
"with",
"a",
"LIKE",
"operator",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php#L3604-L3611 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager.getConnection | public static function getConnection(
array $params,
?Configuration $config = null,
?EventManager $eventManager = null
) : Connection {
// create default config and event manager, if not set
if (! $config) {
$config = new Configuration();
}
if (! $... | php | public static function getConnection(
array $params,
?Configuration $config = null,
?EventManager $eventManager = null
) : Connection {
// create default config and event manager, if not set
if (! $config) {
$config = new Configuration();
}
if (! $... | [
"public",
"static",
"function",
"getConnection",
"(",
"array",
"$",
"params",
",",
"?",
"Configuration",
"$",
"config",
"=",
"null",
",",
"?",
"EventManager",
"$",
"eventManager",
"=",
"null",
")",
":",
"Connection",
"{",
"// create default config and event manage... | Creates a connection object based on the specified parameters.
This method returns a Doctrine\DBAL\Connection which wraps the underlying
driver connection.
$params must contain at least one of the following.
Either 'driver' with one of the following values:
pdo_mysql
pdo_sqlite
pdo_pgsql
pdo_oci (unstable)
pdo_sqlsr... | [
"Creates",
"a",
"connection",
"object",
"based",
"on",
"the",
"specified",
"parameters",
".",
"This",
"method",
"returns",
"a",
"Doctrine",
"\\",
"DBAL",
"\\",
"Connection",
"which",
"wraps",
"the",
"underlying",
"driver",
"connection",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L137-L200 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager._checkParams | private static function _checkParams(array $params) : void
{
// check existence of mandatory parameters
// driver
if (! isset($params['driver']) && ! isset($params['driverClass'])) {
throw DBALException::driverRequired();
}
// check validity of parameters
... | php | private static function _checkParams(array $params) : void
{
// check existence of mandatory parameters
// driver
if (! isset($params['driver']) && ! isset($params['driverClass'])) {
throw DBALException::driverRequired();
}
// check validity of parameters
... | [
"private",
"static",
"function",
"_checkParams",
"(",
"array",
"$",
"params",
")",
":",
"void",
"{",
"// check existence of mandatory parameters",
"// driver",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'driver'",
"]",
")",
"&&",
"!",
"isset",
"(",
"... | Checks the list of parameters.
@param mixed[] $params The list of parameters.
@throws DBALException | [
"Checks",
"the",
"list",
"of",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L219-L238 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager.parseDatabaseUrl | private static function parseDatabaseUrl(array $params) : array
{
if (! isset($params['url'])) {
return $params;
}
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
$url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localho... | php | private static function parseDatabaseUrl(array $params) : array
{
if (! isset($params['url'])) {
return $params;
}
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
$url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localho... | [
"private",
"static",
"function",
"parseDatabaseUrl",
"(",
"array",
"$",
"params",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'url'",
"]",
")",
")",
"{",
"return",
"$",
"params",
";",
"}",
"// (pdo_)?sqlite3?:///... => (pdo_)... | Extracts parts from a database URL, if present, and returns an
updated list of parameters.
@param mixed[] $params The list of parameters.
@return mixed[] A modified list of parameters with info from a database
URL extracted into indidivual parameter parts.
@throws DBALException | [
"Extracts",
"parts",
"from",
"a",
"database",
"URL",
"if",
"present",
"and",
"returns",
"an",
"updated",
"list",
"of",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L262-L303 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager.parseDatabaseUrlPath | private static function parseDatabaseUrlPath(array $url, array $params) : array
{
if (! isset($url['path'])) {
return $params;
}
$url['path'] = self::normalizeDatabaseUrlPath($url['path']);
// If we do not have a known DBAL driver, we do not know any connection URL path... | php | private static function parseDatabaseUrlPath(array $url, array $params) : array
{
if (! isset($url['path'])) {
return $params;
}
$url['path'] = self::normalizeDatabaseUrlPath($url['path']);
// If we do not have a known DBAL driver, we do not know any connection URL path... | [
"private",
"static",
"function",
"parseDatabaseUrlPath",
"(",
"array",
"$",
"url",
",",
"array",
"$",
"params",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"url",
"[",
"'path'",
"]",
")",
")",
"{",
"return",
"$",
"params",
";",
"}",
... | Parses the given connection URL and resolves the given connection parameters.
Assumes that the connection URL scheme is already parsed and resolved into the given connection parameters
via {@link parseDatabaseUrlScheme}.
@see parseDatabaseUrlScheme
@param mixed[] $url The URL parts to evaluate.
@param mixed[] $pa... | [
"Parses",
"the",
"given",
"connection",
"URL",
"and",
"resolves",
"the",
"given",
"connection",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L318-L337 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager.parseDatabaseUrlQuery | private static function parseDatabaseUrlQuery(array $url, array $params) : array
{
if (! isset($url['query'])) {
return $params;
}
$query = [];
parse_str($url['query'], $query); // simply ingest query as extra params, e.g. charset or sslmode
return array_merge(... | php | private static function parseDatabaseUrlQuery(array $url, array $params) : array
{
if (! isset($url['query'])) {
return $params;
}
$query = [];
parse_str($url['query'], $query); // simply ingest query as extra params, e.g. charset or sslmode
return array_merge(... | [
"private",
"static",
"function",
"parseDatabaseUrlQuery",
"(",
"array",
"$",
"url",
",",
"array",
"$",
"params",
")",
":",
"array",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"url",
"[",
"'query'",
"]",
")",
")",
"{",
"return",
"$",
"params",
";",
"}",
... | Parses the query part of the given connection URL and resolves the given connection parameters.
@param mixed[] $url The connection URL parts to evaluate.
@param mixed[] $params The connection parameters to resolve.
@return mixed[] The resolved connection parameters. | [
"Parses",
"the",
"query",
"part",
"of",
"the",
"given",
"connection",
"URL",
"and",
"resolves",
"the",
"given",
"connection",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L347-L358 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager.parseSqliteDatabaseUrlPath | private static function parseSqliteDatabaseUrlPath(array $url, array $params) : array
{
if ($url['path'] === ':memory:') {
$params['memory'] = true;
return $params;
}
$params['path'] = $url['path']; // pdo_sqlite driver uses 'path' instead of 'dbname' key
r... | php | private static function parseSqliteDatabaseUrlPath(array $url, array $params) : array
{
if ($url['path'] === ':memory:') {
$params['memory'] = true;
return $params;
}
$params['path'] = $url['path']; // pdo_sqlite driver uses 'path' instead of 'dbname' key
r... | [
"private",
"static",
"function",
"parseSqliteDatabaseUrlPath",
"(",
"array",
"$",
"url",
",",
"array",
"$",
"params",
")",
":",
"array",
"{",
"if",
"(",
"$",
"url",
"[",
"'path'",
"]",
"===",
"':memory:'",
")",
"{",
"$",
"params",
"[",
"'memory'",
"]",
... | Parses the given SQLite connection URL and resolves the given connection parameters.
Assumes that the "path" URL part is already normalized via {@link normalizeDatabaseUrlPath}.
@see normalizeDatabaseUrlPath
@param mixed[] $url The SQLite connection URL parts to evaluate.
@param mixed[] $params The connection par... | [
"Parses",
"the",
"given",
"SQLite",
"connection",
"URL",
"and",
"resolves",
"the",
"given",
"connection",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L391-L402 | train |
doctrine/dbal | lib/Doctrine/DBAL/DriverManager.php | DriverManager.parseDatabaseUrlScheme | private static function parseDatabaseUrlScheme(array $url, array $params) : array
{
if (isset($url['scheme'])) {
// The requested driver from the URL scheme takes precedence
// over the default custom driver from the connection parameters (if any).
unset($params['driverCl... | php | private static function parseDatabaseUrlScheme(array $url, array $params) : array
{
if (isset($url['scheme'])) {
// The requested driver from the URL scheme takes precedence
// over the default custom driver from the connection parameters (if any).
unset($params['driverCl... | [
"private",
"static",
"function",
"parseDatabaseUrlScheme",
"(",
"array",
"$",
"url",
",",
"array",
"$",
"params",
")",
":",
"array",
"{",
"if",
"(",
"isset",
"(",
"$",
"url",
"[",
"'scheme'",
"]",
")",
")",
"{",
"// The requested driver from the URL scheme tak... | Parses the scheme part from given connection URL and resolves the given connection parameters.
@param mixed[] $url The connection URL parts to evaluate.
@param mixed[] $params The connection parameters to resolve.
@return mixed[] The resolved connection parameters.
@throws DBALException If parsing failed or resol... | [
"Parses",
"the",
"scheme",
"part",
"from",
"given",
"connection",
"URL",
"and",
"resolves",
"the",
"given",
"connection",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DriverManager.php#L414-L441 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/OracleSchemaManager.php | OracleSchemaManager.killUserSessions | private function killUserSessions($user)
{
$sql = <<<SQL
SELECT
s.sid,
s.serial#
FROM
gv\$session s,
gv\$process p
WHERE
s.username = ?
AND p.addr(+) = s.paddr
SQL;
$activeUserSessions = $this->_conn->fetchAll($sql, [strtoupper($user)]);
foreach ($activeUserSessions... | php | private function killUserSessions($user)
{
$sql = <<<SQL
SELECT
s.sid,
s.serial#
FROM
gv\$session s,
gv\$process p
WHERE
s.username = ?
AND p.addr(+) = s.paddr
SQL;
$activeUserSessions = $this->_conn->fetchAll($sql, [strtoupper($user)]);
foreach ($activeUserSessions... | [
"private",
"function",
"killUserSessions",
"(",
"$",
"user",
")",
"{",
"$",
"sql",
"=",
" <<<SQL\nSELECT\n s.sid,\n s.serial#\nFROM\n gv\\$session s,\n gv\\$process p\nWHERE\n s.username = ?\n AND p.addr(+) = s.paddr\nSQL",
";",
"$",
"activeUserSessions",
"=",
"$",
... | Kills sessions connected with the given user.
This is useful to force DROP USER operations which could fail because of active user sessions.
@param string $user The name of the user to kill sessions for.
@return void | [
"Kills",
"sessions",
"connected",
"with",
"the",
"given",
"user",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php#L360-L387 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php | Driver._constructPdoDsn | private function _constructPdoDsn(array $params)
{
$dsn = 'ibm:';
if (isset($params['host'])) {
$dsn .= 'HOSTNAME=' . $params['host'] . ';';
}
if (isset($params['port'])) {
$dsn .= 'PORT=' . $params['port'] . ';';
}
$dsn .= 'PROTOCOL=TCPIP;';
... | php | private function _constructPdoDsn(array $params)
{
$dsn = 'ibm:';
if (isset($params['host'])) {
$dsn .= 'HOSTNAME=' . $params['host'] . ';';
}
if (isset($params['port'])) {
$dsn .= 'PORT=' . $params['port'] . ';';
}
$dsn .= 'PROTOCOL=TCPIP;';
... | [
"private",
"function",
"_constructPdoDsn",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"dsn",
"=",
"'ibm:'",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'host'",
"]",
")",
")",
"{",
"$",
"dsn",
".=",
"'HOSTNAME='",
".",
"$",
"params",
"[",
"... | Constructs the IBM PDO DSN.
@param mixed[] $params
@return string The DSN. | [
"Constructs",
"the",
"IBM",
"PDO",
"DSN",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php#L33-L48 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php | CreateSchemaSqlCollector.getQueries | public function getQueries()
{
return array_merge(
$this->createNamespaceQueries,
$this->createTableQueries,
$this->createSequenceQueries,
$this->createFkConstraintQueries
);
} | php | public function getQueries()
{
return array_merge(
$this->createNamespaceQueries,
$this->createTableQueries,
$this->createSequenceQueries,
$this->createFkConstraintQueries
);
} | [
"public",
"function",
"getQueries",
"(",
")",
"{",
"return",
"array_merge",
"(",
"$",
"this",
"->",
"createNamespaceQueries",
",",
"$",
"this",
"->",
"createTableQueries",
",",
"$",
"this",
"->",
"createSequenceQueries",
",",
"$",
"this",
"->",
"createFkConstrai... | Gets all queries collected so far.
@return string[] | [
"Gets",
"all",
"queries",
"collected",
"so",
"far",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php#L89-L97 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php | SQLSrvException.fromSqlSrvErrors | public static function fromSqlSrvErrors()
{
$message = '';
$sqlState = null;
$errorCode = null;
foreach ((array) sqlsrv_errors(SQLSRV_ERR_ERRORS) as $error) {
$message .= 'SQLSTATE [' . $error['SQLSTATE'] . ', ' . $error['code'] . ']: ' . $error['message'] . "\n";
... | php | public static function fromSqlSrvErrors()
{
$message = '';
$sqlState = null;
$errorCode = null;
foreach ((array) sqlsrv_errors(SQLSRV_ERR_ERRORS) as $error) {
$message .= 'SQLSTATE [' . $error['SQLSTATE'] . ', ' . $error['code'] . ']: ' . $error['message'] . "\n";
... | [
"public",
"static",
"function",
"fromSqlSrvErrors",
"(",
")",
"{",
"$",
"message",
"=",
"''",
";",
"$",
"sqlState",
"=",
"null",
";",
"$",
"errorCode",
"=",
"null",
";",
"foreach",
"(",
"(",
"array",
")",
"sqlsrv_errors",
"(",
"SQLSRV_ERR_ERRORS",
")",
"... | Helper method to turn sql server errors into exception.
@return \Doctrine\DBAL\Driver\SQLSrv\SQLSrvException | [
"Helper",
"method",
"to",
"turn",
"sql",
"server",
"errors",
"into",
"exception",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php#L17-L42 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/MySqlPlatform.php | MySqlPlatform.getRemainingForeignKeyConstraintsRequiringRenamedIndexes | private function getRemainingForeignKeyConstraintsRequiringRenamedIndexes(TableDiff $diff)
{
if (empty($diff->renamedIndexes) || ! $diff->fromTable instanceof Table) {
return [];
}
$foreignKeys = [];
/** @var ForeignKeyConstraint[] $remainingForeignKeys */
$remai... | php | private function getRemainingForeignKeyConstraintsRequiringRenamedIndexes(TableDiff $diff)
{
if (empty($diff->renamedIndexes) || ! $diff->fromTable instanceof Table) {
return [];
}
$foreignKeys = [];
/** @var ForeignKeyConstraint[] $remainingForeignKeys */
$remai... | [
"private",
"function",
"getRemainingForeignKeyConstraintsRequiringRenamedIndexes",
"(",
"TableDiff",
"$",
"diff",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"diff",
"->",
"renamedIndexes",
")",
"||",
"!",
"$",
"diff",
"->",
"fromTable",
"instanceof",
"Table",
")",
... | Returns the remaining foreign key constraints that require one of the renamed indexes.
"Remaining" here refers to the diff between the foreign keys currently defined in the associated
table and the foreign keys to be removed.
@param TableDiff $diff The table diff to evaluate.
@return ForeignKeyConstraint[] | [
"Returns",
"the",
"remaining",
"foreign",
"key",
"constraints",
"that",
"require",
"one",
"of",
"the",
"renamed",
"indexes",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L816-L840 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php | SQLSrvStatement.prepare | private function prepare()
{
$params = [];
foreach ($this->variables as $column => &$variable) {
switch ($this->types[$column]) {
case ParameterType::LARGE_OBJECT:
$params[$column - 1] = [
&$variable,
SQ... | php | private function prepare()
{
$params = [];
foreach ($this->variables as $column => &$variable) {
switch ($this->types[$column]) {
case ParameterType::LARGE_OBJECT:
$params[$column - 1] = [
&$variable,
SQ... | [
"private",
"function",
"prepare",
"(",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"variables",
"as",
"$",
"column",
"=>",
"&",
"$",
"variable",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"c... | Prepares SQL Server statement resource
@return resource
@throws SQLSrvException | [
"Prepares",
"SQL",
"Server",
"statement",
"resource"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php#L273-L309 | train |
doctrine/dbal | lib/Doctrine/DBAL/Types/ConversionException.php | ConversionException.conversionFailed | public static function conversionFailed($value, $toType)
{
$value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;
return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType);
} | php | public static function conversionFailed($value, $toType)
{
$value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;
return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType);
} | [
"public",
"static",
"function",
"conversionFailed",
"(",
"$",
"value",
",",
"$",
"toType",
")",
"{",
"$",
"value",
"=",
"strlen",
"(",
"$",
"value",
")",
">",
"32",
"?",
"substr",
"(",
"$",
"value",
",",
"0",
",",
"20",
")",
".",
"'...'",
":",
"$... | Thrown when a Database to Doctrine Type Conversion fails.
@param string $value
@param string $toType
@return \Doctrine\DBAL\Types\ConversionException | [
"Thrown",
"when",
"a",
"Database",
"to",
"Doctrine",
"Type",
"Conversion",
"fails",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Types/ConversionException.php#L29-L34 | train |
doctrine/dbal | lib/Doctrine/DBAL/Types/ConversionException.php | ConversionException.conversionFailedFormat | public static function conversionFailedFormat($value, $toType, $expectedFormat, ?Throwable $previous = null)
{
$value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;
return new self(
'Could not convert database value "' . $value . '" to Doctrine Type ' .
$toT... | php | public static function conversionFailedFormat($value, $toType, $expectedFormat, ?Throwable $previous = null)
{
$value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;
return new self(
'Could not convert database value "' . $value . '" to Doctrine Type ' .
$toT... | [
"public",
"static",
"function",
"conversionFailedFormat",
"(",
"$",
"value",
",",
"$",
"toType",
",",
"$",
"expectedFormat",
",",
"?",
"Throwable",
"$",
"previous",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"strlen",
"(",
"$",
"value",
")",
">",
"32",
... | Thrown when a Database to Doctrine Type Conversion fails and we can make a statement
about the expected format.
@param string $value
@param string $toType
@param string $expectedFormat
@return \Doctrine\DBAL\Types\ConversionException | [
"Thrown",
"when",
"a",
"Database",
"to",
"Doctrine",
"Type",
"Conversion",
"fails",
"and",
"we",
"can",
"make",
"a",
"statement",
"about",
"the",
"expected",
"format",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Types/ConversionException.php#L46-L56 | train |
doctrine/dbal | lib/Doctrine/DBAL/Configuration.php | Configuration.setFilterSchemaAssetsExpression | public function setFilterSchemaAssetsExpression($filterExpression)
{
$this->_attributes['filterSchemaAssetsExpression'] = $filterExpression;
if ($filterExpression) {
$this->_attributes['filterSchemaAssetsExpressionCallable'] = $this->buildSchemaAssetsFilterFromExpression($filterExpressio... | php | public function setFilterSchemaAssetsExpression($filterExpression)
{
$this->_attributes['filterSchemaAssetsExpression'] = $filterExpression;
if ($filterExpression) {
$this->_attributes['filterSchemaAssetsExpressionCallable'] = $this->buildSchemaAssetsFilterFromExpression($filterExpressio... | [
"public",
"function",
"setFilterSchemaAssetsExpression",
"(",
"$",
"filterExpression",
")",
"{",
"$",
"this",
"->",
"_attributes",
"[",
"'filterSchemaAssetsExpression'",
"]",
"=",
"$",
"filterExpression",
";",
"if",
"(",
"$",
"filterExpression",
")",
"{",
"$",
"th... | Sets the filter schema assets expression.
Only include tables/sequences matching the filter expression regexp in
schema instances generated for the active connection when calling
{AbstractSchemaManager#createSchema()}.
@deprecated Use Configuration::setSchemaAssetsFilter() instead
@param string $filterExpression
@r... | [
"Sets",
"the",
"filter",
"schema",
"assets",
"expression",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Configuration.php#L79-L87 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Index.php | Index.spansColumns | public function spansColumns(array $columnNames)
{
$columns = $this->getColumns();
$numberOfColumns = count($columns);
$sameColumns = true;
for ($i = 0; $i < $numberOfColumns; $i++) {
if (isset($columnNames[$i]) && $this->trimQuotes(strtolower($columns[$i])) ... | php | public function spansColumns(array $columnNames)
{
$columns = $this->getColumns();
$numberOfColumns = count($columns);
$sameColumns = true;
for ($i = 0; $i < $numberOfColumns; $i++) {
if (isset($columnNames[$i]) && $this->trimQuotes(strtolower($columns[$i])) ... | [
"public",
"function",
"spansColumns",
"(",
"array",
"$",
"columnNames",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"getColumns",
"(",
")",
";",
"$",
"numberOfColumns",
"=",
"count",
"(",
"$",
"columns",
")",
";",
"$",
"sameColumns",
"=",
"true",
... | Checks if this index exactly spans the given column names in the correct order.
@param string[] $columnNames
@return bool | [
"Checks",
"if",
"this",
"index",
"exactly",
"spans",
"the",
"given",
"column",
"names",
"in",
"the",
"correct",
"order",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Index.php#L177-L192 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Index.php | Index.isFullfilledBy | public function isFullfilledBy(Index $other)
{
// allow the other index to be equally large only. It being larger is an option
// but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)
if (count($other->getColumns()) !== count($this->getColumns())) {
... | php | public function isFullfilledBy(Index $other)
{
// allow the other index to be equally large only. It being larger is an option
// but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)
if (count($other->getColumns()) !== count($this->getColumns())) {
... | [
"public",
"function",
"isFullfilledBy",
"(",
"Index",
"$",
"other",
")",
"{",
"// allow the other index to be equally large only. It being larger is an option",
"// but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)",
"if",
"(",
"count",
"(",
"$",
"o... | Checks if the other index already fulfills all the indexing and constraint needs of the current one.
@return bool | [
"Checks",
"if",
"the",
"other",
"index",
"already",
"fulfills",
"all",
"the",
"indexing",
"and",
"constraint",
"needs",
"of",
"the",
"current",
"one",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Index.php#L199-L235 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Index.php | Index.overrules | public function overrules(Index $other)
{
if ($other->isPrimary()) {
return false;
}
if ($this->isSimpleIndex() && $other->isUnique()) {
return false;
}
return $this->spansColumns($other->getColumns()) && ($this->isPrimary() || $this->isUnique()) && ... | php | public function overrules(Index $other)
{
if ($other->isPrimary()) {
return false;
}
if ($this->isSimpleIndex() && $other->isUnique()) {
return false;
}
return $this->spansColumns($other->getColumns()) && ($this->isPrimary() || $this->isUnique()) && ... | [
"public",
"function",
"overrules",
"(",
"Index",
"$",
"other",
")",
"{",
"if",
"(",
"$",
"other",
"->",
"isPrimary",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isSimpleIndex",
"(",
")",
"&&",
"$",
"other",
"->",... | Detects if the other index is a non-unique, non primary index that can be overwritten by this one.
@return bool | [
"Detects",
"if",
"the",
"other",
"index",
"is",
"a",
"non",
"-",
"unique",
"non",
"primary",
"index",
"that",
"can",
"be",
"overwritten",
"by",
"this",
"one",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Index.php#L242-L253 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Index.php | Index.samePartialIndex | private function samePartialIndex(Index $other)
{
if ($this->hasOption('where') && $other->hasOption('where') && $this->getOption('where') === $other->getOption('where')) {
return true;
}
return ! $this->hasOption('where') && ! $other->hasOption('where');
} | php | private function samePartialIndex(Index $other)
{
if ($this->hasOption('where') && $other->hasOption('where') && $this->getOption('where') === $other->getOption('where')) {
return true;
}
return ! $this->hasOption('where') && ! $other->hasOption('where');
} | [
"private",
"function",
"samePartialIndex",
"(",
"Index",
"$",
"other",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasOption",
"(",
"'where'",
")",
"&&",
"$",
"other",
"->",
"hasOption",
"(",
"'where'",
")",
"&&",
"$",
"this",
"->",
"getOption",
"(",
"'wh... | Return whether the two indexes have the same partial index
@return bool | [
"Return",
"whether",
"the",
"two",
"indexes",
"have",
"the",
"same",
"partial",
"index"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Index.php#L338-L345 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Index.php | Index.hasSameColumnLengths | private function hasSameColumnLengths(self $other) : bool
{
$filter = static function (?int $length) : bool {
return $length !== null;
};
return array_filter($this->options['lengths'] ?? [], $filter)
=== array_filter($other->options['lengths'] ?? [], $filter);
} | php | private function hasSameColumnLengths(self $other) : bool
{
$filter = static function (?int $length) : bool {
return $length !== null;
};
return array_filter($this->options['lengths'] ?? [], $filter)
=== array_filter($other->options['lengths'] ?? [], $filter);
} | [
"private",
"function",
"hasSameColumnLengths",
"(",
"self",
"$",
"other",
")",
":",
"bool",
"{",
"$",
"filter",
"=",
"static",
"function",
"(",
"?",
"int",
"$",
"length",
")",
":",
"bool",
"{",
"return",
"$",
"length",
"!==",
"null",
";",
"}",
";",
"... | Returns whether the index has the same column lengths as the other | [
"Returns",
"whether",
"the",
"index",
"has",
"the",
"same",
"column",
"lengths",
"as",
"the",
"other"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Index.php#L350-L358 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/OraclePlatform.php | OraclePlatform.getSequenceCacheSQL | private function getSequenceCacheSQL(Sequence $sequence)
{
if ($sequence->getCache() === 0) {
return ' NOCACHE';
}
if ($sequence->getCache() === 1) {
return ' NOCACHE';
}
if ($sequence->getCache() > 1) {
return ' CACHE ' . $sequence->getC... | php | private function getSequenceCacheSQL(Sequence $sequence)
{
if ($sequence->getCache() === 0) {
return ' NOCACHE';
}
if ($sequence->getCache() === 1) {
return ' NOCACHE';
}
if ($sequence->getCache() > 1) {
return ' CACHE ' . $sequence->getC... | [
"private",
"function",
"getSequenceCacheSQL",
"(",
"Sequence",
"$",
"sequence",
")",
"{",
"if",
"(",
"$",
"sequence",
"->",
"getCache",
"(",
")",
"===",
"0",
")",
"{",
"return",
"' NOCACHE'",
";",
"}",
"if",
"(",
"$",
"sequence",
"->",
"getCache",
"(",
... | Cache definition for sequences
@return string | [
"Cache",
"definition",
"for",
"sequences"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/OraclePlatform.php#L200-L215 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/OraclePlatform.php | OraclePlatform.getDropAutoincrementSql | public function getDropAutoincrementSql($table)
{
$table = $this->normalizeIdentifier($table);
$autoincrementIdentifierName = $this->getAutoincrementIdentifierName($table);
$identitySequenceName = $this->getIdentitySequenceName(
$table->isQuoted() ? $... | php | public function getDropAutoincrementSql($table)
{
$table = $this->normalizeIdentifier($table);
$autoincrementIdentifierName = $this->getAutoincrementIdentifierName($table);
$identitySequenceName = $this->getIdentitySequenceName(
$table->isQuoted() ? $... | [
"public",
"function",
"getDropAutoincrementSql",
"(",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"table",
")",
";",
"$",
"autoincrementIdentifierName",
"=",
"$",
"this",
"->",
"getAutoincrementIdentifierName",
... | Returns the SQL statements to drop the autoincrement for the given table name.
@param string $table The table name to drop the autoincrement for.
@return string[] | [
"Returns",
"the",
"SQL",
"statements",
"to",
"drop",
"the",
"autoincrement",
"for",
"the",
"given",
"table",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/OraclePlatform.php#L549-L563 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/OraclePlatform.php | OraclePlatform.normalizeIdentifier | private function normalizeIdentifier($name)
{
$identifier = new Identifier($name);
return $identifier->isQuoted() ? $identifier : new Identifier(strtoupper($name));
} | php | private function normalizeIdentifier($name)
{
$identifier = new Identifier($name);
return $identifier->isQuoted() ? $identifier : new Identifier(strtoupper($name));
} | [
"private",
"function",
"normalizeIdentifier",
"(",
"$",
"name",
")",
"{",
"$",
"identifier",
"=",
"new",
"Identifier",
"(",
"$",
"name",
")",
";",
"return",
"$",
"identifier",
"->",
"isQuoted",
"(",
")",
"?",
"$",
"identifier",
":",
"new",
"Identifier",
... | Normalizes the given identifier.
Uppercases the given identifier if it is not quoted by intention
to reflect Oracle's internal auto uppercasing strategy of unquoted identifiers.
@param string $name The identifier to normalize.
@return Identifier The normalized identifier. | [
"Normalizes",
"the",
"given",
"identifier",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/OraclePlatform.php#L575-L580 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/OraclePlatform.php | OraclePlatform.getAutoincrementIdentifierName | private function getAutoincrementIdentifierName(Identifier $table)
{
$identifierName = $table->getName() . '_AI_PK';
return $table->isQuoted()
? $this->quoteSingleIdentifier($identifierName)
: $identifierName;
} | php | private function getAutoincrementIdentifierName(Identifier $table)
{
$identifierName = $table->getName() . '_AI_PK';
return $table->isQuoted()
? $this->quoteSingleIdentifier($identifierName)
: $identifierName;
} | [
"private",
"function",
"getAutoincrementIdentifierName",
"(",
"Identifier",
"$",
"table",
")",
"{",
"$",
"identifierName",
"=",
"$",
"table",
"->",
"getName",
"(",
")",
".",
"'_AI_PK'",
";",
"return",
"$",
"table",
"->",
"isQuoted",
"(",
")",
"?",
"$",
"th... | Returns the autoincrement primary key identifier name for the given table identifier.
Quotes the autoincrement primary key identifier name
if the given table name is quoted by intention.
@param Identifier $table The table identifier to return the autoincrement primary key identifier name for.
@return string | [
"Returns",
"the",
"autoincrement",
"primary",
"key",
"identifier",
"name",
"for",
"the",
"given",
"table",
"identifier",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/OraclePlatform.php#L592-L599 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.setPrimaryKey | public function setPrimaryKey(array $columnNames, $indexName = false)
{
$this->_addIndex($this->_createIndex($columnNames, $indexName ?: 'primary', true, true));
foreach ($columnNames as $columnName) {
$column = $this->getColumn($columnName);
$column->setNotnull(true);
... | php | public function setPrimaryKey(array $columnNames, $indexName = false)
{
$this->_addIndex($this->_createIndex($columnNames, $indexName ?: 'primary', true, true));
foreach ($columnNames as $columnName) {
$column = $this->getColumn($columnName);
$column->setNotnull(true);
... | [
"public",
"function",
"setPrimaryKey",
"(",
"array",
"$",
"columnNames",
",",
"$",
"indexName",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"_addIndex",
"(",
"$",
"this",
"->",
"_createIndex",
"(",
"$",
"columnNames",
",",
"$",
"indexName",
"?",
":",
"'pr... | Sets the Primary Key.
@param string[] $columnNames
@param string|false $indexName
@return self | [
"Sets",
"the",
"Primary",
"Key",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L103-L113 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.columnsAreIndexed | public function columnsAreIndexed(array $columnNames)
{
foreach ($this->getIndexes() as $index) {
/** @var $index Index */
if ($index->spansColumns($columnNames)) {
return true;
}
}
return false;
} | php | public function columnsAreIndexed(array $columnNames)
{
foreach ($this->getIndexes() as $index) {
/** @var $index Index */
if ($index->spansColumns($columnNames)) {
return true;
}
}
return false;
} | [
"public",
"function",
"columnsAreIndexed",
"(",
"array",
"$",
"columnNames",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getIndexes",
"(",
")",
"as",
"$",
"index",
")",
"{",
"/** @var $index Index */",
"if",
"(",
"$",
"index",
"->",
"spansColumns",
"(",
... | Checks if an index begins in the order of the given columns.
@param string[] $columnNames
@return bool | [
"Checks",
"if",
"an",
"index",
"begins",
"in",
"the",
"order",
"of",
"the",
"given",
"columns",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L238-L248 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.changeColumn | public function changeColumn($columnName, array $options)
{
$column = $this->getColumn($columnName);
$column->setOptions($options);
return $this;
} | php | public function changeColumn($columnName, array $options)
{
$column = $this->getColumn($columnName);
$column->setOptions($options);
return $this;
} | [
"public",
"function",
"changeColumn",
"(",
"$",
"columnName",
",",
"array",
"$",
"options",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"getColumn",
"(",
"$",
"columnName",
")",
";",
"$",
"column",
"->",
"setOptions",
"(",
"$",
"options",
")",
";"... | Change Column Details.
@param string $columnName
@param mixed[] $options
@return self | [
"Change",
"Column",
"Details",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L318-L324 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.dropColumn | public function dropColumn($columnName)
{
$columnName = $this->normalizeIdentifier($columnName);
unset($this->_columns[$columnName]);
return $this;
} | php | public function dropColumn($columnName)
{
$columnName = $this->normalizeIdentifier($columnName);
unset($this->_columns[$columnName]);
return $this;
} | [
"public",
"function",
"dropColumn",
"(",
"$",
"columnName",
")",
"{",
"$",
"columnName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"columnName",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"_columns",
"[",
"$",
"columnName",
"]",
")",
";",
... | Drops a Column from the Table.
@param string $columnName
@return self | [
"Drops",
"a",
"Column",
"from",
"the",
"Table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L333-L339 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.addNamedForeignKeyConstraint | public function addNamedForeignKeyConstraint($name, $foreignTable, array $localColumnNames, array $foreignColumnNames, array $options = [])
{
if ($foreignTable instanceof Table) {
foreach ($foreignColumnNames as $columnName) {
if (! $foreignTable->hasColumn($columnName)) {
... | php | public function addNamedForeignKeyConstraint($name, $foreignTable, array $localColumnNames, array $foreignColumnNames, array $options = [])
{
if ($foreignTable instanceof Table) {
foreach ($foreignColumnNames as $columnName) {
if (! $foreignTable->hasColumn($columnName)) {
... | [
"public",
"function",
"addNamedForeignKeyConstraint",
"(",
"$",
"name",
",",
"$",
"foreignTable",
",",
"array",
"$",
"localColumnNames",
",",
"array",
"$",
"foreignColumnNames",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"foreignT... | Adds a foreign key constraint with a given name.
@deprecated Use {@link addForeignKeyConstraint}
@param string $name
@param Table|string $foreignTable Table schema instance or table name
@param string[] $localColumnNames
@param string[] $foreignColumnNames
@param mixed[] $options
@return sel... | [
"Adds",
"a",
"foreign",
"key",
"constraint",
"with",
"a",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L395-L421 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.hasForeignKey | public function hasForeignKey($constraintName)
{
$constraintName = $this->normalizeIdentifier($constraintName);
return isset($this->_fkConstraints[$constraintName]);
} | php | public function hasForeignKey($constraintName)
{
$constraintName = $this->normalizeIdentifier($constraintName);
return isset($this->_fkConstraints[$constraintName]);
} | [
"public",
"function",
"hasForeignKey",
"(",
"$",
"constraintName",
")",
"{",
"$",
"constraintName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"constraintName",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"_fkConstraints",
"[",
"$",
"c... | Returns whether this table has a foreign key constraint with the given name.
@param string $constraintName
@return bool | [
"Returns",
"whether",
"this",
"table",
"has",
"a",
"foreign",
"key",
"constraint",
"with",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L540-L545 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.getForeignKey | public function getForeignKey($constraintName)
{
$constraintName = $this->normalizeIdentifier($constraintName);
if (! $this->hasForeignKey($constraintName)) {
throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name);
}
return $this->_fkConstraints[$co... | php | public function getForeignKey($constraintName)
{
$constraintName = $this->normalizeIdentifier($constraintName);
if (! $this->hasForeignKey($constraintName)) {
throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name);
}
return $this->_fkConstraints[$co... | [
"public",
"function",
"getForeignKey",
"(",
"$",
"constraintName",
")",
"{",
"$",
"constraintName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"constraintName",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasForeignKey",
"(",
"$",
"constraint... | Returns the foreign key constraint with the given name.
@param string $constraintName The constraint name.
@return ForeignKeyConstraint
@throws SchemaException If the foreign key does not exist. | [
"Returns",
"the",
"foreign",
"key",
"constraint",
"with",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L556-L564 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.getForeignKeyColumns | private function getForeignKeyColumns()
{
$foreignKeyColumns = [];
foreach ($this->getForeignKeys() as $foreignKey) {
$foreignKeyColumns = array_merge($foreignKeyColumns, $foreignKey->getColumns());
}
return $this->filterColumns($foreignKeyColumns);
} | php | private function getForeignKeyColumns()
{
$foreignKeyColumns = [];
foreach ($this->getForeignKeys() as $foreignKey) {
$foreignKeyColumns = array_merge($foreignKeyColumns, $foreignKey->getColumns());
}
return $this->filterColumns($foreignKeyColumns);
} | [
"private",
"function",
"getForeignKeyColumns",
"(",
")",
"{",
"$",
"foreignKeyColumns",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getForeignKeys",
"(",
")",
"as",
"$",
"foreignKey",
")",
"{",
"$",
"foreignKeyColumns",
"=",
"array_merge",
"(",
... | Returns foreign key columns
@return Column[] | [
"Returns",
"foreign",
"key",
"columns"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L607-L615 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.filterColumns | private function filterColumns(array $columnNames)
{
return array_filter($this->_columns, static function ($columnName) use ($columnNames) {
return in_array($columnName, $columnNames, true);
}, ARRAY_FILTER_USE_KEY);
} | php | private function filterColumns(array $columnNames)
{
return array_filter($this->_columns, static function ($columnName) use ($columnNames) {
return in_array($columnName, $columnNames, true);
}, ARRAY_FILTER_USE_KEY);
} | [
"private",
"function",
"filterColumns",
"(",
"array",
"$",
"columnNames",
")",
"{",
"return",
"array_filter",
"(",
"$",
"this",
"->",
"_columns",
",",
"static",
"function",
"(",
"$",
"columnName",
")",
"use",
"(",
"$",
"columnNames",
")",
"{",
"return",
"i... | Returns only columns that have specified names
@param string[] $columnNames
@return Column[] | [
"Returns",
"only",
"columns",
"that",
"have",
"specified",
"names"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L624-L629 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.hasColumn | public function hasColumn($columnName)
{
$columnName = $this->normalizeIdentifier($columnName);
return isset($this->_columns[$columnName]);
} | php | public function hasColumn($columnName)
{
$columnName = $this->normalizeIdentifier($columnName);
return isset($this->_columns[$columnName]);
} | [
"public",
"function",
"hasColumn",
"(",
"$",
"columnName",
")",
"{",
"$",
"columnName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"columnName",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"_columns",
"[",
"$",
"columnName",
"]",
"... | Returns whether this table has a Column with the given name.
@param string $columnName The column name.
@return bool | [
"Returns",
"whether",
"this",
"table",
"has",
"a",
"Column",
"with",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L638-L643 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.getColumn | public function getColumn($columnName)
{
$columnName = $this->normalizeIdentifier($columnName);
if (! $this->hasColumn($columnName)) {
throw SchemaException::columnDoesNotExist($columnName, $this->_name);
}
return $this->_columns[$columnName];
} | php | public function getColumn($columnName)
{
$columnName = $this->normalizeIdentifier($columnName);
if (! $this->hasColumn($columnName)) {
throw SchemaException::columnDoesNotExist($columnName, $this->_name);
}
return $this->_columns[$columnName];
} | [
"public",
"function",
"getColumn",
"(",
"$",
"columnName",
")",
"{",
"$",
"columnName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"columnName",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumn",
"(",
"$",
"columnName",
")",
")",
"... | Returns the Column with the given name.
@param string $columnName The column name.
@return Column
@throws SchemaException If the column does not exist. | [
"Returns",
"the",
"Column",
"with",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L654-L662 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.