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/Schema/Table.php | Table.getPrimaryKeyColumns | public function getPrimaryKeyColumns()
{
$primaryKey = $this->getPrimaryKey();
if ($primaryKey === null) {
throw new DBALException('Table ' . $this->getName() . ' has no primary key.');
}
return $primaryKey->getColumns();
} | php | public function getPrimaryKeyColumns()
{
$primaryKey = $this->getPrimaryKey();
if ($primaryKey === null) {
throw new DBALException('Table ' . $this->getName() . ' has no primary key.');
}
return $primaryKey->getColumns();
} | [
"public",
"function",
"getPrimaryKeyColumns",
"(",
")",
"{",
"$",
"primaryKey",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"if",
"(",
"$",
"primaryKey",
"===",
"null",
")",
"{",
"throw",
"new",
"DBALException",
"(",
"'Table '",
".",
"$",
"th... | Returns the primary key columns.
@return string[]
@throws DBALException | [
"Returns",
"the",
"primary",
"key",
"columns",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L685-L694 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.hasIndex | public function hasIndex($indexName)
{
$indexName = $this->normalizeIdentifier($indexName);
return isset($this->_indexes[$indexName]);
} | php | public function hasIndex($indexName)
{
$indexName = $this->normalizeIdentifier($indexName);
return isset($this->_indexes[$indexName]);
} | [
"public",
"function",
"hasIndex",
"(",
"$",
"indexName",
")",
"{",
"$",
"indexName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"indexName",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"_indexes",
"[",
"$",
"indexName",
"]",
")",
... | Returns whether this table has an Index with the given name.
@param string $indexName The index name.
@return bool | [
"Returns",
"whether",
"this",
"table",
"has",
"an",
"Index",
"with",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L713-L718 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Table.php | Table.getIndex | public function getIndex($indexName)
{
$indexName = $this->normalizeIdentifier($indexName);
if (! $this->hasIndex($indexName)) {
throw SchemaException::indexDoesNotExist($indexName, $this->_name);
}
return $this->_indexes[$indexName];
} | php | public function getIndex($indexName)
{
$indexName = $this->normalizeIdentifier($indexName);
if (! $this->hasIndex($indexName)) {
throw SchemaException::indexDoesNotExist($indexName, $this->_name);
}
return $this->_indexes[$indexName];
} | [
"public",
"function",
"getIndex",
"(",
"$",
"indexName",
")",
"{",
"$",
"indexName",
"=",
"$",
"this",
"->",
"normalizeIdentifier",
"(",
"$",
"indexName",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"hasIndex",
"(",
"$",
"indexName",
")",
")",
"{",
... | Returns the Index with the given name.
@param string $indexName The index name.
@return Index
@throws SchemaException If the index does not exist. | [
"Returns",
"the",
"Index",
"with",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Table.php#L729-L737 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Sequence.php | Sequence.isAutoIncrementsFor | public function isAutoIncrementsFor(Table $table)
{
$primaryKey = $table->getPrimaryKey();
if ($primaryKey === null) {
return false;
}
$pkColumns = $primaryKey->getColumns();
if (count($pkColumns) !== 1) {
return false;
}
$column = ... | php | public function isAutoIncrementsFor(Table $table)
{
$primaryKey = $table->getPrimaryKey();
if ($primaryKey === null) {
return false;
}
$pkColumns = $primaryKey->getColumns();
if (count($pkColumns) !== 1) {
return false;
}
$column = ... | [
"public",
"function",
"isAutoIncrementsFor",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"primaryKey",
"=",
"$",
"table",
"->",
"getPrimaryKey",
"(",
")",
";",
"if",
"(",
"$",
"primaryKey",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"pkC... | Checks if this sequence is an autoincrement sequence for a given table.
This is used inside the comparator to not report sequences as missing,
when the "from" schema implicitly creates the sequences.
@return bool | [
"Checks",
"if",
"this",
"sequence",
"is",
"an",
"autoincrement",
"sequence",
"for",
"a",
"given",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Sequence.php#L105-L130 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php | MysqliConnection.setDriverOptions | private function setDriverOptions(array $driverOptions = [])
{
$supportedDriverOptions = [
MYSQLI_OPT_CONNECT_TIMEOUT,
MYSQLI_OPT_LOCAL_INFILE,
MYSQLI_INIT_COMMAND,
MYSQLI_READ_DEFAULT_FILE,
MYSQLI_READ_DEFAULT_GROUP,
];
if (define... | php | private function setDriverOptions(array $driverOptions = [])
{
$supportedDriverOptions = [
MYSQLI_OPT_CONNECT_TIMEOUT,
MYSQLI_OPT_LOCAL_INFILE,
MYSQLI_INIT_COMMAND,
MYSQLI_READ_DEFAULT_FILE,
MYSQLI_READ_DEFAULT_GROUP,
];
if (define... | [
"private",
"function",
"setDriverOptions",
"(",
"array",
"$",
"driverOptions",
"=",
"[",
"]",
")",
"{",
"$",
"supportedDriverOptions",
"=",
"[",
"MYSQLI_OPT_CONNECT_TIMEOUT",
",",
"MYSQLI_OPT_LOCAL_INFILE",
",",
"MYSQLI_INIT_COMMAND",
",",
"MYSQLI_READ_DEFAULT_FILE",
",... | Apply the driver options to the connection.
@param mixed[] $driverOptions
@throws MysqliException When one of of the options is not supported.
@throws MysqliException When applying doesn't work - e.g. due to incorrect value. | [
"Apply",
"the",
"driver",
"options",
"to",
"the",
"connection",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php#L225-L265 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php | MysqliConnection.setSecureConnection | private function setSecureConnection(array $params)
{
if (! isset($params['ssl_key']) &&
! isset($params['ssl_cert']) &&
! isset($params['ssl_ca']) &&
! isset($params['ssl_capath']) &&
! isset($params['ssl_cipher'])
) {
return;
}
... | php | private function setSecureConnection(array $params)
{
if (! isset($params['ssl_key']) &&
! isset($params['ssl_cert']) &&
! isset($params['ssl_ca']) &&
! isset($params['ssl_capath']) &&
! isset($params['ssl_cipher'])
) {
return;
}
... | [
"private",
"function",
"setSecureConnection",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'ssl_key'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"params",
"[",
"'ssl_cert'",
"]",
")",
"&&",
"!",
"isset",
"("... | Establish a secure connection
@param mixed[] $params
@throws MysqliException | [
"Establish",
"a",
"secure",
"connection"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php#L284-L302 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.tryMethod | public function tryMethod()
{
$args = func_get_args();
$method = $args[0];
unset($args[0]);
$args = array_values($args);
$callback = [$this, $method];
assert(is_callable($callback));
try {
return call_user_func_array($callback, $args);
... | php | public function tryMethod()
{
$args = func_get_args();
$method = $args[0];
unset($args[0]);
$args = array_values($args);
$callback = [$this, $method];
assert(is_callable($callback));
try {
return call_user_func_array($callback, $args);
... | [
"public",
"function",
"tryMethod",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"method",
"=",
"$",
"args",
"[",
"0",
"]",
";",
"unset",
"(",
"$",
"args",
"[",
"0",
"]",
")",
";",
"$",
"args",
"=",
"array_values",
"(",
... | Tries any method on the schema manager. Normally a method throws an
exception when your DBMS doesn't support it or if an error occurs.
This method allows you to try and method on your SchemaManager
instance and will return false if it does not work or is not supported.
<code>
$result = $sm->tryMethod('dropView', 'view... | [
"Tries",
"any",
"method",
"on",
"the",
"schema",
"manager",
".",
"Normally",
"a",
"method",
"throws",
"an",
"exception",
"when",
"your",
"DBMS",
"doesn",
"t",
"support",
"it",
"or",
"if",
"an",
"error",
"occurs",
".",
"This",
"method",
"allows",
"you",
"... | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L78-L93 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.listDatabases | public function listDatabases()
{
$sql = $this->_platform->getListDatabasesSQL();
$databases = $this->_conn->fetchAll($sql);
return $this->_getPortableDatabasesList($databases);
} | php | public function listDatabases()
{
$sql = $this->_platform->getListDatabasesSQL();
$databases = $this->_conn->fetchAll($sql);
return $this->_getPortableDatabasesList($databases);
} | [
"public",
"function",
"listDatabases",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"_platform",
"->",
"getListDatabasesSQL",
"(",
")",
";",
"$",
"databases",
"=",
"$",
"this",
"->",
"_conn",
"->",
"fetchAll",
"(",
"$",
"sql",
")",
";",
"return",... | Lists the available databases for this connection.
@return string[] | [
"Lists",
"the",
"available",
"databases",
"for",
"this",
"connection",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L100-L107 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.listNamespaceNames | public function listNamespaceNames()
{
$sql = $this->_platform->getListNamespacesSQL();
$namespaces = $this->_conn->fetchAll($sql);
return $this->getPortableNamespacesList($namespaces);
} | php | public function listNamespaceNames()
{
$sql = $this->_platform->getListNamespacesSQL();
$namespaces = $this->_conn->fetchAll($sql);
return $this->getPortableNamespacesList($namespaces);
} | [
"public",
"function",
"listNamespaceNames",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"_platform",
"->",
"getListNamespacesSQL",
"(",
")",
";",
"$",
"namespaces",
"=",
"$",
"this",
"->",
"_conn",
"->",
"fetchAll",
"(",
"$",
"sql",
")",
";",
"r... | Returns a list of all namespaces in the current database.
@return string[] | [
"Returns",
"a",
"list",
"of",
"all",
"namespaces",
"in",
"the",
"current",
"database",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L114-L121 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.listSequences | public function listSequences($database = null)
{
if ($database === null) {
$database = $this->_conn->getDatabase();
}
$sql = $this->_platform->getListSequencesSQL($database);
$sequences = $this->_conn->fetchAll($sql);
return $this->filterAssetNames($this->_getP... | php | public function listSequences($database = null)
{
if ($database === null) {
$database = $this->_conn->getDatabase();
}
$sql = $this->_platform->getListSequencesSQL($database);
$sequences = $this->_conn->fetchAll($sql);
return $this->filterAssetNames($this->_getP... | [
"public",
"function",
"listSequences",
"(",
"$",
"database",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"database",
"===",
"null",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"_conn",
"->",
"getDatabase",
"(",
")",
";",
"}",
"$",
"sql",
"=",
"$"... | Lists the available sequences for this connection.
@param string|null $database
@return Sequence[] | [
"Lists",
"the",
"available",
"sequences",
"for",
"this",
"connection",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L130-L140 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.listTableColumns | public function listTableColumns($table, $database = null)
{
if (! $database) {
$database = $this->_conn->getDatabase();
}
$sql = $this->_platform->getListTableColumnsSQL($table, $database);
$tableColumns = $this->_conn->fetchAll($sql);
return $this->_getPortab... | php | public function listTableColumns($table, $database = null)
{
if (! $database) {
$database = $this->_conn->getDatabase();
}
$sql = $this->_platform->getListTableColumnsSQL($table, $database);
$tableColumns = $this->_conn->fetchAll($sql);
return $this->_getPortab... | [
"public",
"function",
"listTableColumns",
"(",
"$",
"table",
",",
"$",
"database",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"database",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"_conn",
"->",
"getDatabase",
"(",
")",
";",
"}",
"$",
"sq... | Lists the columns for a given table.
In contrast to other libraries and to the old version of Doctrine,
this column definition does try to contain the 'primary' field for
the reason that it is not portable across different RDBMS. Use
{@see listTableIndexes($tableName)} to retrieve the primary key
of a table. We're a R... | [
"Lists",
"the",
"columns",
"for",
"a",
"given",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L157-L168 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.tablesExist | public function tablesExist($tableNames)
{
$tableNames = array_map('strtolower', (array) $tableNames);
return count($tableNames) === count(array_intersect($tableNames, array_map('strtolower', $this->listTableNames())));
} | php | public function tablesExist($tableNames)
{
$tableNames = array_map('strtolower', (array) $tableNames);
return count($tableNames) === count(array_intersect($tableNames, array_map('strtolower', $this->listTableNames())));
} | [
"public",
"function",
"tablesExist",
"(",
"$",
"tableNames",
")",
"{",
"$",
"tableNames",
"=",
"array_map",
"(",
"'strtolower'",
",",
"(",
"array",
")",
"$",
"tableNames",
")",
";",
"return",
"count",
"(",
"$",
"tableNames",
")",
"===",
"count",
"(",
"ar... | Returns true if all the given tables exist.
@param string|string[] $tableNames
@return bool | [
"Returns",
"true",
"if",
"all",
"the",
"given",
"tables",
"exist",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L195-L200 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.listTableNames | public function listTableNames()
{
$sql = $this->_platform->getListTablesSQL();
$tables = $this->_conn->fetchAll($sql);
$tableNames = $this->_getPortableTablesList($tables);
return $this->filterAssetNames($tableNames);
} | php | public function listTableNames()
{
$sql = $this->_platform->getListTablesSQL();
$tables = $this->_conn->fetchAll($sql);
$tableNames = $this->_getPortableTablesList($tables);
return $this->filterAssetNames($tableNames);
} | [
"public",
"function",
"listTableNames",
"(",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"_platform",
"->",
"getListTablesSQL",
"(",
")",
";",
"$",
"tables",
"=",
"$",
"this",
"->",
"_conn",
"->",
"fetchAll",
"(",
"$",
"sql",
")",
";",
"$",
"tableN... | Returns a list of all tables in the current database.
@return string[] | [
"Returns",
"a",
"list",
"of",
"all",
"tables",
"in",
"the",
"current",
"database",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L207-L215 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.filterAssetNames | protected function filterAssetNames($assetNames)
{
$filter = $this->_conn->getConfiguration()->getSchemaAssetsFilter();
if (! $filter) {
return $assetNames;
}
return array_values(array_filter($assetNames, $filter));
} | php | protected function filterAssetNames($assetNames)
{
$filter = $this->_conn->getConfiguration()->getSchemaAssetsFilter();
if (! $filter) {
return $assetNames;
}
return array_values(array_filter($assetNames, $filter));
} | [
"protected",
"function",
"filterAssetNames",
"(",
"$",
"assetNames",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"_conn",
"->",
"getConfiguration",
"(",
")",
"->",
"getSchemaAssetsFilter",
"(",
")",
";",
"if",
"(",
"!",
"$",
"filter",
")",
"{",
"ret... | Filters asset names if they are configured to return only a subset of all
the found elements.
@param mixed[] $assetNames
@return mixed[] | [
"Filters",
"asset",
"names",
"if",
"they",
"are",
"configured",
"to",
"return",
"only",
"a",
"subset",
"of",
"all",
"the",
"found",
"elements",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L225-L233 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.listViews | public function listViews()
{
$database = $this->_conn->getDatabase();
$sql = $this->_platform->getListViewsSQL($database);
$views = $this->_conn->fetchAll($sql);
return $this->_getPortableViewsList($views);
} | php | public function listViews()
{
$database = $this->_conn->getDatabase();
$sql = $this->_platform->getListViewsSQL($database);
$views = $this->_conn->fetchAll($sql);
return $this->_getPortableViewsList($views);
} | [
"public",
"function",
"listViews",
"(",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"_conn",
"->",
"getDatabase",
"(",
")",
";",
"$",
"sql",
"=",
"$",
"this",
"->",
"_platform",
"->",
"getListViewsSQL",
"(",
"$",
"database",
")",
";",
"$",
"vi... | Lists the views this connection has.
@return View[] | [
"Lists",
"the",
"views",
"this",
"connection",
"has",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L284-L291 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropIndex | public function dropIndex($index, $table)
{
if ($index instanceof Index) {
$index = $index->getQuotedName($this->_platform);
}
$this->_execSql($this->_platform->getDropIndexSQL($index, $table));
} | php | public function dropIndex($index, $table)
{
if ($index instanceof Index) {
$index = $index->getQuotedName($this->_platform);
}
$this->_execSql($this->_platform->getDropIndexSQL($index, $table));
} | [
"public",
"function",
"dropIndex",
"(",
"$",
"index",
",",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"index",
"instanceof",
"Index",
")",
"{",
"$",
"index",
"=",
"$",
"index",
"->",
"getQuotedName",
"(",
"$",
"this",
"->",
"_platform",
")",
";",
"}",
... | Drops the index from the given table.
@param Index|string $index The name of the index.
@param Table|string $table The name of the table.
@return void | [
"Drops",
"the",
"index",
"from",
"the",
"given",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L348-L355 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropConstraint | public function dropConstraint(Constraint $constraint, $table)
{
$this->_execSql($this->_platform->getDropConstraintSQL($constraint, $table));
} | php | public function dropConstraint(Constraint $constraint, $table)
{
$this->_execSql($this->_platform->getDropConstraintSQL($constraint, $table));
} | [
"public",
"function",
"dropConstraint",
"(",
"Constraint",
"$",
"constraint",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"_execSql",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getDropConstraintSQL",
"(",
"$",
"constraint",
",",
"$",
"table",
")",
")"... | Drops the constraint from the given table.
@param Table|string $table The name of the table.
@return void | [
"Drops",
"the",
"constraint",
"from",
"the",
"given",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L364-L367 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropForeignKey | public function dropForeignKey($foreignKey, $table)
{
$this->_execSql($this->_platform->getDropForeignKeySQL($foreignKey, $table));
} | php | public function dropForeignKey($foreignKey, $table)
{
$this->_execSql($this->_platform->getDropForeignKeySQL($foreignKey, $table));
} | [
"public",
"function",
"dropForeignKey",
"(",
"$",
"foreignKey",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"_execSql",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getDropForeignKeySQL",
"(",
"$",
"foreignKey",
",",
"$",
"table",
")",
")",
";",
"}"
] | Drops a foreign key from a table.
@param ForeignKeyConstraint|string $foreignKey The name of the foreign key.
@param Table|string $table The name of the table with the foreign key.
@return void | [
"Drops",
"a",
"foreign",
"key",
"from",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L377-L380 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.createConstraint | public function createConstraint(Constraint $constraint, $table)
{
$this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table));
} | php | public function createConstraint(Constraint $constraint, $table)
{
$this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table));
} | [
"public",
"function",
"createConstraint",
"(",
"Constraint",
"$",
"constraint",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"_execSql",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getCreateConstraintSQL",
"(",
"$",
"constraint",
",",
"$",
"table",
")",
... | Creates a constraint on a table.
@param Table|string $table
@return void | [
"Creates",
"a",
"constraint",
"on",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L452-L455 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.createIndex | public function createIndex(Index $index, $table)
{
$this->_execSql($this->_platform->getCreateIndexSQL($index, $table));
} | php | public function createIndex(Index $index, $table)
{
$this->_execSql($this->_platform->getCreateIndexSQL($index, $table));
} | [
"public",
"function",
"createIndex",
"(",
"Index",
"$",
"index",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"_execSql",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getCreateIndexSQL",
"(",
"$",
"index",
",",
"$",
"table",
")",
")",
";",
"}"
] | Creates a new index on a table.
@param Table|string $table The name of the table on which the index is to be created.
@return void | [
"Creates",
"a",
"new",
"index",
"on",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L464-L467 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.createForeignKey | public function createForeignKey(ForeignKeyConstraint $foreignKey, $table)
{
$this->_execSql($this->_platform->getCreateForeignKeySQL($foreignKey, $table));
} | php | public function createForeignKey(ForeignKeyConstraint $foreignKey, $table)
{
$this->_execSql($this->_platform->getCreateForeignKeySQL($foreignKey, $table));
} | [
"public",
"function",
"createForeignKey",
"(",
"ForeignKeyConstraint",
"$",
"foreignKey",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"_execSql",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getCreateForeignKeySQL",
"(",
"$",
"foreignKey",
",",
"$",
"table"... | Creates a new foreign key.
@param ForeignKeyConstraint $foreignKey The ForeignKey instance.
@param Table|string $table The name of the table on which the foreign key is to be created.
@return void | [
"Creates",
"a",
"new",
"foreign",
"key",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L477-L480 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.createView | public function createView(View $view)
{
$this->_execSql($this->_platform->getCreateViewSQL($view->getQuotedName($this->_platform), $view->getSql()));
} | php | public function createView(View $view)
{
$this->_execSql($this->_platform->getCreateViewSQL($view->getQuotedName($this->_platform), $view->getSql()));
} | [
"public",
"function",
"createView",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"_execSql",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getCreateViewSQL",
"(",
"$",
"view",
"->",
"getQuotedName",
"(",
"$",
"this",
"->",
"_platform",
")",
",",
... | Creates a new view.
@return void | [
"Creates",
"a",
"new",
"view",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L487-L490 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropAndCreateConstraint | public function dropAndCreateConstraint(Constraint $constraint, $table)
{
$this->tryMethod('dropConstraint', $constraint, $table);
$this->createConstraint($constraint, $table);
} | php | public function dropAndCreateConstraint(Constraint $constraint, $table)
{
$this->tryMethod('dropConstraint', $constraint, $table);
$this->createConstraint($constraint, $table);
} | [
"public",
"function",
"dropAndCreateConstraint",
"(",
"Constraint",
"$",
"constraint",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"tryMethod",
"(",
"'dropConstraint'",
",",
"$",
"constraint",
",",
"$",
"table",
")",
";",
"$",
"this",
"->",
"createConstr... | Drops and creates a constraint.
@see dropConstraint()
@see createConstraint()
@param Table|string $table
@return void | [
"Drops",
"and",
"creates",
"a",
"constraint",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L504-L508 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropAndCreateIndex | public function dropAndCreateIndex(Index $index, $table)
{
$this->tryMethod('dropIndex', $index->getQuotedName($this->_platform), $table);
$this->createIndex($index, $table);
} | php | public function dropAndCreateIndex(Index $index, $table)
{
$this->tryMethod('dropIndex', $index->getQuotedName($this->_platform), $table);
$this->createIndex($index, $table);
} | [
"public",
"function",
"dropAndCreateIndex",
"(",
"Index",
"$",
"index",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"tryMethod",
"(",
"'dropIndex'",
",",
"$",
"index",
"->",
"getQuotedName",
"(",
"$",
"this",
"->",
"_platform",
")",
",",
"$",
"table"... | Drops and creates a new index on a table.
@param Table|string $table The name of the table on which the index is to be created.
@return void | [
"Drops",
"and",
"creates",
"a",
"new",
"index",
"on",
"a",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L517-L521 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropAndCreateForeignKey | public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table)
{
$this->tryMethod('dropForeignKey', $foreignKey, $table);
$this->createForeignKey($foreignKey, $table);
} | php | public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table)
{
$this->tryMethod('dropForeignKey', $foreignKey, $table);
$this->createForeignKey($foreignKey, $table);
} | [
"public",
"function",
"dropAndCreateForeignKey",
"(",
"ForeignKeyConstraint",
"$",
"foreignKey",
",",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"tryMethod",
"(",
"'dropForeignKey'",
",",
"$",
"foreignKey",
",",
"$",
"table",
")",
";",
"$",
"this",
"->",
"cr... | Drops and creates a new foreign key.
@param ForeignKeyConstraint $foreignKey An associative array that defines properties of the foreign key to be created.
@param Table|string $table The name of the table on which the foreign key is to be created.
@return void | [
"Drops",
"and",
"creates",
"a",
"new",
"foreign",
"key",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L531-L535 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropAndCreateSequence | public function dropAndCreateSequence(Sequence $sequence)
{
$this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform));
$this->createSequence($sequence);
} | php | public function dropAndCreateSequence(Sequence $sequence)
{
$this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform));
$this->createSequence($sequence);
} | [
"public",
"function",
"dropAndCreateSequence",
"(",
"Sequence",
"$",
"sequence",
")",
"{",
"$",
"this",
"->",
"tryMethod",
"(",
"'dropSequence'",
",",
"$",
"sequence",
"->",
"getQuotedName",
"(",
"$",
"this",
"->",
"_platform",
")",
")",
";",
"$",
"this",
... | Drops and create a new sequence.
@return void
@throws ConnectionException If something fails at database level. | [
"Drops",
"and",
"create",
"a",
"new",
"sequence",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L544-L548 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropAndCreateTable | public function dropAndCreateTable(Table $table)
{
$this->tryMethod('dropTable', $table->getQuotedName($this->_platform));
$this->createTable($table);
} | php | public function dropAndCreateTable(Table $table)
{
$this->tryMethod('dropTable', $table->getQuotedName($this->_platform));
$this->createTable($table);
} | [
"public",
"function",
"dropAndCreateTable",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"tryMethod",
"(",
"'dropTable'",
",",
"$",
"table",
"->",
"getQuotedName",
"(",
"$",
"this",
"->",
"_platform",
")",
")",
";",
"$",
"this",
"->",
"create... | Drops and creates a new table.
@return void | [
"Drops",
"and",
"creates",
"a",
"new",
"table",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L555-L559 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.dropAndCreateView | public function dropAndCreateView(View $view)
{
$this->tryMethod('dropView', $view->getQuotedName($this->_platform));
$this->createView($view);
} | php | public function dropAndCreateView(View $view)
{
$this->tryMethod('dropView', $view->getQuotedName($this->_platform));
$this->createView($view);
} | [
"public",
"function",
"dropAndCreateView",
"(",
"View",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"tryMethod",
"(",
"'dropView'",
",",
"$",
"view",
"->",
"getQuotedName",
"(",
"$",
"this",
"->",
"_platform",
")",
")",
";",
"$",
"this",
"->",
"createView"... | Drops and creates a new view.
@return void | [
"Drops",
"and",
"creates",
"a",
"new",
"view",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L579-L583 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.alterTable | public function alterTable(TableDiff $tableDiff)
{
$queries = $this->_platform->getAlterTableSQL($tableDiff);
if (! is_array($queries) || ! count($queries)) {
return;
}
foreach ($queries as $ddlQuery) {
$this->_execSql($ddlQuery);
}
} | php | public function alterTable(TableDiff $tableDiff)
{
$queries = $this->_platform->getAlterTableSQL($tableDiff);
if (! is_array($queries) || ! count($queries)) {
return;
}
foreach ($queries as $ddlQuery) {
$this->_execSql($ddlQuery);
}
} | [
"public",
"function",
"alterTable",
"(",
"TableDiff",
"$",
"tableDiff",
")",
"{",
"$",
"queries",
"=",
"$",
"this",
"->",
"_platform",
"->",
"getAlterTableSQL",
"(",
"$",
"tableDiff",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"queries",
")",
"||",
... | Alters an existing tables schema.
@return void | [
"Alters",
"an",
"existing",
"tables",
"schema",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L592-L602 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.renameTable | public function renameTable($name, $newName)
{
$tableDiff = new TableDiff($name);
$tableDiff->newName = $newName;
$this->alterTable($tableDiff);
} | php | public function renameTable($name, $newName)
{
$tableDiff = new TableDiff($name);
$tableDiff->newName = $newName;
$this->alterTable($tableDiff);
} | [
"public",
"function",
"renameTable",
"(",
"$",
"name",
",",
"$",
"newName",
")",
"{",
"$",
"tableDiff",
"=",
"new",
"TableDiff",
"(",
"$",
"name",
")",
";",
"$",
"tableDiff",
"->",
"newName",
"=",
"$",
"newName",
";",
"$",
"this",
"->",
"alterTable",
... | Renames a given table to another name.
@param string $name The current name of the table.
@param string $newName The new name of the table.
@return void | [
"Renames",
"a",
"given",
"table",
"to",
"another",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L612-L617 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager._getPortableTableColumnList | protected function _getPortableTableColumnList($table, $database, $tableColumns)
{
$eventManager = $this->_platform->getEventManager();
$list = [];
foreach ($tableColumns as $tableColumn) {
$column = null;
$defaultPrevented = false;
if ($eventM... | php | protected function _getPortableTableColumnList($table, $database, $tableColumns)
{
$eventManager = $this->_platform->getEventManager();
$list = [];
foreach ($tableColumns as $tableColumn) {
$column = null;
$defaultPrevented = false;
if ($eventM... | [
"protected",
"function",
"_getPortableTableColumnList",
"(",
"$",
"table",
",",
"$",
"database",
",",
"$",
"tableColumns",
")",
"{",
"$",
"eventManager",
"=",
"$",
"this",
"->",
"_platform",
"->",
"getEventManager",
"(",
")",
";",
"$",
"list",
"=",
"[",
"]... | Independent of the database the keys of the column list result are lowercased.
The name of the created column instance however is kept in its case.
@param string $table The name of the table.
@param string $database
@param mixed[][] $tableColumns
@return Column[] | [
"Independent",
"of",
"the",
"database",
"the",
"keys",
"of",
"the",
"column",
"list",
"result",
"are",
"lowercased",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L786-L816 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager._getPortableTableIndexesList | protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null)
{
$result = [];
foreach ($tableIndexRows as $tableIndex) {
$indexName = $keyName = $tableIndex['key_name'];
if ($tableIndex['primary']) {
$keyName = 'primary';
}
... | php | protected function _getPortableTableIndexesList($tableIndexRows, $tableName = null)
{
$result = [];
foreach ($tableIndexRows as $tableIndex) {
$indexName = $keyName = $tableIndex['key_name'];
if ($tableIndex['primary']) {
$keyName = 'primary';
}
... | [
"protected",
"function",
"_getPortableTableIndexesList",
"(",
"$",
"tableIndexRows",
",",
"$",
"tableName",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"tableIndexRows",
"as",
"$",
"tableIndex",
")",
"{",
"$",
"indexName",
... | Aggregates and groups the index results according to the required data result.
@param mixed[][] $tableIndexRows
@param string|null $tableName
@return Index[] | [
"Aggregates",
"and",
"groups",
"the",
"index",
"results",
"according",
"to",
"the",
"required",
"data",
"result",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L835-L895 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.createSchema | public function createSchema()
{
$namespaces = [];
if ($this->_platform->supportsSchemas()) {
$namespaces = $this->listNamespaceNames();
}
$sequences = [];
if ($this->_platform->supportsSequences()) {
$sequences = $this->listSequences();
}
... | php | public function createSchema()
{
$namespaces = [];
if ($this->_platform->supportsSchemas()) {
$namespaces = $this->listNamespaceNames();
}
$sequences = [];
if ($this->_platform->supportsSequences()) {
$sequences = $this->listSequences();
}
... | [
"public",
"function",
"createSchema",
"(",
")",
"{",
"$",
"namespaces",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"_platform",
"->",
"supportsSchemas",
"(",
")",
")",
"{",
"$",
"namespaces",
"=",
"$",
"this",
"->",
"listNamespaceNames",
"(",
")... | Creates a schema instance for the current database.
@return Schema | [
"Creates",
"a",
"schema",
"instance",
"for",
"the",
"current",
"database",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L1034-L1051 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.createSchemaConfig | public function createSchemaConfig()
{
$schemaConfig = new SchemaConfig();
$schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength());
$searchPaths = $this->getSchemaSearchPaths();
if (isset($searchPaths[0])) {
$schemaConfig->setName($searchPaths[0... | php | public function createSchemaConfig()
{
$schemaConfig = new SchemaConfig();
$schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength());
$searchPaths = $this->getSchemaSearchPaths();
if (isset($searchPaths[0])) {
$schemaConfig->setName($searchPaths[0... | [
"public",
"function",
"createSchemaConfig",
"(",
")",
"{",
"$",
"schemaConfig",
"=",
"new",
"SchemaConfig",
"(",
")",
";",
"$",
"schemaConfig",
"->",
"setMaxIdentifierLength",
"(",
"$",
"this",
"->",
"_platform",
"->",
"getMaxIdentifierLength",
"(",
")",
")",
... | Creates the configuration for this schema.
@return SchemaConfig | [
"Creates",
"the",
"configuration",
"for",
"this",
"schema",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L1058-L1078 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | AbstractSchemaManager.extractDoctrineTypeFromComment | public function extractDoctrineTypeFromComment($comment, $currentType)
{
if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match)) {
return $match[1];
}
return $currentType;
} | php | public function extractDoctrineTypeFromComment($comment, $currentType)
{
if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match)) {
return $match[1];
}
return $currentType;
} | [
"public",
"function",
"extractDoctrineTypeFromComment",
"(",
"$",
"comment",
",",
"$",
"currentType",
")",
"{",
"if",
"(",
"$",
"comment",
"!==",
"null",
"&&",
"preg_match",
"(",
"'(\\(DC2Type:(((?!\\)).)+)\\))'",
",",
"$",
"comment",
",",
"$",
"match",
")",
"... | Given a table comment this method tries to extract a typehint for Doctrine Type, or returns
the type given as default.
@param string|null $comment
@param string $currentType
@return string | [
"Given",
"a",
"table",
"comment",
"this",
"method",
"tries",
"to",
"extract",
"a",
"typehint",
"for",
"Doctrine",
"Type",
"or",
"returns",
"the",
"type",
"given",
"as",
"default",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L1106-L1113 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php | Driver.buildDsn | private function buildDsn($host, $port, $server, $dbname, $username = null, $password = null, array $driverOptions = [])
{
$host = $host ?: 'localhost';
$port = $port ?: 2638;
if (! empty($server)) {
$server = ';ServerName=' . $server;
}
return 'HOST=' . $host .... | php | private function buildDsn($host, $port, $server, $dbname, $username = null, $password = null, array $driverOptions = [])
{
$host = $host ?: 'localhost';
$port = $port ?: 2638;
if (! empty($server)) {
$server = ';ServerName=' . $server;
}
return 'HOST=' . $host .... | [
"private",
"function",
"buildDsn",
"(",
"$",
"host",
",",
"$",
"port",
",",
"$",
"server",
",",
"$",
"dbname",
",",
"$",
"username",
"=",
"null",
",",
"$",
"password",
"=",
"null",
",",
"array",
"$",
"driverOptions",
"=",
"[",
"]",
")",
"{",
"$",
... | Build the connection string for given connection parameters and driver options.
@param string $host Host address to connect to.
@param int $port Port to use for the connection (default to SQL Anywhere standard port 2638).
@param string $server Database server name on the host to connect ... | [
"Build",
"the",
"connection",
"string",
"for",
"given",
"connection",
"parameters",
"and",
"driver",
"options",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php#L64-L84 | train |
doctrine/dbal | lib/Doctrine/DBAL/Types/Type.php | Type.getTypesMap | public static function getTypesMap()
{
return array_map(
static function (Type $type) : string {
return get_class($type);
},
self::getTypeRegistry()->getMap()
);
} | php | public static function getTypesMap()
{
return array_map(
static function (Type $type) : string {
return get_class($type);
},
self::getTypeRegistry()->getMap()
);
} | [
"public",
"static",
"function",
"getTypesMap",
"(",
")",
"{",
"return",
"array_map",
"(",
"static",
"function",
"(",
"Type",
"$",
"type",
")",
":",
"string",
"{",
"return",
"get_class",
"(",
"$",
"type",
")",
";",
"}",
",",
"self",
"::",
"getTypeRegistry... | Gets the types array map which holds all registered types and the corresponding
type class
@return string[] | [
"Gets",
"the",
"types",
"array",
"map",
"which",
"holds",
"all",
"registered",
"types",
"and",
"the",
"corresponding",
"type",
"class"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Types/Type.php#L295-L303 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php | Driver._constructPdoDsn | private function _constructPdoDsn(array $params, array $connectionOptions)
{
$dsn = 'sqlsrv:server=';
if (isset($params['host'])) {
$dsn .= $params['host'];
}
if (isset($params['port']) && ! empty($params['port'])) {
$dsn .= ',' . $params['port'];
}
... | php | private function _constructPdoDsn(array $params, array $connectionOptions)
{
$dsn = 'sqlsrv:server=';
if (isset($params['host'])) {
$dsn .= $params['host'];
}
if (isset($params['port']) && ! empty($params['port'])) {
$dsn .= ',' . $params['port'];
}
... | [
"private",
"function",
"_constructPdoDsn",
"(",
"array",
"$",
"params",
",",
"array",
"$",
"connectionOptions",
")",
"{",
"$",
"dsn",
"=",
"'sqlsrv:server='",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'host'",
"]",
")",
")",
"{",
"$",
"dsn",
"... | Constructs the Sqlsrv PDO DSN.
@param mixed[] $params
@param string[] $connectionOptions
@return string The DSN. | [
"Constructs",
"the",
"Sqlsrv",
"PDO",
"DSN",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php#L45-L66 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php | Driver.getConnectionOptionsDsn | private function getConnectionOptionsDsn(array $connectionOptions) : string
{
$connectionOptionsDsn = '';
foreach ($connectionOptions as $paramName => $paramValue) {
$connectionOptionsDsn .= sprintf(';%s=%s', $paramName, $paramValue);
}
return $connectionOptionsDsn;
... | php | private function getConnectionOptionsDsn(array $connectionOptions) : string
{
$connectionOptionsDsn = '';
foreach ($connectionOptions as $paramName => $paramValue) {
$connectionOptionsDsn .= sprintf(';%s=%s', $paramName, $paramValue);
}
return $connectionOptionsDsn;
... | [
"private",
"function",
"getConnectionOptionsDsn",
"(",
"array",
"$",
"connectionOptions",
")",
":",
"string",
"{",
"$",
"connectionOptionsDsn",
"=",
"''",
";",
"foreach",
"(",
"$",
"connectionOptions",
"as",
"$",
"paramName",
"=>",
"$",
"paramValue",
")",
"{",
... | Converts a connection options array to the DSN
@param string[] $connectionOptions | [
"Converts",
"a",
"connection",
"options",
"array",
"to",
"the",
"DSN"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php#L73-L82 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php | Driver._constructPdoDsn | private function _constructPdoDsn(array $params)
{
$dsn = 'pgsql:';
if (isset($params['host']) && $params['host'] !== '') {
$dsn .= 'host=' . $params['host'] . ';';
}
if (isset($params['port']) && $params['port'] !== '') {
$dsn .= 'port=' . $params['port'] .... | php | private function _constructPdoDsn(array $params)
{
$dsn = 'pgsql:';
if (isset($params['host']) && $params['host'] !== '') {
$dsn .= 'host=' . $params['host'] . ';';
}
if (isset($params['port']) && $params['port'] !== '') {
$dsn .= 'port=' . $params['port'] .... | [
"private",
"function",
"_constructPdoDsn",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"dsn",
"=",
"'pgsql:'",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'host'",
"]",
")",
"&&",
"$",
"params",
"[",
"'host'",
"]",
"!==",
"''",
")",
"{",
"$"... | Constructs the Postgres PDO DSN.
@param mixed[] $params
@return string The DSN. | [
"Constructs",
"the",
"Postgres",
"PDO",
"DSN",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php#L59-L107 | train |
doctrine/dbal | lib/Doctrine/DBAL/Cache/QueryCacheProfile.php | QueryCacheProfile.generateCacheKeys | public function generateCacheKeys($query, $params, $types, array $connectionParams = [])
{
$realCacheKey = 'query=' . $query .
'¶ms=' . serialize($params) .
'&types=' . serialize($types) .
'&connectionParams=' . hash('sha256', serialize($connectionParams));
/... | php | public function generateCacheKeys($query, $params, $types, array $connectionParams = [])
{
$realCacheKey = 'query=' . $query .
'¶ms=' . serialize($params) .
'&types=' . serialize($types) .
'&connectionParams=' . hash('sha256', serialize($connectionParams));
/... | [
"public",
"function",
"generateCacheKeys",
"(",
"$",
"query",
",",
"$",
"params",
",",
"$",
"types",
",",
"array",
"$",
"connectionParams",
"=",
"[",
"]",
")",
"{",
"$",
"realCacheKey",
"=",
"'query='",
".",
"$",
"query",
".",
"'¶ms='",
".",
"seriali... | Generates the real cache key from query, params, types and connection parameters.
@param string $query
@param mixed[] $params
@param int[]|string[] $types
@param mixed[] $connectionParams
@return string[] | [
"Generates",
"the",
"real",
"cache",
"key",
"from",
"query",
"params",
"types",
"and",
"connection",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php#L77-L92 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php | MysqliStatement.bindTypedParameters | private function bindTypedParameters()
{
$streams = $values = [];
$types = $this->types;
foreach ($this->_bindedValues as $parameter => $value) {
if (! isset($types[$parameter - 1])) {
$types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING];
... | php | private function bindTypedParameters()
{
$streams = $values = [];
$types = $this->types;
foreach ($this->_bindedValues as $parameter => $value) {
if (! isset($types[$parameter - 1])) {
$types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING];
... | [
"private",
"function",
"bindTypedParameters",
"(",
")",
"{",
"$",
"streams",
"=",
"$",
"values",
"=",
"[",
"]",
";",
"$",
"types",
"=",
"$",
"this",
"->",
"types",
";",
"foreach",
"(",
"$",
"this",
"->",
"_bindedValues",
"as",
"$",
"parameter",
"=>",
... | Binds parameters with known types previously bound to the statement | [
"Binds",
"parameters",
"with",
"known",
"types",
"previously",
"bound",
"to",
"the",
"statement"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php#L210-L241 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php | MysqliStatement.bindUntypedValues | private function bindUntypedValues(array $values)
{
$params = [];
$types = str_repeat('s', count($values));
foreach ($values as &$v) {
$params[] =& $v;
}
return $this->_stmt->bind_param($types, ...$params);
} | php | private function bindUntypedValues(array $values)
{
$params = [];
$types = str_repeat('s', count($values));
foreach ($values as &$v) {
$params[] =& $v;
}
return $this->_stmt->bind_param($types, ...$params);
} | [
"private",
"function",
"bindUntypedValues",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"$",
"types",
"=",
"str_repeat",
"(",
"'s'",
",",
"count",
"(",
"$",
"values",
")",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
... | Binds a array of values to bound parameters.
@param mixed[] $values
@return bool | [
"Binds",
"a",
"array",
"of",
"values",
"to",
"bound",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php#L272-L282 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php | SQLAnywhereException.fromSQLAnywhereError | public static function fromSQLAnywhereError($conn = null, $stmt = null)
{
$state = $conn ? sasql_sqlstate($conn) : sasql_sqlstate();
$code = null;
$message = null;
/**
* Try retrieving the last error from statement resource if given
*/
if ($stmt) {
... | php | public static function fromSQLAnywhereError($conn = null, $stmt = null)
{
$state = $conn ? sasql_sqlstate($conn) : sasql_sqlstate();
$code = null;
$message = null;
/**
* Try retrieving the last error from statement resource if given
*/
if ($stmt) {
... | [
"public",
"static",
"function",
"fromSQLAnywhereError",
"(",
"$",
"conn",
"=",
"null",
",",
"$",
"stmt",
"=",
"null",
")",
"{",
"$",
"state",
"=",
"$",
"conn",
"?",
"sasql_sqlstate",
"(",
"$",
"conn",
")",
":",
"sasql_sqlstate",
"(",
")",
";",
"$",
"... | Helper method to turn SQL Anywhere error into exception.
@param resource|null $conn The SQL Anywhere connection resource to retrieve the last error from.
@param resource|null $stmt The SQL Anywhere statement resource to retrieve the last error from.
@return SQLAnywhereException
@throws InvalidArgumentException | [
"Helper",
"method",
"to",
"turn",
"SQL",
"Anywhere",
"error",
"into",
"exception",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php#L28-L70 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractAsset.php | AbstractAsset._setName | protected function _setName($name)
{
if ($this->isIdentifierQuoted($name)) {
$this->_quoted = true;
$name = $this->trimQuotes($name);
}
if (strpos($name, '.') !== false) {
$parts = explode('.', $name);
$this->_namespace = $p... | php | protected function _setName($name)
{
if ($this->isIdentifierQuoted($name)) {
$this->_quoted = true;
$name = $this->trimQuotes($name);
}
if (strpos($name, '.') !== false) {
$parts = explode('.', $name);
$this->_namespace = $p... | [
"protected",
"function",
"_setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isIdentifierQuoted",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"_quoted",
"=",
"true",
";",
"$",
"name",
"=",
"$",
"this",
"->",
"trimQuotes",
... | Sets the name of this asset.
@param string $name
@return void | [
"Sets",
"the",
"name",
"of",
"this",
"asset",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractAsset.php#L45-L57 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractAsset.php | AbstractAsset.getQuotedName | public function getQuotedName(AbstractPlatform $platform)
{
$keywords = $platform->getReservedKeywordsList();
$parts = explode('.', $this->getName());
foreach ($parts as $k => $v) {
$parts[$k] = $this->_quoted || $keywords->isKeyword($v) ? $platform->quoteIdentifier($v) : $v;
... | php | public function getQuotedName(AbstractPlatform $platform)
{
$keywords = $platform->getReservedKeywordsList();
$parts = explode('.', $this->getName());
foreach ($parts as $k => $v) {
$parts[$k] = $this->_quoted || $keywords->isKeyword($v) ? $platform->quoteIdentifier($v) : $v;
... | [
"public",
"function",
"getQuotedName",
"(",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"$",
"keywords",
"=",
"$",
"platform",
"->",
"getReservedKeywordsList",
"(",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"getName",
"... | Gets the quoted representation of this asset but only if it was defined with one. Otherwise
return the plain unquoted value as inserted.
@return string | [
"Gets",
"the",
"quoted",
"representation",
"of",
"this",
"asset",
"but",
"only",
"if",
"it",
"was",
"defined",
"with",
"one",
".",
"Otherwise",
"return",
"the",
"plain",
"unquoted",
"value",
"as",
"inserted",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractAsset.php#L178-L187 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/AbstractAsset.php | AbstractAsset._generateIdentifierName | protected function _generateIdentifierName($columnNames, $prefix = '', $maxSize = 30)
{
$hash = implode('', array_map(static function ($column) {
return dechex(crc32($column));
}, $columnNames));
return strtoupper(substr($prefix . '_' . $hash, 0, $maxSize));
} | php | protected function _generateIdentifierName($columnNames, $prefix = '', $maxSize = 30)
{
$hash = implode('', array_map(static function ($column) {
return dechex(crc32($column));
}, $columnNames));
return strtoupper(substr($prefix . '_' . $hash, 0, $maxSize));
} | [
"protected",
"function",
"_generateIdentifierName",
"(",
"$",
"columnNames",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"maxSize",
"=",
"30",
")",
"{",
"$",
"hash",
"=",
"implode",
"(",
"''",
",",
"array_map",
"(",
"static",
"function",
"(",
"$",
"column",... | Generates an identifier from a list of column names obeying a certain string length.
This is especially important for Oracle, since it does not allow identifiers larger than 30 chars,
however building idents automatically for foreign keys, composite keys or such can easily create
very long names.
@param string[] $col... | [
"Generates",
"an",
"identifier",
"from",
"a",
"list",
"of",
"column",
"names",
"obeying",
"a",
"certain",
"string",
"length",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/AbstractAsset.php#L202-L209 | train |
doctrine/dbal | lib/Doctrine/DBAL/Id/TableGenerator.php | TableGenerator.nextValue | public function nextValue($sequenceName)
{
if (isset($this->sequences[$sequenceName])) {
$value = $this->sequences[$sequenceName]['value'];
$this->sequences[$sequenceName]['value']++;
if ($this->sequences[$sequenceName]['value'] >= $this->sequences[$sequenceName]['max']) ... | php | public function nextValue($sequenceName)
{
if (isset($this->sequences[$sequenceName])) {
$value = $this->sequences[$sequenceName]['value'];
$this->sequences[$sequenceName]['value']++;
if ($this->sequences[$sequenceName]['value'] >= $this->sequences[$sequenceName]['max']) ... | [
"public",
"function",
"nextValue",
"(",
"$",
"sequenceName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"sequences",
"[",
"$",
"sequenceName",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"sequences",
"[",
"$",
"sequenceName",
... | Generates the next unused value for the given sequence name.
@param string $sequenceName
@return int
@throws DBALException | [
"Generates",
"the",
"next",
"unused",
"value",
"for",
"the",
"given",
"sequence",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Id/TableGenerator.php#L86-L144 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getCreateColumnCommentSQL | protected function getCreateColumnCommentSQL($tableName, $columnName, $comment)
{
if (strpos($tableName, '.') !== false) {
[$schemaSQL, $tableSQL] = explode('.', $tableName);
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
$tableSQL = $this-... | php | protected function getCreateColumnCommentSQL($tableName, $columnName, $comment)
{
if (strpos($tableName, '.') !== false) {
[$schemaSQL, $tableSQL] = explode('.', $tableName);
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
$tableSQL = $this-... | [
"protected",
"function",
"getCreateColumnCommentSQL",
"(",
"$",
"tableName",
",",
"$",
"columnName",
",",
"$",
"comment",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"tableName",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"[",
"$",
"schemaSQL",
",",
"$",
... | Returns the SQL statement for creating a column comment.
SQL Server does not support native column comments,
therefore the extended properties functionality is used
as a workaround to store them.
The property name used to store column comments is "MS_Description"
which provides compatibility with SQL Server Management... | [
"Returns",
"the",
"SQL",
"statement",
"for",
"creating",
"a",
"column",
"comment",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L349-L370 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getDefaultConstraintDeclarationSQL | public function getDefaultConstraintDeclarationSQL($table, array $column)
{
if (! isset($column['default'])) {
throw new InvalidArgumentException("Incomplete column definition. 'default' required.");
}
$columnName = new Identifier($column['name']);
return ' CONSTRAINT '... | php | public function getDefaultConstraintDeclarationSQL($table, array $column)
{
if (! isset($column['default'])) {
throw new InvalidArgumentException("Incomplete column definition. 'default' required.");
}
$columnName = new Identifier($column['name']);
return ' CONSTRAINT '... | [
"public",
"function",
"getDefaultConstraintDeclarationSQL",
"(",
"$",
"table",
",",
"array",
"$",
"column",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"column",
"[",
"'default'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Incom... | Returns the SQL snippet for declaring a default constraint.
@param string $table Name of the table to return the default constraint declaration for.
@param mixed[] $column Column definition.
@return string
@throws InvalidArgumentException | [
"Returns",
"the",
"SQL",
"snippet",
"for",
"declaring",
"a",
"default",
"constraint",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L382-L394 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform._appendUniqueConstraintDefinition | private function _appendUniqueConstraintDefinition($sql, Index $index)
{
$fields = [];
foreach ($index->getQuotedColumns($this) as $field) {
$fields[] = $field . ' IS NOT NULL';
}
return $sql . ' WHERE ' . implode(' AND ', $fields);
} | php | private function _appendUniqueConstraintDefinition($sql, Index $index)
{
$fields = [];
foreach ($index->getQuotedColumns($this) as $field) {
$fields[] = $field . ' IS NOT NULL';
}
return $sql . ' WHERE ' . implode(' AND ', $fields);
} | [
"private",
"function",
"_appendUniqueConstraintDefinition",
"(",
"$",
"sql",
",",
"Index",
"$",
"index",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"index",
"->",
"getQuotedColumns",
"(",
"$",
"this",
")",
"as",
"$",
"field",
")",
... | Extend unique key constraint with required filters
@param string $sql
@return string | [
"Extend",
"unique",
"key",
"constraint",
"with",
"required",
"filters"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L448-L457 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getAlterTableAddDefaultConstraintClause | private function getAlterTableAddDefaultConstraintClause($tableName, Column $column)
{
$columnDef = $column->toArray();
$columnDef['name'] = $column->getQuotedName($this);
return 'ADD' . $this->getDefaultConstraintDeclarationSQL($tableName, $columnDef);
} | php | private function getAlterTableAddDefaultConstraintClause($tableName, Column $column)
{
$columnDef = $column->toArray();
$columnDef['name'] = $column->getQuotedName($this);
return 'ADD' . $this->getDefaultConstraintDeclarationSQL($tableName, $columnDef);
} | [
"private",
"function",
"getAlterTableAddDefaultConstraintClause",
"(",
"$",
"tableName",
",",
"Column",
"$",
"column",
")",
"{",
"$",
"columnDef",
"=",
"$",
"column",
"->",
"toArray",
"(",
")",
";",
"$",
"columnDef",
"[",
"'name'",
"]",
"=",
"$",
"column",
... | Returns the SQL clause for adding a default constraint in an ALTER TABLE statement.
@param string $tableName The name of the table to generate the clause for.
@param Column $column The column to generate the clause for.
@return string | [
"Returns",
"the",
"SQL",
"clause",
"for",
"adding",
"a",
"default",
"constraint",
"in",
"an",
"ALTER",
"TABLE",
"statement",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L633-L639 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.alterColumnRequiresDropDefaultConstraint | private function alterColumnRequiresDropDefaultConstraint(ColumnDiff $columnDiff)
{
// We can only decide whether to drop an existing default constraint
// if we know the original default value.
if (! $columnDiff->fromColumn instanceof Column) {
return false;
}
/... | php | private function alterColumnRequiresDropDefaultConstraint(ColumnDiff $columnDiff)
{
// We can only decide whether to drop an existing default constraint
// if we know the original default value.
if (! $columnDiff->fromColumn instanceof Column) {
return false;
}
/... | [
"private",
"function",
"alterColumnRequiresDropDefaultConstraint",
"(",
"ColumnDiff",
"$",
"columnDiff",
")",
"{",
"// We can only decide whether to drop an existing default constraint",
"// if we know the original default value.",
"if",
"(",
"!",
"$",
"columnDiff",
"->",
"fromColu... | Checks whether a column alteration requires dropping its default constraint first.
Different to other database vendors SQL Server implements column default values
as constraints and therefore changes in a column's default value as well as changes
in a column's type require dropping the default constraint first before ... | [
"Checks",
"whether",
"a",
"column",
"alteration",
"requires",
"dropping",
"its",
"default",
"constraint",
"first",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L666-L689 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getAlterColumnCommentSQL | protected function getAlterColumnCommentSQL($tableName, $columnName, $comment)
{
if (strpos($tableName, '.') !== false) {
[$schemaSQL, $tableSQL] = explode('.', $tableName);
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
$tableSQL = $this->... | php | protected function getAlterColumnCommentSQL($tableName, $columnName, $comment)
{
if (strpos($tableName, '.') !== false) {
[$schemaSQL, $tableSQL] = explode('.', $tableName);
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
$tableSQL = $this->... | [
"protected",
"function",
"getAlterColumnCommentSQL",
"(",
"$",
"tableName",
",",
"$",
"columnName",
",",
"$",
"comment",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"tableName",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"[",
"$",
"schemaSQL",
",",
"$",
"... | Returns the SQL statement for altering a column comment.
SQL Server does not support native column comments,
therefore the extended properties functionality is used
as a workaround to store them.
The property name used to store column comments is "MS_Description"
which provides compatibility with SQL Server Management... | [
"Returns",
"the",
"SQL",
"statement",
"for",
"altering",
"a",
"column",
"comment",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L708-L729 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getDropColumnCommentSQL | protected function getDropColumnCommentSQL($tableName, $columnName)
{
if (strpos($tableName, '.') !== false) {
[$schemaSQL, $tableSQL] = explode('.', $tableName);
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
$tableSQL = $this->quoteString... | php | protected function getDropColumnCommentSQL($tableName, $columnName)
{
if (strpos($tableName, '.') !== false) {
[$schemaSQL, $tableSQL] = explode('.', $tableName);
$schemaSQL = $this->quoteStringLiteral($schemaSQL);
$tableSQL = $this->quoteString... | [
"protected",
"function",
"getDropColumnCommentSQL",
"(",
"$",
"tableName",
",",
"$",
"columnName",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"tableName",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"[",
"$",
"schemaSQL",
",",
"$",
"tableSQL",
"]",
"=",
"... | Returns the SQL statement for dropping a column comment.
SQL Server does not support native column comments,
therefore the extended properties functionality is used
as a workaround to store them.
The property name used to store column comments is "MS_Description"
which provides compatibility with SQL Server Management... | [
"Returns",
"the",
"SQL",
"statement",
"for",
"dropping",
"a",
"column",
"comment",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L747-L767 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getAddExtendedPropertySQL | public function getAddExtendedPropertySQL(
$name,
$value = null,
$level0Type = null,
$level0Name = null,
$level1Type = null,
$level1Name = null,
$level2Type = null,
$level2Name = null
) {
return 'EXEC sp_addextendedproperty ' .
'N' ... | php | public function getAddExtendedPropertySQL(
$name,
$value = null,
$level0Type = null,
$level0Name = null,
$level1Type = null,
$level1Name = null,
$level2Type = null,
$level2Name = null
) {
return 'EXEC sp_addextendedproperty ' .
'N' ... | [
"public",
"function",
"getAddExtendedPropertySQL",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
",",
"$",
"level0Type",
"=",
"null",
",",
"$",
"level0Name",
"=",
"null",
",",
"$",
"level1Type",
"=",
"null",
",",
"$",
"level1Name",
"=",
"null",
",",
... | Returns the SQL statement for adding an extended property to a database object.
@link http://msdn.microsoft.com/en-us/library/ms180047%28v=sql.90%29.aspx
@param string $name The name of the property to add.
@param string|null $value The value of the property to add.
@param string|null $level0Type The ... | [
"Returns",
"the",
"SQL",
"statement",
"for",
"adding",
"an",
"extended",
"property",
"to",
"a",
"database",
"object",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L799-L814 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getDropExtendedPropertySQL | public function getDropExtendedPropertySQL(
$name,
$level0Type = null,
$level0Name = null,
$level1Type = null,
$level1Name = null,
$level2Type = null,
$level2Name = null
) {
return 'EXEC sp_dropextendedproperty ' .
'N' . $this->quoteStringL... | php | public function getDropExtendedPropertySQL(
$name,
$level0Type = null,
$level0Name = null,
$level1Type = null,
$level1Name = null,
$level2Type = null,
$level2Name = null
) {
return 'EXEC sp_dropextendedproperty ' .
'N' . $this->quoteStringL... | [
"public",
"function",
"getDropExtendedPropertySQL",
"(",
"$",
"name",
",",
"$",
"level0Type",
"=",
"null",
",",
"$",
"level0Name",
"=",
"null",
",",
"$",
"level1Type",
"=",
"null",
",",
"$",
"level1Name",
"=",
"null",
",",
"$",
"level2Type",
"=",
"null",
... | Returns the SQL statement for dropping an extended property from a database object.
@link http://technet.microsoft.com/en-gb/library/ms178595%28v=sql.90%29.aspx
@param string $name The name of the property to drop.
@param string|null $level0Type The type of the object at level 0 the property belongs to.
@p... | [
"Returns",
"the",
"SQL",
"statement",
"for",
"dropping",
"an",
"extended",
"property",
"from",
"a",
"database",
"object",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L831-L845 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.getTableWhereClause | private function getTableWhereClause($table, $schemaColumn, $tableColumn)
{
if (strpos($table, '.') !== false) {
[$schema, $table] = explode('.', $table);
$schema = $this->quoteStringLiteral($schema);
$table = $this->quoteStringLiteral($table);
... | php | private function getTableWhereClause($table, $schemaColumn, $tableColumn)
{
if (strpos($table, '.') !== false) {
[$schema, $table] = explode('.', $table);
$schema = $this->quoteStringLiteral($schema);
$table = $this->quoteStringLiteral($table);
... | [
"private",
"function",
"getTableWhereClause",
"(",
"$",
"table",
",",
"$",
"schemaColumn",
",",
"$",
"tableColumn",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"table",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"[",
"$",
"schema",
",",
"$",
"table",
"]... | Returns the where clause to filter schema and table name in a query.
@param string $table The full qualified name of the table.
@param string $schemaColumn The name of the column to compare the schema to in the where clause.
@param string $tableColumn The name of the column to compare the table to in the where... | [
"Returns",
"the",
"where",
"clause",
"to",
"filter",
"schema",
"and",
"table",
"name",
"in",
"a",
"query",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L1001-L1013 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.isOrderByInTopNSubquery | private function isOrderByInTopNSubquery($query, $currentPosition)
{
// Grab query text on the same nesting level as the ORDER BY clause we're examining.
$subQueryBuffer = '';
$parenCount = 0;
// If $parenCount goes negative, we've exited the subquery we're examining.
//... | php | private function isOrderByInTopNSubquery($query, $currentPosition)
{
// Grab query text on the same nesting level as the ORDER BY clause we're examining.
$subQueryBuffer = '';
$parenCount = 0;
// If $parenCount goes negative, we've exited the subquery we're examining.
//... | [
"private",
"function",
"isOrderByInTopNSubquery",
"(",
"$",
"query",
",",
"$",
"currentPosition",
")",
"{",
"// Grab query text on the same nesting level as the ORDER BY clause we're examining.",
"$",
"subQueryBuffer",
"=",
"''",
";",
"$",
"parenCount",
"=",
"0",
";",
"//... | Check an ORDER BY clause to see if it is in a TOP N query or subquery.
@param string $query The query
@param int $currentPosition Start position of ORDER BY clause
@return bool true if ORDER BY is in a TOP N query, false otherwise | [
"Check",
"an",
"ORDER",
"BY",
"clause",
"to",
"see",
"if",
"it",
"is",
"in",
"a",
"TOP",
"N",
"query",
"or",
"subquery",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L1364-L1386 | train |
doctrine/dbal | lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | SQLServerPlatform.generateIdentifierName | private function generateIdentifierName($identifier)
{
// Always generate name for unquoted identifiers to ensure consistency.
$identifier = new Identifier($identifier);
return strtoupper(dechex(crc32($identifier->getName())));
} | php | private function generateIdentifierName($identifier)
{
// Always generate name for unquoted identifiers to ensure consistency.
$identifier = new Identifier($identifier);
return strtoupper(dechex(crc32($identifier->getName())));
} | [
"private",
"function",
"generateIdentifierName",
"(",
"$",
"identifier",
")",
"{",
"// Always generate name for unquoted identifiers to ensure consistency.",
"$",
"identifier",
"=",
"new",
"Identifier",
"(",
"$",
"identifier",
")",
";",
"return",
"strtoupper",
"(",
"deche... | Returns a hash value for a given identifier.
@param string $identifier Identifier to generate a hash value for.
@return string | [
"Returns",
"a",
"hash",
"value",
"for",
"a",
"given",
"identifier",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L1683-L1689 | train |
doctrine/dbal | lib/Doctrine/DBAL/Types/TypeRegistry.php | TypeRegistry.get | public function get(string $name) : Type
{
if (! isset($this->instances[$name])) {
throw DBALException::unknownColumnType($name);
}
return $this->instances[$name];
} | php | public function get(string $name) : Type
{
if (! isset($this->instances[$name])) {
throw DBALException::unknownColumnType($name);
}
return $this->instances[$name];
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
")",
":",
"Type",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"DBALException",
"::",
"unknownColumnType",
"(",
"$",
"name",... | Finds a type by the given name.
@throws DBALException | [
"Finds",
"a",
"type",
"by",
"the",
"given",
"name",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Types/TypeRegistry.php#L27-L34 | train |
doctrine/dbal | lib/Doctrine/DBAL/Types/TypeRegistry.php | TypeRegistry.lookupName | public function lookupName(Type $type) : string
{
$name = $this->findTypeName($type);
if ($name === null) {
throw DBALException::typeNotRegistered($type);
}
return $name;
} | php | public function lookupName(Type $type) : string
{
$name = $this->findTypeName($type);
if ($name === null) {
throw DBALException::typeNotRegistered($type);
}
return $name;
} | [
"public",
"function",
"lookupName",
"(",
"Type",
"$",
"type",
")",
":",
"string",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"findTypeName",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"name",
"===",
"null",
")",
"{",
"throw",
"DBALException",
"::",
... | Finds a name for the given type.
@throws DBALException | [
"Finds",
"a",
"name",
"for",
"the",
"given",
"type",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Types/TypeRegistry.php#L41-L50 | train |
doctrine/dbal | lib/Doctrine/DBAL/Types/TypeRegistry.php | TypeRegistry.register | public function register(string $name, Type $type) : void
{
if (isset($this->instances[$name])) {
throw DBALException::typeExists($name);
}
if ($this->findTypeName($type) !== null) {
throw DBALException::typeAlreadyRegistered($type);
}
$this->instanc... | php | public function register(string $name, Type $type) : void
{
if (isset($this->instances[$name])) {
throw DBALException::typeExists($name);
}
if ($this->findTypeName($type) !== null) {
throw DBALException::typeAlreadyRegistered($type);
}
$this->instanc... | [
"public",
"function",
"register",
"(",
"string",
"$",
"name",
",",
"Type",
"$",
"type",
")",
":",
"void",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"DBALException",
"::",
"typeExists"... | Registers a custom type to the type map.
@throws DBALException | [
"Registers",
"a",
"custom",
"type",
"to",
"the",
"type",
"map",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Types/TypeRegistry.php#L65-L76 | train |
doctrine/dbal | lib/Doctrine/DBAL/Driver/AbstractOracleDriver/EasyConnectString.php | EasyConnectString.fromConnectionParameters | public static function fromConnectionParameters(array $params) : self
{
if (! empty($params['connectstring'])) {
return new self($params['connectstring']);
}
if (empty($params['host'])) {
return new self($params['dbname'] ?? '');
}
$connectData = [];... | php | public static function fromConnectionParameters(array $params) : self
{
if (! empty($params['connectstring'])) {
return new self($params['connectstring']);
}
if (empty($params['host'])) {
return new self($params['dbname'] ?? '');
}
$connectData = [];... | [
"public",
"static",
"function",
"fromConnectionParameters",
"(",
"array",
"$",
"params",
")",
":",
"self",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
"[",
"'connectstring'",
"]",
")",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"params",
"[",
"... | Creates the object from the given DBAL connection parameters.
@param mixed[] $params | [
"Creates",
"the",
"object",
"from",
"the",
"given",
"DBAL",
"connection",
"parameters",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/AbstractOracleDriver/EasyConnectString.php#L46-L88 | train |
doctrine/dbal | lib/Doctrine/DBAL/DBALException.php | DBALException.formatParameters | private static function formatParameters(array $params)
{
return '[' . implode(', ', array_map(static function ($param) {
if (is_resource($param)) {
return (string) $param;
}
$json = @json_encode($param);
if (! is_string($json) || $json === '... | php | private static function formatParameters(array $params)
{
return '[' . implode(', ', array_map(static function ($param) {
if (is_resource($param)) {
return (string) $param;
}
$json = @json_encode($param);
if (! is_string($json) || $json === '... | [
"private",
"static",
"function",
"formatParameters",
"(",
"array",
"$",
"params",
")",
"{",
"return",
"'['",
".",
"implode",
"(",
"', '",
",",
"array_map",
"(",
"static",
"function",
"(",
"$",
"param",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"param... | Returns a human-readable representation of an array of parameters.
This properly handles binary data by returning a hex representation.
@param mixed[] $params
@return string | [
"Returns",
"a",
"human",
"-",
"readable",
"representation",
"of",
"an",
"array",
"of",
"parameters",
".",
"This",
"properly",
"handles",
"binary",
"data",
"by",
"returning",
"a",
"hex",
"representation",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/DBALException.php#L180-L196 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php | PostgreSqlSchemaManager.getSchemaSearchPaths | public function getSchemaSearchPaths()
{
$params = $this->_conn->getParams();
$schema = explode(',', $this->_conn->fetchColumn('SHOW search_path'));
if (isset($params['user'])) {
$schema = str_replace('"$user"', $params['user'], $schema);
}
return array_map('tri... | php | public function getSchemaSearchPaths()
{
$params = $this->_conn->getParams();
$schema = explode(',', $this->_conn->fetchColumn('SHOW search_path'));
if (isset($params['user'])) {
$schema = str_replace('"$user"', $params['user'], $schema);
}
return array_map('tri... | [
"public",
"function",
"getSchemaSearchPaths",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"_conn",
"->",
"getParams",
"(",
")",
";",
"$",
"schema",
"=",
"explode",
"(",
"','",
",",
"$",
"this",
"->",
"_conn",
"->",
"fetchColumn",
"(",
"'SHOW ... | Returns an array of schema search paths.
This is a PostgreSQL only function.
@return string[] | [
"Returns",
"an",
"array",
"of",
"schema",
"search",
"paths",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php#L56-L66 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php | PostgreSqlSchemaManager.determineExistingSchemaSearchPaths | public function determineExistingSchemaSearchPaths()
{
$names = $this->getSchemaNames();
$paths = $this->getSchemaSearchPaths();
$this->existingSchemaPaths = array_filter($paths, static function ($v) use ($names) {
return in_array($v, $names);
});
} | php | public function determineExistingSchemaSearchPaths()
{
$names = $this->getSchemaNames();
$paths = $this->getSchemaSearchPaths();
$this->existingSchemaPaths = array_filter($paths, static function ($v) use ($names) {
return in_array($v, $names);
});
} | [
"public",
"function",
"determineExistingSchemaSearchPaths",
"(",
")",
"{",
"$",
"names",
"=",
"$",
"this",
"->",
"getSchemaNames",
"(",
")",
";",
"$",
"paths",
"=",
"$",
"this",
"->",
"getSchemaSearchPaths",
"(",
")",
";",
"$",
"this",
"->",
"existingSchemaP... | Sets or resets the order of the existing schemas in the current search path of the user.
This is a PostgreSQL only function.
@return void | [
"Sets",
"or",
"resets",
"the",
"order",
"of",
"the",
"existing",
"schemas",
"in",
"the",
"current",
"search",
"path",
"of",
"the",
"user",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php#L91-L99 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.hasNamespace | public function hasNamespace($namespaceName)
{
$namespaceName = strtolower($this->getUnquotedAssetName($namespaceName));
return isset($this->namespaces[$namespaceName]);
} | php | public function hasNamespace($namespaceName)
{
$namespaceName = strtolower($this->getUnquotedAssetName($namespaceName));
return isset($this->namespaces[$namespaceName]);
} | [
"public",
"function",
"hasNamespace",
"(",
"$",
"namespaceName",
")",
"{",
"$",
"namespaceName",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"getUnquotedAssetName",
"(",
"$",
"namespaceName",
")",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"namespac... | Does this schema have a namespace with the given name?
@param string $namespaceName
@return bool | [
"Does",
"this",
"schema",
"have",
"a",
"namespace",
"with",
"the",
"given",
"name?"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L217-L222 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.hasTable | public function hasTable($tableName)
{
$tableName = $this->getFullQualifiedAssetName($tableName);
return isset($this->_tables[$tableName]);
} | php | public function hasTable($tableName)
{
$tableName = $this->getFullQualifiedAssetName($tableName);
return isset($this->_tables[$tableName]);
} | [
"public",
"function",
"hasTable",
"(",
"$",
"tableName",
")",
"{",
"$",
"tableName",
"=",
"$",
"this",
"->",
"getFullQualifiedAssetName",
"(",
"$",
"tableName",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"_tables",
"[",
"$",
"tableName",
"]",
"... | Does this schema have a table with the given name?
@param string $tableName
@return bool | [
"Does",
"this",
"schema",
"have",
"a",
"table",
"with",
"the",
"given",
"name?"
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L231-L236 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.createNamespace | public function createNamespace($namespaceName)
{
$unquotedNamespaceName = strtolower($this->getUnquotedAssetName($namespaceName));
if (isset($this->namespaces[$unquotedNamespaceName])) {
throw SchemaException::namespaceAlreadyExists($unquotedNamespaceName);
}
$this->na... | php | public function createNamespace($namespaceName)
{
$unquotedNamespaceName = strtolower($this->getUnquotedAssetName($namespaceName));
if (isset($this->namespaces[$unquotedNamespaceName])) {
throw SchemaException::namespaceAlreadyExists($unquotedNamespaceName);
}
$this->na... | [
"public",
"function",
"createNamespace",
"(",
"$",
"namespaceName",
")",
"{",
"$",
"unquotedNamespaceName",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"getUnquotedAssetName",
"(",
"$",
"namespaceName",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->... | Creates a new namespace.
@param string $namespaceName The name of the namespace to create.
@return \Doctrine\DBAL\Schema\Schema This schema instance.
@throws SchemaException | [
"Creates",
"a",
"new",
"namespace",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L294-L305 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.dropTable | public function dropTable($tableName)
{
$tableName = $this->getFullQualifiedAssetName($tableName);
$this->getTable($tableName);
unset($this->_tables[$tableName]);
return $this;
} | php | public function dropTable($tableName)
{
$tableName = $this->getFullQualifiedAssetName($tableName);
$this->getTable($tableName);
unset($this->_tables[$tableName]);
return $this;
} | [
"public",
"function",
"dropTable",
"(",
"$",
"tableName",
")",
"{",
"$",
"tableName",
"=",
"$",
"this",
"->",
"getFullQualifiedAssetName",
"(",
"$",
"tableName",
")",
";",
"$",
"this",
"->",
"getTable",
"(",
"$",
"tableName",
")",
";",
"unset",
"(",
"$",... | Drops a table from the schema.
@param string $tableName
@return \Doctrine\DBAL\Schema\Schema | [
"Drops",
"a",
"table",
"from",
"the",
"schema",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L352-L359 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.createSequence | public function createSequence($sequenceName, $allocationSize = 1, $initialValue = 1)
{
$seq = new Sequence($sequenceName, $allocationSize, $initialValue);
$this->_addSequence($seq);
return $seq;
} | php | public function createSequence($sequenceName, $allocationSize = 1, $initialValue = 1)
{
$seq = new Sequence($sequenceName, $allocationSize, $initialValue);
$this->_addSequence($seq);
return $seq;
} | [
"public",
"function",
"createSequence",
"(",
"$",
"sequenceName",
",",
"$",
"allocationSize",
"=",
"1",
",",
"$",
"initialValue",
"=",
"1",
")",
"{",
"$",
"seq",
"=",
"new",
"Sequence",
"(",
"$",
"sequenceName",
",",
"$",
"allocationSize",
",",
"$",
"ini... | Creates a new sequence.
@param string $sequenceName
@param int $allocationSize
@param int $initialValue
@return Sequence | [
"Creates",
"a",
"new",
"sequence",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L370-L376 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.toSql | public function toSql(AbstractPlatform $platform)
{
$sqlCollector = new CreateSchemaSqlCollector($platform);
$this->visit($sqlCollector);
return $sqlCollector->getQueries();
} | php | public function toSql(AbstractPlatform $platform)
{
$sqlCollector = new CreateSchemaSqlCollector($platform);
$this->visit($sqlCollector);
return $sqlCollector->getQueries();
} | [
"public",
"function",
"toSql",
"(",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"$",
"sqlCollector",
"=",
"new",
"CreateSchemaSqlCollector",
"(",
"$",
"platform",
")",
";",
"$",
"this",
"->",
"visit",
"(",
"$",
"sqlCollector",
")",
";",
"return",
"$",
"... | Returns an array of necessary SQL queries to create the schema on the given platform.
@return string[] | [
"Returns",
"an",
"array",
"of",
"necessary",
"SQL",
"queries",
"to",
"create",
"the",
"schema",
"on",
"the",
"given",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L396-L402 | train |
doctrine/dbal | lib/Doctrine/DBAL/Schema/Schema.php | Schema.toDropSql | public function toDropSql(AbstractPlatform $platform)
{
$dropSqlCollector = new DropSchemaSqlCollector($platform);
$this->visit($dropSqlCollector);
return $dropSqlCollector->getQueries();
} | php | public function toDropSql(AbstractPlatform $platform)
{
$dropSqlCollector = new DropSchemaSqlCollector($platform);
$this->visit($dropSqlCollector);
return $dropSqlCollector->getQueries();
} | [
"public",
"function",
"toDropSql",
"(",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"$",
"dropSqlCollector",
"=",
"new",
"DropSchemaSqlCollector",
"(",
"$",
"platform",
")",
";",
"$",
"this",
"->",
"visit",
"(",
"$",
"dropSqlCollector",
")",
";",
"return",
... | Return an array of necessary SQL queries to drop the schema on the given platform.
@return string[] | [
"Return",
"an",
"array",
"of",
"necessary",
"SQL",
"queries",
"to",
"drop",
"the",
"schema",
"on",
"the",
"given",
"platform",
"."
] | e4978c2299d4d8e4f39da94f4d567e698e9bdbeb | https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/Schema.php#L409-L415 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.createStripHostsPatterns | private function createStripHostsPatterns($stripHostsConfig)
{
if (!is_array($stripHostsConfig)) {
return $stripHostsConfig;
}
$patterns = [];
foreach ($stripHostsConfig as $entry) {
if (!strlen($entry)) {
continue;
}
... | php | private function createStripHostsPatterns($stripHostsConfig)
{
if (!is_array($stripHostsConfig)) {
return $stripHostsConfig;
}
$patterns = [];
foreach ($stripHostsConfig as $entry) {
if (!strlen($entry)) {
continue;
}
... | [
"private",
"function",
"createStripHostsPatterns",
"(",
"$",
"stripHostsConfig",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"stripHostsConfig",
")",
")",
"{",
"return",
"$",
"stripHostsConfig",
";",
"}",
"$",
"patterns",
"=",
"[",
"]",
";",
"foreach",
... | Create patterns from strip-hosts
@param array|false $stripHostsConfig
@return array|false | [
"Create",
"patterns",
"from",
"strip",
"-",
"hosts"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L286-L342 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.applyStripHosts | private function applyStripHosts()
{
if (false === $this->stripHosts) {
return;
}
foreach ($this->selected as $uniqueName => $package) {
$sources = [];
if ($package->getSourceType()) {
$sources[] = 'source';
}
if ... | php | private function applyStripHosts()
{
if (false === $this->stripHosts) {
return;
}
foreach ($this->selected as $uniqueName => $package) {
$sources = [];
if ($package->getSourceType()) {
$sources[] = 'source';
}
if ... | [
"private",
"function",
"applyStripHosts",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"stripHosts",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"selected",
"as",
"$",
"uniqueName",
"=>",
"$",
"package",
")",
"{",
... | Apply the patterns from strip-hosts | [
"Apply",
"the",
"patterns",
"from",
"strip",
"-",
"hosts"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L347-L391 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.matchStripHostsPatterns | private function matchStripHostsPatterns($url)
{
if (Filesystem::isLocalPath($url)) {
return true;
}
if (is_array($this->stripHosts)) {
$url = trim(parse_url($url, PHP_URL_HOST), '[]');
if (false !== filter_var($url, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)... | php | private function matchStripHostsPatterns($url)
{
if (Filesystem::isLocalPath($url)) {
return true;
}
if (is_array($this->stripHosts)) {
$url = trim(parse_url($url, PHP_URL_HOST), '[]');
if (false !== filter_var($url, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)... | [
"private",
"function",
"matchStripHostsPatterns",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"Filesystem",
"::",
"isLocalPath",
"(",
"$",
"url",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"stripHosts",
")",
")"... | Match an URL against the patterns from strip-hosts
@return bool | [
"Match",
"an",
"URL",
"against",
"the",
"patterns",
"from",
"strip",
"-",
"hosts"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L398-L446 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.matchAddr | private function matchAddr($addr1, $addr2, $len = 0, $chunklen = 32)
{
for (; $len > 0; $len -= $chunklen, next($addr1), next($addr2)) {
$shift = $len >= $chunklen ? 0 : $chunklen - $len;
if ((current($addr1) >> $shift) !== (current($addr2) >> $shift)) {
return false;... | php | private function matchAddr($addr1, $addr2, $len = 0, $chunklen = 32)
{
for (; $len > 0; $len -= $chunklen, next($addr1), next($addr2)) {
$shift = $len >= $chunklen ? 0 : $chunklen - $len;
if ((current($addr1) >> $shift) !== (current($addr2) >> $shift)) {
return false;... | [
"private",
"function",
"matchAddr",
"(",
"$",
"addr1",
",",
"$",
"addr2",
",",
"$",
"len",
"=",
"0",
",",
"$",
"chunklen",
"=",
"32",
")",
"{",
"for",
"(",
";",
"$",
"len",
">",
"0",
";",
"$",
"len",
"-=",
"$",
"chunklen",
",",
"next",
"(",
"... | Test if two addresses have the same prefix
@param int[] $addr1
Chunked addr
@param int[] $addr2
Chunked addr
@param int $len
Length of the test
@param int $chunklen
Length of each chunk
@return bool | [
"Test",
"if",
"two",
"addresses",
"have",
"the",
"same",
"prefix"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L462-L472 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.addRepositories | private function addRepositories(Pool $pool, array $repos)
{
foreach ($repos as $repo) {
try {
$pool->addRepository($repo);
} catch (\Exception $exception) {
if (!$this->skipErrors) {
throw $exception;
}
... | php | private function addRepositories(Pool $pool, array $repos)
{
foreach ($repos as $repo) {
try {
$pool->addRepository($repo);
} catch (\Exception $exception) {
if (!$this->skipErrors) {
throw $exception;
}
... | [
"private",
"function",
"addRepositories",
"(",
"Pool",
"$",
"pool",
",",
"array",
"$",
"repos",
")",
"{",
"foreach",
"(",
"$",
"repos",
"as",
"$",
"repo",
")",
"{",
"try",
"{",
"$",
"pool",
"->",
"addRepository",
"(",
"$",
"repo",
")",
";",
"}",
"c... | Add repositories to a pool
@param Pool $pool
The Pool instance
@param RepositoryInterface[] $repos
Array of repositories | [
"Add",
"repositories",
"to",
"a",
"pool"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L482-L495 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.setSelectedAsAbandoned | private function setSelectedAsAbandoned()
{
foreach ($this->selected as $name => $package) {
if (array_key_exists($package->getName(), $this->abandoned)) {
$package->setAbandoned($this->abandoned[$package->getName()]);
}
}
} | php | private function setSelectedAsAbandoned()
{
foreach ($this->selected as $name => $package) {
if (array_key_exists($package->getName(), $this->abandoned)) {
$package->setAbandoned($this->abandoned[$package->getName()]);
}
}
} | [
"private",
"function",
"setSelectedAsAbandoned",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"selected",
"as",
"$",
"name",
"=>",
"$",
"package",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"package",
"->",
"getName",
"(",
")",
",",
"$",
"... | Marks selected packages as abandoned by Configuration file | [
"Marks",
"selected",
"packages",
"as",
"abandoned",
"by",
"Configuration",
"file"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L500-L507 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.getFilteredLinks | private function getFilteredLinks(Composer $composer)
{
$links = array_values($composer->getPackage()->getRequires());
// only pick up packages in our filter, if a filter has been set.
if ($this->hasFilterForPackages()) {
$packagesFilter = $this->packagesFilter;
$lin... | php | private function getFilteredLinks(Composer $composer)
{
$links = array_values($composer->getPackage()->getRequires());
// only pick up packages in our filter, if a filter has been set.
if ($this->hasFilterForPackages()) {
$packagesFilter = $this->packagesFilter;
$lin... | [
"private",
"function",
"getFilteredLinks",
"(",
"Composer",
"$",
"composer",
")",
"{",
"$",
"links",
"=",
"array_values",
"(",
"$",
"composer",
"->",
"getPackage",
"(",
")",
"->",
"getRequires",
"(",
")",
")",
";",
"// only pick up packages in our filter, if a fil... | Gets a list of filtered Links.
@param Composer $composer The Composer instance
@return Link[] | [
"Gets",
"a",
"list",
"of",
"filtered",
"Links",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L516-L529 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.getAllLinks | private function getAllLinks($repos, $minimumStability, $verbose)
{
$links = [];
foreach ($repos as $repo) {
// collect links for composer repos with providers
if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
foreach ($repo->getProviderName... | php | private function getAllLinks($repos, $minimumStability, $verbose)
{
$links = [];
foreach ($repos as $repo) {
// collect links for composer repos with providers
if ($repo instanceof ComposerRepository && $repo->hasProviders()) {
foreach ($repo->getProviderName... | [
"private",
"function",
"getAllLinks",
"(",
"$",
"repos",
",",
"$",
"minimumStability",
",",
"$",
"verbose",
")",
"{",
"$",
"links",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"repos",
"as",
"$",
"repo",
")",
"{",
"// collect links for composer repos with provi... | Gets all Links.
This method is called when 'require-all' is set to true.
@param array $repos List of all Repositories configured
@param string $minimumStability The minimum stability each package must have to be selected
@param bool $verbose Output info if true
@return Link[]|Package[] | [
"Gets",
"all",
"Links",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L542-L574 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.getDepRepos | private function getDepRepos(Composer $composer)
{
$depRepos = [];
if (\is_array($this->depRepositories)) {
$rm = $composer->getRepositoryManager();
foreach ($this->depRepositories as $index => $repoConfig) {
$name = \is_int($index) && isset($repoConfig['url']... | php | private function getDepRepos(Composer $composer)
{
$depRepos = [];
if (\is_array($this->depRepositories)) {
$rm = $composer->getRepositoryManager();
foreach ($this->depRepositories as $index => $repoConfig) {
$name = \is_int($index) && isset($repoConfig['url']... | [
"private",
"function",
"getDepRepos",
"(",
"Composer",
"$",
"composer",
")",
"{",
"$",
"depRepos",
"=",
"[",
"]",
";",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"depRepositories",
")",
")",
"{",
"$",
"rm",
"=",
"$",
"composer",
"->",
"getR... | Create the additional repositories
@return RepositoryInterface[] | [
"Create",
"the",
"additional",
"repositories"
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L673-L686 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.getPackages | private function getPackages(RepositoryInterface $repo)
{
$packages = [];
if ($this->hasFilterForPackages()) {
// apply package filter if defined
foreach ($this->packagesFilter as $filter) {
$packages += $repo->findPackages($filter);
}
} e... | php | private function getPackages(RepositoryInterface $repo)
{
$packages = [];
if ($this->hasFilterForPackages()) {
// apply package filter if defined
foreach ($this->packagesFilter as $filter) {
$packages += $repo->findPackages($filter);
}
} e... | [
"private",
"function",
"getPackages",
"(",
"RepositoryInterface",
"$",
"repo",
")",
"{",
"$",
"packages",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"hasFilterForPackages",
"(",
")",
")",
"{",
"// apply package filter if defined",
"foreach",
"(",
"$",
... | Gets All or filtered Packages of a Repository.
@param RepositoryInterface $repo a Repository
@return PackageInterface[] | [
"Gets",
"All",
"or",
"filtered",
"Packages",
"of",
"a",
"Repository",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L695-L710 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.getRequired | private function getRequired(PackageInterface $package, bool $isRoot)
{
$required = [];
if ($this->requireDependencies) {
$required = $package->getRequires();
}
if (($isRoot || !$this->requireDependencyFilter) && $this->requireDevDependencies) {
$required = a... | php | private function getRequired(PackageInterface $package, bool $isRoot)
{
$required = [];
if ($this->requireDependencies) {
$required = $package->getRequires();
}
if (($isRoot || !$this->requireDependencyFilter) && $this->requireDevDependencies) {
$required = a... | [
"private",
"function",
"getRequired",
"(",
"PackageInterface",
"$",
"package",
",",
"bool",
"$",
"isRoot",
")",
"{",
"$",
"required",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"requireDependencies",
")",
"{",
"$",
"required",
"=",
"$",
"package",... | Gets the required Links if needed.
@param PackageInterface $package A package
@param bool $isRoot
If the packages are linked in root or as dependency
@return Link[] | [
"Gets",
"the",
"required",
"Links",
"if",
"needed",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L721-L733 | train |
composer/satis | src/PackageSelection/PackageSelection.php | PackageSelection.filterRepositories | private function filterRepositories(array $repositories)
{
$url = $this->repositoryFilter;
return array_filter($repositories, function ($repository) use ($url) {
if (!($repository instanceof ConfigurableRepositoryInterface)) {
return false;
}
$co... | php | private function filterRepositories(array $repositories)
{
$url = $this->repositoryFilter;
return array_filter($repositories, function ($repository) use ($url) {
if (!($repository instanceof ConfigurableRepositoryInterface)) {
return false;
}
$co... | [
"private",
"function",
"filterRepositories",
"(",
"array",
"$",
"repositories",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"repositoryFilter",
";",
"return",
"array_filter",
"(",
"$",
"repositories",
",",
"function",
"(",
"$",
"repository",
")",
"use",
"(... | Filter given repositories.
@param RepositoryInterface[] $repositories
@return RepositoryInterface[] | [
"Filter",
"given",
"repositories",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/PackageSelection/PackageSelection.php#L742-L759 | train |
composer/satis | src/Builder/WebBuilder.php | WebBuilder.setDependencies | private function setDependencies(array $packages): self
{
$dependencies = [];
foreach ($packages as $package) {
foreach ($package->getRequires() as $link) {
$dependencies[$link->getTarget()][$link->getSource()] = $link->getSource();
}
}
$this-... | php | private function setDependencies(array $packages): self
{
$dependencies = [];
foreach ($packages as $package) {
foreach ($package->getRequires() as $link) {
$dependencies[$link->getTarget()][$link->getSource()] = $link->getSource();
}
}
$this-... | [
"private",
"function",
"setDependencies",
"(",
"array",
"$",
"packages",
")",
":",
"self",
"{",
"$",
"dependencies",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"packages",
"as",
"$",
"package",
")",
"{",
"foreach",
"(",
"$",
"package",
"->",
"getRequires",... | Defines the required packages.
@param PackageInterface[] $packages List of packages to dump
@return $this | [
"Defines",
"the",
"required",
"packages",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/Builder/WebBuilder.php#L102-L114 | train |
composer/satis | src/Builder/WebBuilder.php | WebBuilder.getMappedPackageList | private function getMappedPackageList(array $packages): array
{
$groupedPackages = $this->groupPackagesByName($packages);
$mappedPackages = [];
foreach ($groupedPackages as $name => $packages) {
$highest = $this->getHighestVersion($packages);
$mappedPackages[$name] ... | php | private function getMappedPackageList(array $packages): array
{
$groupedPackages = $this->groupPackagesByName($packages);
$mappedPackages = [];
foreach ($groupedPackages as $name => $packages) {
$highest = $this->getHighestVersion($packages);
$mappedPackages[$name] ... | [
"private",
"function",
"getMappedPackageList",
"(",
"array",
"$",
"packages",
")",
":",
"array",
"{",
"$",
"groupedPackages",
"=",
"$",
"this",
"->",
"groupPackagesByName",
"(",
"$",
"packages",
")",
";",
"$",
"mappedPackages",
"=",
"[",
"]",
";",
"foreach",... | Gets a list of packages grouped by name with a list of versions.
@param PackageInterface[] $packages List of packages to dump
@return array Grouped list of packages with versions | [
"Gets",
"a",
"list",
"of",
"packages",
"grouped",
"by",
"name",
"with",
"a",
"list",
"of",
"versions",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/Builder/WebBuilder.php#L123-L140 | train |
composer/satis | src/Builder/WebBuilder.php | WebBuilder.groupPackagesByName | private function groupPackagesByName(array $packages): array
{
$groupedPackages = [];
foreach ($packages as $package) {
$groupedPackages[$package->getName()][] = $package;
}
return $groupedPackages;
} | php | private function groupPackagesByName(array $packages): array
{
$groupedPackages = [];
foreach ($packages as $package) {
$groupedPackages[$package->getName()][] = $package;
}
return $groupedPackages;
} | [
"private",
"function",
"groupPackagesByName",
"(",
"array",
"$",
"packages",
")",
":",
"array",
"{",
"$",
"groupedPackages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"packages",
"as",
"$",
"package",
")",
"{",
"$",
"groupedPackages",
"[",
"$",
"package",
... | Gets a list of packages grouped by name.
@param PackageInterface[] $packages List of packages to dump
@return array List of packages grouped by name | [
"Gets",
"a",
"list",
"of",
"packages",
"grouped",
"by",
"name",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/Builder/WebBuilder.php#L149-L157 | train |
composer/satis | src/Builder/WebBuilder.php | WebBuilder.getHighestVersion | private function getHighestVersion(array $packages): ?PackageInterface
{
/** @var $highestVersion PackageInterface|null */
$highestVersion = null;
foreach ($packages as $package) {
if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion... | php | private function getHighestVersion(array $packages): ?PackageInterface
{
/** @var $highestVersion PackageInterface|null */
$highestVersion = null;
foreach ($packages as $package) {
if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion... | [
"private",
"function",
"getHighestVersion",
"(",
"array",
"$",
"packages",
")",
":",
"?",
"PackageInterface",
"{",
"/** @var $highestVersion PackageInterface|null */",
"$",
"highestVersion",
"=",
"null",
";",
"foreach",
"(",
"$",
"packages",
"as",
"$",
"package",
")... | Gets the highest version of packages.
@param PackageInterface[] $packages List of packages to dump
@return PackageInterface The package with the highest version | [
"Gets",
"the",
"highest",
"version",
"of",
"packages",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/Builder/WebBuilder.php#L166-L177 | train |
composer/satis | src/Builder/WebBuilder.php | WebBuilder.getDescSortedVersions | private function getDescSortedVersions(array $packages): array
{
usort($packages, function (PackageInterface $a, PackageInterface $b) {
return version_compare($b->getVersion(), $a->getVersion());
});
return $packages;
} | php | private function getDescSortedVersions(array $packages): array
{
usort($packages, function (PackageInterface $a, PackageInterface $b) {
return version_compare($b->getVersion(), $a->getVersion());
});
return $packages;
} | [
"private",
"function",
"getDescSortedVersions",
"(",
"array",
"$",
"packages",
")",
":",
"array",
"{",
"usort",
"(",
"$",
"packages",
",",
"function",
"(",
"PackageInterface",
"$",
"a",
",",
"PackageInterface",
"$",
"b",
")",
"{",
"return",
"version_compare",
... | Sorts by version the list of packages.
@param PackageInterface[] $packages List of packages to dump
@return PackageInterface[] Sorted list of packages by version | [
"Sorts",
"by",
"version",
"the",
"list",
"of",
"packages",
"."
] | 284570854f4b8d4c8388c9970d90f1bfe47d6b55 | https://github.com/composer/satis/blob/284570854f4b8d4c8388c9970d90f1bfe47d6b55/src/Builder/WebBuilder.php#L186-L193 | train |
matomo-org/device-detector | Parser/Device/HbbTv.php | HbbTv.parse | public function parse()
{
// only parse user agents containing hbbtv fragment
if (!$this->isHbbTv()) {
return false;
}
parent::parse();
// always set device type to tv, even if no model/brand could be found
$this->deviceType = self::DEVICE_TYPE_TV;
... | php | public function parse()
{
// only parse user agents containing hbbtv fragment
if (!$this->isHbbTv()) {
return false;
}
parent::parse();
// always set device type to tv, even if no model/brand could be found
$this->deviceType = self::DEVICE_TYPE_TV;
... | [
"public",
"function",
"parse",
"(",
")",
"{",
"// only parse user agents containing hbbtv fragment",
"if",
"(",
"!",
"$",
"this",
"->",
"isHbbTv",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"parent",
"::",
"parse",
"(",
")",
";",
"// always set device ty... | Parses the current UA and checks whether it contains HbbTv information
@see televisions.yml for list of detected televisions | [
"Parses",
"the",
"current",
"UA",
"and",
"checks",
"whether",
"it",
"contains",
"HbbTv",
"information"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/Parser/Device/HbbTv.php#L27-L40 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.setUserAgent | public function setUserAgent($userAgent)
{
if ($this->userAgent != $userAgent) {
$this->reset();
}
$this->userAgent = $userAgent;
} | php | public function setUserAgent($userAgent)
{
if ($this->userAgent != $userAgent) {
$this->reset();
}
$this->userAgent = $userAgent;
} | [
"public",
"function",
"setUserAgent",
"(",
"$",
"userAgent",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"userAgent",
"!=",
"$",
"userAgent",
")",
"{",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"}",
"$",
"this",
"->",
"userAgent",
"=",
"$",
"userAgent",... | Sets the useragent to be parsed
@param string $userAgent | [
"Sets",
"the",
"useragent",
"to",
"be",
"parsed"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L215-L221 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.isDesktop | public function isDesktop()
{
$osShort = $this->getOs('short_name');
if (empty($osShort) || self::UNKNOWN == $osShort) {
return false;
}
// Check for browsers available for mobile devices only
if ($this->usesMobileBrowser()) {
return false;
}
... | php | public function isDesktop()
{
$osShort = $this->getOs('short_name');
if (empty($osShort) || self::UNKNOWN == $osShort) {
return false;
}
// Check for browsers available for mobile devices only
if ($this->usesMobileBrowser()) {
return false;
}
... | [
"public",
"function",
"isDesktop",
"(",
")",
"{",
"$",
"osShort",
"=",
"$",
"this",
"->",
"getOs",
"(",
"'short_name'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"osShort",
")",
"||",
"self",
"::",
"UNKNOWN",
"==",
"$",
"osShort",
")",
"{",
"return",
... | Returns if the parsed UA was identified as desktop device
Desktop devices are all devices with an unknown type that are running a desktop os
@see self::$desktopOsArray
@return bool | [
"Returns",
"if",
"the",
"parsed",
"UA",
"was",
"identified",
"as",
"desktop",
"device",
"Desktop",
"devices",
"are",
"all",
"devices",
"with",
"an",
"unknown",
"type",
"that",
"are",
"running",
"a",
"desktop",
"os"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L418-L433 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.getOs | public function getOs($attr = '')
{
if ($attr == '') {
return $this->os;
}
if (!isset($this->os[$attr])) {
return self::UNKNOWN;
}
return $this->os[$attr];
} | php | public function getOs($attr = '')
{
if ($attr == '') {
return $this->os;
}
if (!isset($this->os[$attr])) {
return self::UNKNOWN;
}
return $this->os[$attr];
} | [
"public",
"function",
"getOs",
"(",
"$",
"attr",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"attr",
"==",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"os",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"os",
"[",
"$",
"attr",
"]",
"... | Returns the operating system data extracted from the parsed UA
If $attr is given only that property will be returned
@param string $attr property to return(optional)
@return array|string | [
"Returns",
"the",
"operating",
"system",
"data",
"extracted",
"from",
"the",
"parsed",
"UA"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L444-L455 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.getClient | public function getClient($attr = '')
{
if ($attr == '') {
return $this->client;
}
if (!isset($this->client[$attr])) {
return self::UNKNOWN;
}
return $this->client[$attr];
} | php | public function getClient($attr = '')
{
if ($attr == '') {
return $this->client;
}
if (!isset($this->client[$attr])) {
return self::UNKNOWN;
}
return $this->client[$attr];
} | [
"public",
"function",
"getClient",
"(",
"$",
"attr",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"attr",
"==",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"client",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"client",
"[",
"$",
"attr"... | Returns the client data extracted from the parsed UA
If $attr is given only that property will be returned
@param string $attr property to return(optional)
@return array|string | [
"Returns",
"the",
"client",
"data",
"extracted",
"from",
"the",
"parsed",
"UA"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L466-L477 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.parse | public function parse()
{
if ($this->isParsed()) {
return;
}
$this->parsed = true;
// skip parsing for empty useragents or those not containing any letter
if (empty($this->userAgent) || !preg_match('/([a-z])/i', $this->userAgent)) {
return;
}... | php | public function parse()
{
if ($this->isParsed()) {
return;
}
$this->parsed = true;
// skip parsing for empty useragents or those not containing any letter
if (empty($this->userAgent) || !preg_match('/([a-z])/i', $this->userAgent)) {
return;
}... | [
"public",
"function",
"parse",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isParsed",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"parsed",
"=",
"true",
";",
"// skip parsing for empty useragents or those not containing any letter",
"if",
"(",... | Triggers the parsing of the current user agent | [
"Triggers",
"the",
"parsing",
"of",
"the",
"current",
"user",
"agent"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L574-L602 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.parseBot | protected function parseBot()
{
if ($this->skipBotDetection) {
$this->bot = false;
return false;
}
$parsers = $this->getBotParsers();
foreach ($parsers as $parser) {
$parser->setUserAgent($this->getUserAgent());
$parser->setYamlParser... | php | protected function parseBot()
{
if ($this->skipBotDetection) {
$this->bot = false;
return false;
}
$parsers = $this->getBotParsers();
foreach ($parsers as $parser) {
$parser->setUserAgent($this->getUserAgent());
$parser->setYamlParser... | [
"protected",
"function",
"parseBot",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"skipBotDetection",
")",
"{",
"$",
"this",
"->",
"bot",
"=",
"false",
";",
"return",
"false",
";",
"}",
"$",
"parsers",
"=",
"$",
"this",
"->",
"getBotParsers",
"(",
")... | Parses the UA for bot information using the Bot parser | [
"Parses",
"the",
"UA",
"for",
"bot",
"information",
"using",
"the",
"Bot",
"parser"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L607-L629 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.getInfoFromUserAgent | public static function getInfoFromUserAgent($ua)
{
$deviceDetector = new DeviceDetector($ua);
$deviceDetector->parse();
if ($deviceDetector->isBot()) {
return array(
'user_agent' => $deviceDetector->getUserAgent(),
'bot' => $deviceDetector->getBot... | php | public static function getInfoFromUserAgent($ua)
{
$deviceDetector = new DeviceDetector($ua);
$deviceDetector->parse();
if ($deviceDetector->isBot()) {
return array(
'user_agent' => $deviceDetector->getUserAgent(),
'bot' => $deviceDetector->getBot... | [
"public",
"static",
"function",
"getInfoFromUserAgent",
"(",
"$",
"ua",
")",
"{",
"$",
"deviceDetector",
"=",
"new",
"DeviceDetector",
"(",
"$",
"ua",
")",
";",
"$",
"deviceDetector",
"->",
"parse",
"(",
")",
";",
"if",
"(",
"$",
"deviceDetector",
"->",
... | Parses a useragent and returns the detected data
ATTENTION: Use that method only for testing or very small applications
To get fast results from DeviceDetector you need to make your own implementation,
that should use one of the caching mechanisms. See README.md for more information.
@internal
@deprecated
@param str... | [
"Parses",
"a",
"useragent",
"and",
"returns",
"the",
"detected",
"data"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L804-L832 | train |
matomo-org/device-detector | DeviceDetector.php | DeviceDetector.setCache | public function setCache($cache)
{
if ($cache instanceof Cache ||
(class_exists('\Doctrine\Common\Cache\CacheProvider') && $cache instanceof \Doctrine\Common\Cache\CacheProvider)
) {
$this->cache = $cache;
return;
}
throw new \Exception('Cache not... | php | public function setCache($cache)
{
if ($cache instanceof Cache ||
(class_exists('\Doctrine\Common\Cache\CacheProvider') && $cache instanceof \Doctrine\Common\Cache\CacheProvider)
) {
$this->cache = $cache;
return;
}
throw new \Exception('Cache not... | [
"public",
"function",
"setCache",
"(",
"$",
"cache",
")",
"{",
"if",
"(",
"$",
"cache",
"instanceof",
"Cache",
"||",
"(",
"class_exists",
"(",
"'\\Doctrine\\Common\\Cache\\CacheProvider'",
")",
"&&",
"$",
"cache",
"instanceof",
"\\",
"Doctrine",
"\\",
"Common",
... | Sets the Cache class
@param Cache|\Doctrine\Common\Cache\CacheProvider $cache
@throws \Exception | [
"Sets",
"the",
"Cache",
"class"
] | 61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b | https://github.com/matomo-org/device-detector/blob/61f93df202f3ffa1b5f2ff6d8620944e3f18ae4b/DeviceDetector.php#L840-L850 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.