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
babenkoivan/scout-elasticsearch-driver
src/Payloads/RawPayload.php
RawPayload.add
public function add($key, $value) { if (! is_null($key)) { $currentValue = Arr::get($this->payload, $key, []); if (! is_array($currentValue)) { $currentValue = Arr::wrap($currentValue); } $currentValue[] = $value; Arr::set($this-...
php
public function add($key, $value) { if (! is_null($key)) { $currentValue = Arr::get($this->payload, $key, []); if (! is_array($currentValue)) { $currentValue = Arr::wrap($currentValue); } $currentValue[] = $value; Arr::set($this-...
[ "public", "function", "add", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "!", "is_null", "(", "$", "key", ")", ")", "{", "$", "currentValue", "=", "Arr", "::", "get", "(", "$", "this", "->", "payload", ",", "$", "key", ",", "[", ...
Add a value. @param string $key @param mixed $value @return $this
[ "Add", "a", "value", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Payloads/RawPayload.php#L82-L97
train
babenkoivan/scout-elasticsearch-driver
src/Payloads/RawPayload.php
RawPayload.addIfNotEmpty
public function addIfNotEmpty($key, $value) { if (empty($value)) { return $this; } return $this->add($key, $value); }
php
public function addIfNotEmpty($key, $value) { if (empty($value)) { return $this; } return $this->add($key, $value); }
[ "public", "function", "addIfNotEmpty", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "return", "$", "this", ";", "}", "return", "$", "this", "->", "add", "(", "$", "key", ",", "$", "value", ...
Add a value if it's not empty. @param string $key @param mixed $value @return $this
[ "Add", "a", "value", "if", "it", "s", "not", "empty", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Payloads/RawPayload.php#L106-L113
train
babenkoivan/scout-elasticsearch-driver
src/IndexConfigurator.php
IndexConfigurator.getName
public function getName() { $name = $this->name ?? Str::snake(str_replace('IndexConfigurator', '', class_basename($this))); return config('scout.prefix').$name; }
php
public function getName() { $name = $this->name ?? Str::snake(str_replace('IndexConfigurator', '', class_basename($this))); return config('scout.prefix').$name; }
[ "public", "function", "getName", "(", ")", "{", "$", "name", "=", "$", "this", "->", "name", "??", "Str", "::", "snake", "(", "str_replace", "(", "'IndexConfigurator'", ",", "''", ",", "class_basename", "(", "$", "this", ")", ")", ")", ";", "return", ...
Get th name. @return string
[ "Get", "th", "name", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/IndexConfigurator.php#L35-L40
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticIndexCreateCommand.php
ElasticIndexCreateCommand.createWriteAlias
protected function createWriteAlias() { $configurator = $this->getIndexConfigurator(); if (! in_array(Migratable::class, class_uses_recursive($configurator))) { return; } $payload = (new IndexPayload($configurator)) ->set('name', $configurator->getWriteAlias...
php
protected function createWriteAlias() { $configurator = $this->getIndexConfigurator(); if (! in_array(Migratable::class, class_uses_recursive($configurator))) { return; } $payload = (new IndexPayload($configurator)) ->set('name', $configurator->getWriteAlias...
[ "protected", "function", "createWriteAlias", "(", ")", "{", "$", "configurator", "=", "$", "this", "->", "getIndexConfigurator", "(", ")", ";", "if", "(", "!", "in_array", "(", "Migratable", "::", "class", ",", "class_uses_recursive", "(", "$", "configurator",...
Create an write alias. @return void
[ "Create", "an", "write", "alias", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticIndexCreateCommand.php#L53-L73
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.isTargetIndexExists
protected function isTargetIndexExists() { $targetIndex = $this->argument('target-index'); $payload = (new RawPayload()) ->set('index', $targetIndex) ->get(); return ElasticClient::indices() ->exists($payload); }
php
protected function isTargetIndexExists() { $targetIndex = $this->argument('target-index'); $payload = (new RawPayload()) ->set('index', $targetIndex) ->get(); return ElasticClient::indices() ->exists($payload); }
[ "protected", "function", "isTargetIndexExists", "(", ")", "{", "$", "targetIndex", "=", "$", "this", "->", "argument", "(", "'target-index'", ")", ";", "$", "payload", "=", "(", "new", "RawPayload", "(", ")", ")", "->", "set", "(", "'index'", ",", "$", ...
Checks if the target index exists. @return bool
[ "Checks", "if", "the", "target", "index", "exists", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L49-L59
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.createTargetIndex
protected function createTargetIndex() { $targetIndex = $this->argument('target-index'); $sourceIndexConfigurator = $this->getModel() ->getIndexConfigurator(); $payload = (new RawPayload()) ->set('index', $targetIndex) ->setIfNotEmpty('body.settings', $s...
php
protected function createTargetIndex() { $targetIndex = $this->argument('target-index'); $sourceIndexConfigurator = $this->getModel() ->getIndexConfigurator(); $payload = (new RawPayload()) ->set('index', $targetIndex) ->setIfNotEmpty('body.settings', $s...
[ "protected", "function", "createTargetIndex", "(", ")", "{", "$", "targetIndex", "=", "$", "this", "->", "argument", "(", "'target-index'", ")", ";", "$", "sourceIndexConfigurator", "=", "$", "this", "->", "getModel", "(", ")", "->", "getIndexConfigurator", "(...
Create a target index. @return void
[ "Create", "a", "target", "index", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L66-L86
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.updateTargetIndex
protected function updateTargetIndex() { $targetIndex = $this->argument('target-index'); $sourceIndexConfigurator = $this->getModel() ->getIndexConfigurator(); $targetIndexPayload = (new RawPayload()) ->set('index', $targetIndex) ->get(); $indic...
php
protected function updateTargetIndex() { $targetIndex = $this->argument('target-index'); $sourceIndexConfigurator = $this->getModel() ->getIndexConfigurator(); $targetIndexPayload = (new RawPayload()) ->set('index', $targetIndex) ->get(); $indic...
[ "protected", "function", "updateTargetIndex", "(", ")", "{", "$", "targetIndex", "=", "$", "this", "->", "argument", "(", "'target-index'", ")", ";", "$", "sourceIndexConfigurator", "=", "$", "this", "->", "getModel", "(", ")", "->", "getIndexConfigurator", "(...
Update the target index. @throws \Exception @return void
[ "Update", "the", "target", "index", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L94-L140
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.updateTargetIndexMapping
protected function updateTargetIndexMapping() { $sourceModel = $this->getModel(); $sourceIndexConfigurator = $sourceModel->getIndexConfigurator(); $targetIndex = $this->argument('target-index'); $targetType = $sourceModel->searchableAs(); $mapping = array_merge_recursive( ...
php
protected function updateTargetIndexMapping() { $sourceModel = $this->getModel(); $sourceIndexConfigurator = $sourceModel->getIndexConfigurator(); $targetIndex = $this->argument('target-index'); $targetType = $sourceModel->searchableAs(); $mapping = array_merge_recursive( ...
[ "protected", "function", "updateTargetIndexMapping", "(", ")", "{", "$", "sourceModel", "=", "$", "this", "->", "getModel", "(", ")", ";", "$", "sourceIndexConfigurator", "=", "$", "sourceModel", "->", "getIndexConfigurator", "(", ")", ";", "$", "targetIndex", ...
Update the target index mapping. @return void
[ "Update", "the", "target", "index", "mapping", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L147-L182
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.isAliasExists
protected function isAliasExists($name) { $payload = (new RawPayload()) ->set('name', $name) ->get(); return ElasticClient::indices() ->existsAlias($payload); }
php
protected function isAliasExists($name) { $payload = (new RawPayload()) ->set('name', $name) ->get(); return ElasticClient::indices() ->existsAlias($payload); }
[ "protected", "function", "isAliasExists", "(", "$", "name", ")", "{", "$", "payload", "=", "(", "new", "RawPayload", "(", ")", ")", "->", "set", "(", "'name'", ",", "$", "name", ")", "->", "get", "(", ")", ";", "return", "ElasticClient", "::", "indic...
Check if an alias exists. @param string $name @return bool
[ "Check", "if", "an", "alias", "exists", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L190-L198
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.deleteAlias
protected function deleteAlias($name) { $aliases = $this->getAlias($name); if (empty($aliases)) { return; } foreach ($aliases as $index => $alias) { $deletePayload = (new RawPayload()) ->set('index', $index) ->set('name', $nam...
php
protected function deleteAlias($name) { $aliases = $this->getAlias($name); if (empty($aliases)) { return; } foreach ($aliases as $index => $alias) { $deletePayload = (new RawPayload()) ->set('index', $index) ->set('name', $nam...
[ "protected", "function", "deleteAlias", "(", "$", "name", ")", "{", "$", "aliases", "=", "$", "this", "->", "getAlias", "(", "$", "name", ")", ";", "if", "(", "empty", "(", "$", "aliases", ")", ")", "{", "return", ";", "}", "foreach", "(", "$", "...
Delete an alias. @param string $name @return void
[ "Delete", "an", "alias", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L222-L245
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.createAliasForTargetIndex
protected function createAliasForTargetIndex($name) { $targetIndex = $this->argument('target-index'); if ($this->isAliasExists($name)) { $this->deleteAlias($name); } $payload = (new RawPayload()) ->set('index', $targetIndex) ->set('name', $name) ...
php
protected function createAliasForTargetIndex($name) { $targetIndex = $this->argument('target-index'); if ($this->isAliasExists($name)) { $this->deleteAlias($name); } $payload = (new RawPayload()) ->set('index', $targetIndex) ->set('name', $name) ...
[ "protected", "function", "createAliasForTargetIndex", "(", "$", "name", ")", "{", "$", "targetIndex", "=", "$", "this", "->", "argument", "(", "'target-index'", ")", ";", "if", "(", "$", "this", "->", "isAliasExists", "(", "$", "name", ")", ")", "{", "$"...
Create an alias for the target index. @param string $name @return void
[ "Create", "an", "alias", "for", "the", "target", "index", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L253-L274
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticMigrateCommand.php
ElasticMigrateCommand.deleteSourceIndex
protected function deleteSourceIndex() { $sourceIndexConfigurator = $this ->getModel() ->getIndexConfigurator(); if ($this->isAliasExists($sourceIndexConfigurator->getName())) { $aliases = $this->getAlias($sourceIndexConfigurator->getName()); foreach...
php
protected function deleteSourceIndex() { $sourceIndexConfigurator = $this ->getModel() ->getIndexConfigurator(); if ($this->isAliasExists($sourceIndexConfigurator->getName())) { $aliases = $this->getAlias($sourceIndexConfigurator->getName()); foreach...
[ "protected", "function", "deleteSourceIndex", "(", ")", "{", "$", "sourceIndexConfigurator", "=", "$", "this", "->", "getModel", "(", ")", "->", "getIndexConfigurator", "(", ")", ";", "if", "(", "$", "this", "->", "isAliasExists", "(", "$", "sourceIndexConfigu...
Delete the source index. @return void
[ "Delete", "the", "source", "index", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticMigrateCommand.php#L296-L330
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticIndexUpdateCommand.php
ElasticIndexUpdateCommand.updateIndex
protected function updateIndex() { $configurator = $this->getIndexConfigurator(); $indexPayload = (new IndexPayload($configurator))->get(); $indices = ElasticClient::indices(); if (! $indices->exists($indexPayload)) { throw new LogicException(sprintf( '...
php
protected function updateIndex() { $configurator = $this->getIndexConfigurator(); $indexPayload = (new IndexPayload($configurator))->get(); $indices = ElasticClient::indices(); if (! $indices->exists($indexPayload)) { throw new LogicException(sprintf( '...
[ "protected", "function", "updateIndex", "(", ")", "{", "$", "configurator", "=", "$", "this", "->", "getIndexConfigurator", "(", ")", ";", "$", "indexPayload", "=", "(", "new", "IndexPayload", "(", "$", "configurator", ")", ")", "->", "get", "(", ")", ";...
Update the index. @throws \Exception @return void
[ "Update", "the", "index", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticIndexUpdateCommand.php#L34-L80
train
babenkoivan/scout-elasticsearch-driver
src/Console/ElasticIndexUpdateCommand.php
ElasticIndexUpdateCommand.createWriteAlias
protected function createWriteAlias() { $configurator = $this->getIndexConfigurator(); if (! in_array(Migratable::class, class_uses_recursive($configurator))) { return; } $indices = ElasticClient::indices(); $existsPayload = (new RawPayload()) ->set...
php
protected function createWriteAlias() { $configurator = $this->getIndexConfigurator(); if (! in_array(Migratable::class, class_uses_recursive($configurator))) { return; } $indices = ElasticClient::indices(); $existsPayload = (new RawPayload()) ->set...
[ "protected", "function", "createWriteAlias", "(", ")", "{", "$", "configurator", "=", "$", "this", "->", "getIndexConfigurator", "(", ")", ";", "if", "(", "!", "in_array", "(", "Migratable", "::", "class", ",", "class_uses_recursive", "(", "$", "configurator",...
Create a write alias. @return void
[ "Create", "a", "write", "alias", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Console/ElasticIndexUpdateCommand.php#L87-L116
train
babenkoivan/scout-elasticsearch-driver
src/Payloads/IndexPayload.php
IndexPayload.useAlias
public function useAlias($alias) { $aliasGetter = 'get'.ucfirst($alias).'Alias'; if (! method_exists($this->indexConfigurator, $aliasGetter)) { throw new Exception(sprintf( 'The index configurator %s doesn\'t have getter for the %s alias.', get_class($thi...
php
public function useAlias($alias) { $aliasGetter = 'get'.ucfirst($alias).'Alias'; if (! method_exists($this->indexConfigurator, $aliasGetter)) { throw new Exception(sprintf( 'The index configurator %s doesn\'t have getter for the %s alias.', get_class($thi...
[ "public", "function", "useAlias", "(", "$", "alias", ")", "{", "$", "aliasGetter", "=", "'get'", ".", "ucfirst", "(", "$", "alias", ")", ".", "'Alias'", ";", "if", "(", "!", "method_exists", "(", "$", "this", "->", "indexConfigurator", ",", "$", "alias...
Use an alias. @param string $alias @return $this @throws \Exception
[ "Use", "an", "alias", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Payloads/IndexPayload.php#L49-L64
train
babenkoivan/scout-elasticsearch-driver
src/Searchable.php
Searchable.getMapping
public function getMapping() { $mapping = $this->mapping ?? []; if ($this::usesSoftDelete() && config('scout.soft_delete', false)) { Arr::set($mapping, 'properties.__soft_deleted', ['type' => 'integer']); } return $mapping; }
php
public function getMapping() { $mapping = $this->mapping ?? []; if ($this::usesSoftDelete() && config('scout.soft_delete', false)) { Arr::set($mapping, 'properties.__soft_deleted', ['type' => 'integer']); } return $mapping; }
[ "public", "function", "getMapping", "(", ")", "{", "$", "mapping", "=", "$", "this", "->", "mapping", "??", "[", "]", ";", "if", "(", "$", "this", "::", "usesSoftDelete", "(", ")", "&&", "config", "(", "'scout.soft_delete'", ",", "false", ")", ")", "...
Get the mapping. @return array
[ "Get", "the", "mapping", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Searchable.php#L72-L81
train
babenkoivan/scout-elasticsearch-driver
src/Searchable.php
Searchable.getSearchRules
public function getSearchRules() { return isset($this->searchRules) && count($this->searchRules) > 0 ? $this->searchRules : [SearchRule::class]; }
php
public function getSearchRules() { return isset($this->searchRules) && count($this->searchRules) > 0 ? $this->searchRules : [SearchRule::class]; }
[ "public", "function", "getSearchRules", "(", ")", "{", "return", "isset", "(", "$", "this", "->", "searchRules", ")", "&&", "count", "(", "$", "this", "->", "searchRules", ")", ">", "0", "?", "$", "this", "->", "searchRules", ":", "[", "SearchRule", ":...
Get the search rules. @return array
[ "Get", "the", "search", "rules", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Searchable.php#L88-L92
train
babenkoivan/scout-elasticsearch-driver
src/Searchable.php
Searchable.search
public static function search($query, $callback = null) { $softDelete = static::usesSoftDelete() && config('scout.soft_delete', false); if ($query == '*') { return new FilterBuilder(new static, $callback, $softDelete); } else { return new SearchBuilder(new static, $q...
php
public static function search($query, $callback = null) { $softDelete = static::usesSoftDelete() && config('scout.soft_delete', false); if ($query == '*') { return new FilterBuilder(new static, $callback, $softDelete); } else { return new SearchBuilder(new static, $q...
[ "public", "static", "function", "search", "(", "$", "query", ",", "$", "callback", "=", "null", ")", "{", "$", "softDelete", "=", "static", "::", "usesSoftDelete", "(", ")", "&&", "config", "(", "'scout.soft_delete'", ",", "false", ")", ";", "if", "(", ...
Execute the search. @param string $query @param callable|null $callback @return \ScoutElastic\Builders\FilterBuilder|\ScoutElastic\Builders\SearchBuilder
[ "Execute", "the", "search", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Searchable.php#L101-L110
train
babenkoivan/scout-elasticsearch-driver
src/Builders/FilterBuilder.php
FilterBuilder.whereRegexp
public function whereRegexp($field, $value, $flags = 'ALL') { $this->wheres['must'][] = [ 'regexp' => [ $field => [ 'value' => $value, 'flags' => $flags, ], ], ]; return $this; }
php
public function whereRegexp($field, $value, $flags = 'ALL') { $this->wheres['must'][] = [ 'regexp' => [ $field => [ 'value' => $value, 'flags' => $flags, ], ], ]; return $this; }
[ "public", "function", "whereRegexp", "(", "$", "field", ",", "$", "value", ",", "$", "flags", "=", "'ALL'", ")", "{", "$", "this", "->", "wheres", "[", "'must'", "]", "[", "]", "=", "[", "'regexp'", "=>", "[", "$", "field", "=>", "[", "'value'", ...
Add a whereRegexp condition. @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html Regexp query @param string $field @param string $value @param string $flags @return $this
[ "Add", "a", "whereRegexp", "condition", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Builders/FilterBuilder.php#L288-L300
train
babenkoivan/scout-elasticsearch-driver
src/Builders/FilterBuilder.php
FilterBuilder.whereGeoDistance
public function whereGeoDistance($field, $value, $distance) { $this->wheres['must'][] = [ 'geo_distance' => [ 'distance' => $distance, $field => $value, ], ]; return $this; }
php
public function whereGeoDistance($field, $value, $distance) { $this->wheres['must'][] = [ 'geo_distance' => [ 'distance' => $distance, $field => $value, ], ]; return $this; }
[ "public", "function", "whereGeoDistance", "(", "$", "field", ",", "$", "value", ",", "$", "distance", ")", "{", "$", "this", "->", "wheres", "[", "'must'", "]", "[", "]", "=", "[", "'geo_distance'", "=>", "[", "'distance'", "=>", "$", "distance", ",", ...
Add a whereGeoDistance condition. @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html Geo distance query @param string $field @param string|array $value @param int|string $distance @return $this
[ "Add", "a", "whereGeoDistance", "condition", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Builders/FilterBuilder.php#L312-L322
train
babenkoivan/scout-elasticsearch-driver
src/Builders/FilterBuilder.php
FilterBuilder.select
public function select($fields) { $this->select = array_merge( $this->select, Arr::wrap($fields) ); return $this; }
php
public function select($fields) { $this->select = array_merge( $this->select, Arr::wrap($fields) ); return $this; }
[ "public", "function", "select", "(", "$", "fields", ")", "{", "$", "this", "->", "select", "=", "array_merge", "(", "$", "this", "->", "select", ",", "Arr", "::", "wrap", "(", "$", "fields", ")", ")", ";", "return", "$", "this", ";", "}" ]
Select one or many fields. @param mixed $fields @return $this
[ "Select", "one", "or", "many", "fields", "." ]
f078a6f9d35b44e4ff440ea31e583973596e9726
https://github.com/babenkoivan/scout-elasticsearch-driver/blob/f078a6f9d35b44e4ff440ea31e583973596e9726/src/Builders/FilterBuilder.php#L515-L523
train
filp/whoops
src/Whoops/Exception/Formatter.php
Formatter.formatExceptionAsDataArray
public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace) { $exception = $inspector->getException(); $response = [ 'type' => get_class($exception), 'message' => $exception->getMessage(), 'file' => $exception->getFile(), ...
php
public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace) { $exception = $inspector->getException(); $response = [ 'type' => get_class($exception), 'message' => $exception->getMessage(), 'file' => $exception->getFile(), ...
[ "public", "static", "function", "formatExceptionAsDataArray", "(", "Inspector", "$", "inspector", ",", "$", "shouldAddTrace", ")", "{", "$", "exception", "=", "$", "inspector", "->", "getException", "(", ")", ";", "$", "response", "=", "[", "'type'", "=>", "...
Returns all basic information about the exception in a simple array for further convertion to other languages @param Inspector $inspector @param bool $shouldAddTrace @return array
[ "Returns", "all", "basic", "information", "about", "the", "exception", "in", "a", "simple", "array", "for", "further", "convertion", "to", "other", "languages" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Formatter.php#L18-L47
train
filp/whoops
src/Whoops/Util/TemplateHelper.php
TemplateHelper.breakOnDelimiter
public function breakOnDelimiter($delimiter, $s) { $parts = explode($delimiter, $s); foreach ($parts as &$part) { $part = '<div class="delimiter">' . $part . '</div>'; } return implode($delimiter, $parts); }
php
public function breakOnDelimiter($delimiter, $s) { $parts = explode($delimiter, $s); foreach ($parts as &$part) { $part = '<div class="delimiter">' . $part . '</div>'; } return implode($delimiter, $parts); }
[ "public", "function", "breakOnDelimiter", "(", "$", "delimiter", ",", "$", "s", ")", "{", "$", "parts", "=", "explode", "(", "$", "delimiter", ",", "$", "s", ")", ";", "foreach", "(", "$", "parts", "as", "&", "$", "part", ")", "{", "$", "part", "...
Makes sure that the given string breaks on the delimiter. @param string $delimiter @param string $s @return string
[ "Makes", "sure", "that", "the", "given", "string", "breaks", "on", "the", "delimiter", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Util/TemplateHelper.php#L103-L111
train
filp/whoops
src/Whoops/Util/TemplateHelper.php
TemplateHelper.shorten
public function shorten($path) { if ($this->applicationRootPath != "/") { $path = str_replace($this->applicationRootPath, '&hellip;', $path); } return $path; }
php
public function shorten($path) { if ($this->applicationRootPath != "/") { $path = str_replace($this->applicationRootPath, '&hellip;', $path); } return $path; }
[ "public", "function", "shorten", "(", "$", "path", ")", "{", "if", "(", "$", "this", "->", "applicationRootPath", "!=", "\"/\"", ")", "{", "$", "path", "=", "str_replace", "(", "$", "this", "->", "applicationRootPath", ",", "'&hellip;'", ",", "$", "path"...
Replace the part of the path that all files have in common. @param string $path @return string
[ "Replace", "the", "part", "of", "the", "path", "that", "all", "files", "have", "in", "common", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Util/TemplateHelper.php#L119-L126
train
filp/whoops
src/Whoops/Util/TemplateHelper.php
TemplateHelper.dumpArgs
public function dumpArgs(Frame $frame) { // we support frame args only when the optional dumper is available if (!$this->getDumper()) { return ''; } $html = ''; $numFrames = count($frame->getArgs()); if ($numFrames > 0) { $html = '<ol class="...
php
public function dumpArgs(Frame $frame) { // we support frame args only when the optional dumper is available if (!$this->getDumper()) { return ''; } $html = ''; $numFrames = count($frame->getArgs()); if ($numFrames > 0) { $html = '<ol class="...
[ "public", "function", "dumpArgs", "(", "Frame", "$", "frame", ")", "{", "// we support frame args only when the optional dumper is available", "if", "(", "!", "$", "this", "->", "getDumper", "(", ")", ")", "{", "return", "''", ";", "}", "$", "html", "=", "''",...
Format the args of the given Frame as a human readable html string @param Frame $frame @return string the rendered html
[ "Format", "the", "args", "of", "the", "given", "Frame", "as", "a", "human", "readable", "html", "string" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Util/TemplateHelper.php#L195-L214
train
filp/whoops
src/Whoops/Util/TemplateHelper.php
TemplateHelper.slug
public function slug($original) { $slug = str_replace(" ", "-", $original); $slug = preg_replace('/[^\w\d\-\_]/i', '', $slug); return strtolower($slug); }
php
public function slug($original) { $slug = str_replace(" ", "-", $original); $slug = preg_replace('/[^\w\d\-\_]/i', '', $slug); return strtolower($slug); }
[ "public", "function", "slug", "(", "$", "original", ")", "{", "$", "slug", "=", "str_replace", "(", "\" \"", ",", "\"-\"", ",", "$", "original", ")", ";", "$", "slug", "=", "preg_replace", "(", "'/[^\\w\\d\\-\\_]/i'", ",", "''", ",", "$", "slug", ")", ...
Convert a string to a slug version of itself @param string $original @return string
[ "Convert", "a", "string", "to", "a", "slug", "version", "of", "itself" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Util/TemplateHelper.php#L222-L227
train
filp/whoops
src/Whoops/Util/TemplateHelper.php
TemplateHelper.render
public function render($template, array $additionalVariables = null) { $variables = $this->getVariables(); // Pass the helper to the template: $variables["tpl"] = $this; if ($additionalVariables !== null) { $variables = array_replace($variables, $additionalVariables); ...
php
public function render($template, array $additionalVariables = null) { $variables = $this->getVariables(); // Pass the helper to the template: $variables["tpl"] = $this; if ($additionalVariables !== null) { $variables = array_replace($variables, $additionalVariables); ...
[ "public", "function", "render", "(", "$", "template", ",", "array", "$", "additionalVariables", "=", "null", ")", "{", "$", "variables", "=", "$", "this", "->", "getVariables", "(", ")", ";", "// Pass the helper to the template:", "$", "variables", "[", "\"tpl...
Given a template path, render it within its own scope. This method also accepts an array of additional variables to be passed to the template. @param string $template @param array $additionalVariables
[ "Given", "a", "template", "path", "render", "it", "within", "its", "own", "scope", ".", "This", "method", "also", "accepts", "an", "array", "of", "additional", "variables", "to", "be", "passed", "to", "the", "template", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Util/TemplateHelper.php#L237-L252
train
filp/whoops
src/Whoops/Run.php
Run.pushHandler
public function pushHandler($handler) { if (is_callable($handler)) { $handler = new CallbackHandler($handler); } if (!$handler instanceof HandlerInterface) { throw new InvalidArgumentException( "Argument to " . __METHOD__ . " must be a callable, or ...
php
public function pushHandler($handler) { if (is_callable($handler)) { $handler = new CallbackHandler($handler); } if (!$handler instanceof HandlerInterface) { throw new InvalidArgumentException( "Argument to " . __METHOD__ . " must be a callable, or ...
[ "public", "function", "pushHandler", "(", "$", "handler", ")", "{", "if", "(", "is_callable", "(", "$", "handler", ")", ")", "{", "$", "handler", "=", "new", "CallbackHandler", "(", "$", "handler", ")", ";", "}", "if", "(", "!", "$", "handler", "inst...
Pushes a handler to the end of the stack @throws InvalidArgumentException If argument is not callable or instance of HandlerInterface @param Callable|HandlerInterface $handler @return Run
[ "Pushes", "a", "handler", "to", "the", "end", "of", "the", "stack" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Run.php#L50-L65
train
filp/whoops
src/Whoops/Run.php
Run.unregister
public function unregister() { if ($this->isRegistered) { $this->system->restoreExceptionHandler(); $this->system->restoreErrorHandler(); $this->isRegistered = false; } return $this; }
php
public function unregister() { if ($this->isRegistered) { $this->system->restoreExceptionHandler(); $this->system->restoreErrorHandler(); $this->isRegistered = false; } return $this; }
[ "public", "function", "unregister", "(", ")", "{", "if", "(", "$", "this", "->", "isRegistered", ")", "{", "$", "this", "->", "system", "->", "restoreExceptionHandler", "(", ")", ";", "$", "this", "->", "system", "->", "restoreErrorHandler", "(", ")", ";...
Unregisters all handlers registered by this Whoops\Run instance @return Run
[ "Unregisters", "all", "handlers", "registered", "by", "this", "Whoops", "\\", "Run", "instance" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Run.php#L135-L145
train
filp/whoops
src/Whoops/Run.php
Run.allowQuit
public function allowQuit($exit = null) { if (func_num_args() == 0) { return $this->allowQuit; } return $this->allowQuit = (bool) $exit; }
php
public function allowQuit($exit = null) { if (func_num_args() == 0) { return $this->allowQuit; } return $this->allowQuit = (bool) $exit; }
[ "public", "function", "allowQuit", "(", "$", "exit", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "allowQuit", ";", "}", "return", "$", "this", "->", "allowQuit", "=", "(", "bool", "...
Should Whoops allow Handlers to force the script to quit? @param bool|int $exit @return bool
[ "Should", "Whoops", "allow", "Handlers", "to", "force", "the", "script", "to", "quit?" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Run.php#L152-L159
train
filp/whoops
src/Whoops/Run.php
Run.silenceErrorsInPaths
public function silenceErrorsInPaths($patterns, $levels = 10240) { $this->silencedPatterns = array_merge( $this->silencedPatterns, array_map( function ($pattern) use ($levels) { return [ "pattern" => $pattern, ...
php
public function silenceErrorsInPaths($patterns, $levels = 10240) { $this->silencedPatterns = array_merge( $this->silencedPatterns, array_map( function ($pattern) use ($levels) { return [ "pattern" => $pattern, ...
[ "public", "function", "silenceErrorsInPaths", "(", "$", "patterns", ",", "$", "levels", "=", "10240", ")", "{", "$", "this", "->", "silencedPatterns", "=", "array_merge", "(", "$", "this", "->", "silencedPatterns", ",", "array_map", "(", "function", "(", "$"...
Silence particular errors in particular files @param array|string $patterns List or a single regex pattern to match @param int $levels Defaults to E_STRICT | E_DEPRECATED @return \Whoops\Run
[ "Silence", "particular", "errors", "in", "particular", "files" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Run.php#L167-L182
train
filp/whoops
src/Whoops/Run.php
Run.writeToOutput
public function writeToOutput($send = null) { if (func_num_args() == 0) { return $this->sendOutput; } return $this->sendOutput = (bool) $send; }
php
public function writeToOutput($send = null) { if (func_num_args() == 0) { return $this->sendOutput; } return $this->sendOutput = (bool) $send; }
[ "public", "function", "writeToOutput", "(", "$", "send", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "sendOutput", ";", "}", "return", "$", "this", "->", "sendOutput", "=", "(", "bool...
Should Whoops push output directly to the client? If this is false, output will be returned by handleException @param bool|int $send @return bool
[ "Should", "Whoops", "push", "output", "directly", "to", "the", "client?", "If", "this", "is", "false", "output", "will", "be", "returned", "by", "handleException" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Run.php#L232-L239
train
filp/whoops
src/Whoops/Util/Misc.php
Misc.translateErrorCode
public static function translateErrorCode($error_code) { $constants = get_defined_constants(true); if (array_key_exists('Core', $constants)) { foreach ($constants['Core'] as $constant => $value) { if (substr($constant, 0, 2) == 'E_' && $value == $error_code) { ...
php
public static function translateErrorCode($error_code) { $constants = get_defined_constants(true); if (array_key_exists('Core', $constants)) { foreach ($constants['Core'] as $constant => $value) { if (substr($constant, 0, 2) == 'E_' && $value == $error_code) { ...
[ "public", "static", "function", "translateErrorCode", "(", "$", "error_code", ")", "{", "$", "constants", "=", "get_defined_constants", "(", "true", ")", ";", "if", "(", "array_key_exists", "(", "'Core'", ",", "$", "constants", ")", ")", "{", "foreach", "(",...
Translate ErrorException code into the represented constant. @param int $error_code @return string
[ "Translate", "ErrorException", "code", "into", "the", "represented", "constant", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Util/Misc.php#L48-L59
train
filp/whoops
src/Whoops/Exception/Inspector.php
Inspector.getPreviousExceptionInspector
public function getPreviousExceptionInspector() { if ($this->previousExceptionInspector === null) { $previousException = $this->exception->getPrevious(); if ($previousException) { $this->previousExceptionInspector = new Inspector($previousException); } ...
php
public function getPreviousExceptionInspector() { if ($this->previousExceptionInspector === null) { $previousException = $this->exception->getPrevious(); if ($previousException) { $this->previousExceptionInspector = new Inspector($previousException); } ...
[ "public", "function", "getPreviousExceptionInspector", "(", ")", "{", "if", "(", "$", "this", "->", "previousExceptionInspector", "===", "null", ")", "{", "$", "previousException", "=", "$", "this", "->", "exception", "->", "getPrevious", "(", ")", ";", "if", ...
Returns an Inspector for a previous Exception, if any. @todo Clean this up a bit, cache stuff a bit better. @return Inspector
[ "Returns", "an", "Inspector", "for", "a", "previous", "Exception", "if", "any", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Inspector.php#L134-L145
train
filp/whoops
src/Whoops/Exception/Inspector.php
Inspector.getPreviousExceptions
public function getPreviousExceptions() { if ($this->previousExceptions === null) { $this->previousExceptions = []; $prev = $this->exception->getPrevious(); while ($prev !== null) { $this->previousExceptions[] = $prev; $prev = $prev->getPr...
php
public function getPreviousExceptions() { if ($this->previousExceptions === null) { $this->previousExceptions = []; $prev = $this->exception->getPrevious(); while ($prev !== null) { $this->previousExceptions[] = $prev; $prev = $prev->getPr...
[ "public", "function", "getPreviousExceptions", "(", ")", "{", "if", "(", "$", "this", "->", "previousExceptions", "===", "null", ")", "{", "$", "this", "->", "previousExceptions", "=", "[", "]", ";", "$", "prev", "=", "$", "this", "->", "exception", "->"...
Returns an array of all previous exceptions for this inspector's exception @return \Throwable[]
[ "Returns", "an", "array", "of", "all", "previous", "exceptions", "for", "this", "inspector", "s", "exception" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Inspector.php#L152-L165
train
filp/whoops
src/Whoops/Exception/Inspector.php
Inspector.getTrace
protected function getTrace($e) { $traces = $e->getTrace(); // Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default if (!$e instanceof \ErrorException) { return $traces; } if (!Misc::isLevelFatal($e->getSeverity())) ...
php
protected function getTrace($e) { $traces = $e->getTrace(); // Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default if (!$e instanceof \ErrorException) { return $traces; } if (!Misc::isLevelFatal($e->getSeverity())) ...
[ "protected", "function", "getTrace", "(", "$", "e", ")", "{", "$", "traces", "=", "$", "e", "->", "getTrace", "(", ")", ";", "// Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default", "if", "(", "!", "$", "e", "instanceof"...
Gets the backtrace from an exception. If xdebug is installed @param \Throwable $e @return array
[ "Gets", "the", "backtrace", "from", "an", "exception", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Inspector.php#L241-L264
train
filp/whoops
src/Whoops/Handler/PrettyPageHandler.php
PrettyPageHandler.getExceptionFrames
protected function getExceptionFrames() { $frames = $this->getInspector()->getFrames(); if ($this->getApplicationPaths()) { foreach ($frames as $frame) { foreach ($this->getApplicationPaths() as $path) { if (strpos($frame->getFile(), $path) === 0) { ...
php
protected function getExceptionFrames() { $frames = $this->getInspector()->getFrames(); if ($this->getApplicationPaths()) { foreach ($frames as $frame) { foreach ($this->getApplicationPaths() as $path) { if (strpos($frame->getFile(), $path) === 0) { ...
[ "protected", "function", "getExceptionFrames", "(", ")", "{", "$", "frames", "=", "$", "this", "->", "getInspector", "(", ")", "->", "getFrames", "(", ")", ";", "if", "(", "$", "this", "->", "getApplicationPaths", "(", ")", ")", "{", "foreach", "(", "$...
Get the stack trace frames of the exception that is currently being handled. @return \Whoops\Exception\FrameCollection;
[ "Get", "the", "stack", "trace", "frames", "of", "the", "exception", "that", "is", "currently", "being", "handled", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PrettyPageHandler.php#L263-L279
train
filp/whoops
src/Whoops/Handler/PrettyPageHandler.php
PrettyPageHandler.getExceptionCode
protected function getExceptionCode() { $exception = $this->getException(); $code = $exception->getCode(); if ($exception instanceof \ErrorException) { // ErrorExceptions wrap the php-error types within the 'severity' property $code = Misc::translateErrorCode($except...
php
protected function getExceptionCode() { $exception = $this->getException(); $code = $exception->getCode(); if ($exception instanceof \ErrorException) { // ErrorExceptions wrap the php-error types within the 'severity' property $code = Misc::translateErrorCode($except...
[ "protected", "function", "getExceptionCode", "(", ")", "{", "$", "exception", "=", "$", "this", "->", "getException", "(", ")", ";", "$", "code", "=", "$", "exception", "->", "getCode", "(", ")", ";", "if", "(", "$", "exception", "instanceof", "\\", "E...
Get the code of the exception that is currently being handled. @return string
[ "Get", "the", "code", "of", "the", "exception", "that", "is", "currently", "being", "handled", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PrettyPageHandler.php#L286-L297
train
filp/whoops
src/Whoops/Handler/PrettyPageHandler.php
PrettyPageHandler.handleUnconditionally
public function handleUnconditionally($value = null) { if (func_num_args() == 0) { return $this->handleUnconditionally; } $this->handleUnconditionally = (bool) $value; }
php
public function handleUnconditionally($value = null) { if (func_num_args() == 0) { return $this->handleUnconditionally; } $this->handleUnconditionally = (bool) $value; }
[ "public", "function", "handleUnconditionally", "(", "$", "value", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "handleUnconditionally", ";", "}", "$", "this", "->", "handleUnconditionally", ...
Allows to disable all attempts to dynamically decide whether to handle or return prematurely. Set this to ensure that the handler will perform no matter what. @param bool|null $value @return bool|null
[ "Allows", "to", "disable", "all", "attempts", "to", "dynamically", "decide", "whether", "to", "handle", "or", "return", "prematurely", ".", "Set", "this", "to", "ensure", "that", "the", "handler", "will", "perform", "no", "matter", "what", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PrettyPageHandler.php#L372-L379
train
filp/whoops
src/Whoops/Handler/PrettyPageHandler.php
PrettyPageHandler.getEditorHref
public function getEditorHref($filePath, $line) { $editor = $this->getEditor($filePath, $line); if (empty($editor)) { return false; } // Check that the editor is a string, and replace the // %line and %file placeholders: if (!isset($editor['url']) || !is...
php
public function getEditorHref($filePath, $line) { $editor = $this->getEditor($filePath, $line); if (empty($editor)) { return false; } // Check that the editor is a string, and replace the // %line and %file placeholders: if (!isset($editor['url']) || !is...
[ "public", "function", "getEditorHref", "(", "$", "filePath", ",", "$", "line", ")", "{", "$", "editor", "=", "$", "this", "->", "getEditor", "(", "$", "filePath", ",", "$", "line", ")", ";", "if", "(", "empty", "(", "$", "editor", ")", ")", "{", ...
Given a string file path, and an integer file line, executes the editor resolver and returns, if available, a string that may be used as the href property for that file reference. @throws InvalidArgumentException If editor resolver does not return a string @param string $filePath @param int ...
[ "Given", "a", "string", "file", "path", "and", "an", "integer", "file", "line", "executes", "the", "editor", "resolver", "and", "returns", "if", "available", "a", "string", "that", "may", "be", "used", "as", "the", "href", "property", "for", "that", "file"...
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PrettyPageHandler.php#L439-L459
train
filp/whoops
src/Whoops/Handler/PrettyPageHandler.php
PrettyPageHandler.getResource
protected function getResource($resource) { // If the resource was found before, we can speed things up // by caching its absolute, resolved path: if (isset($this->resourceCache[$resource])) { return $this->resourceCache[$resource]; } // Search through available ...
php
protected function getResource($resource) { // If the resource was found before, we can speed things up // by caching its absolute, resolved path: if (isset($this->resourceCache[$resource])) { return $this->resourceCache[$resource]; } // Search through available ...
[ "protected", "function", "getResource", "(", "$", "resource", ")", "{", "// If the resource was found before, we can speed things up", "// by caching its absolute, resolved path:", "if", "(", "isset", "(", "$", "this", "->", "resourceCache", "[", "$", "resource", "]", ")"...
Finds a resource, by its relative path, in all available search paths. The search is performed starting at the last search path, and all the way back to the first, enabling a cascading-type system of overrides for all resources. @throws RuntimeException If resource cannot be found in any of the available paths @param...
[ "Finds", "a", "resource", "by", "its", "relative", "path", "in", "all", "available", "search", "paths", ".", "The", "search", "is", "performed", "starting", "at", "the", "last", "search", "path", "and", "all", "the", "way", "back", "to", "the", "first", ...
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PrettyPageHandler.php#L600-L625
train
filp/whoops
src/Whoops/Handler/PlainTextHandler.php
PlainTextHandler.setLogger
public function setLogger($logger = null) { if (! (is_null($logger) || $logger instanceof LoggerInterface)) { throw new InvalidArgumentException( 'Argument to ' . __METHOD__ . " must be a valid Logger Interface (aka. Monolog), " . get_c...
php
public function setLogger($logger = null) { if (! (is_null($logger) || $logger instanceof LoggerInterface)) { throw new InvalidArgumentException( 'Argument to ' . __METHOD__ . " must be a valid Logger Interface (aka. Monolog), " . get_c...
[ "public", "function", "setLogger", "(", "$", "logger", "=", "null", ")", "{", "if", "(", "!", "(", "is_null", "(", "$", "logger", ")", "||", "$", "logger", "instanceof", "LoggerInterface", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "...
Set the output logger interface. @throws InvalidArgumentException If argument is not null or a LoggerInterface @param \Psr\Log\LoggerInterface|null $logger
[ "Set", "the", "output", "logger", "interface", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PlainTextHandler.php#L69-L81
train
filp/whoops
src/Whoops/Handler/PlainTextHandler.php
PlainTextHandler.addTraceToOutput
public function addTraceToOutput($addTraceToOutput = null) { if (func_num_args() == 0) { return $this->addTraceToOutput; } $this->addTraceToOutput = (bool) $addTraceToOutput; return $this; }
php
public function addTraceToOutput($addTraceToOutput = null) { if (func_num_args() == 0) { return $this->addTraceToOutput; } $this->addTraceToOutput = (bool) $addTraceToOutput; return $this; }
[ "public", "function", "addTraceToOutput", "(", "$", "addTraceToOutput", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "addTraceToOutput", ";", "}", "$", "this", "->", "addTraceToOutput", "=",...
Add error trace to output. @param bool|null $addTraceToOutput @return bool|$this
[ "Add", "error", "trace", "to", "output", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PlainTextHandler.php#L107-L115
train
filp/whoops
src/Whoops/Handler/PlainTextHandler.php
PlainTextHandler.addTraceFunctionArgsToOutput
public function addTraceFunctionArgsToOutput($addTraceFunctionArgsToOutput = null) { if (func_num_args() == 0) { return $this->addTraceFunctionArgsToOutput; } if (! is_integer($addTraceFunctionArgsToOutput)) { $this->addTraceFunctionArgsToOutput = (bool) $addTraceFun...
php
public function addTraceFunctionArgsToOutput($addTraceFunctionArgsToOutput = null) { if (func_num_args() == 0) { return $this->addTraceFunctionArgsToOutput; } if (! is_integer($addTraceFunctionArgsToOutput)) { $this->addTraceFunctionArgsToOutput = (bool) $addTraceFun...
[ "public", "function", "addTraceFunctionArgsToOutput", "(", "$", "addTraceFunctionArgsToOutput", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "addTraceFunctionArgsToOutput", ";", "}", "if", "(", ...
Add error trace function arguments to output. Set to True for all frame args, or integer for the n first frame args. @param bool|integer|null $addTraceFunctionArgsToOutput @return null|bool|integer
[ "Add", "error", "trace", "function", "arguments", "to", "output", ".", "Set", "to", "True", "for", "all", "frame", "args", "or", "integer", "for", "the", "n", "first", "frame", "args", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PlainTextHandler.php#L123-L134
train
filp/whoops
src/Whoops/Handler/PlainTextHandler.php
PlainTextHandler.generateResponse
public function generateResponse() { $exception = $this->getException(); return sprintf( "%s: %s in file %s on line %d%s\n", get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine(), $this->g...
php
public function generateResponse() { $exception = $this->getException(); return sprintf( "%s: %s in file %s on line %d%s\n", get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine(), $this->g...
[ "public", "function", "generateResponse", "(", ")", "{", "$", "exception", "=", "$", "this", "->", "getException", "(", ")", ";", "return", "sprintf", "(", "\"%s: %s in file %s on line %d%s\\n\"", ",", "get_class", "(", "$", "exception", ")", ",", "$", "except...
Create plain text response and return it as a string @return string
[ "Create", "plain", "text", "response", "and", "return", "it", "as", "a", "string" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PlainTextHandler.php#L151-L162
train
filp/whoops
src/Whoops/Handler/PlainTextHandler.php
PlainTextHandler.loggerOnly
public function loggerOnly($loggerOnly = null) { if (func_num_args() == 0) { return $this->loggerOnly; } $this->loggerOnly = (bool) $loggerOnly; }
php
public function loggerOnly($loggerOnly = null) { if (func_num_args() == 0) { return $this->loggerOnly; } $this->loggerOnly = (bool) $loggerOnly; }
[ "public", "function", "loggerOnly", "(", "$", "loggerOnly", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "==", "0", ")", "{", "return", "$", "this", "->", "loggerOnly", ";", "}", "$", "this", "->", "loggerOnly", "=", "(", "bool", ")",...
Only output to logger. @param bool|null $loggerOnly @return null|bool
[ "Only", "output", "to", "logger", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PlainTextHandler.php#L180-L187
train
filp/whoops
src/Whoops/Handler/PlainTextHandler.php
PlainTextHandler.getTraceOutput
private function getTraceOutput() { if (! $this->addTraceToOutput()) { return ''; } $inspector = $this->getInspector(); $frames = $inspector->getFrames(); $response = "\nStack trace:"; $line = 1; foreach ($frames as $frame) { /** @var...
php
private function getTraceOutput() { if (! $this->addTraceToOutput()) { return ''; } $inspector = $this->getInspector(); $frames = $inspector->getFrames(); $response = "\nStack trace:"; $line = 1; foreach ($frames as $frame) { /** @var...
[ "private", "function", "getTraceOutput", "(", ")", "{", "if", "(", "!", "$", "this", "->", "addTraceToOutput", "(", ")", ")", "{", "return", "''", ";", "}", "$", "inspector", "=", "$", "this", "->", "getInspector", "(", ")", ";", "$", "frames", "=", ...
Get the exception trace as plain text. @return string
[ "Get", "the", "exception", "trace", "as", "plain", "text", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Handler/PlainTextHandler.php#L250-L285
train
filp/whoops
src/Whoops/Exception/FrameCollection.php
FrameCollection.map
public function map($callable) { // Contain the map within a higher-order callable // that enforces type-correctness for the $callable $this->frames = array_map(function ($frame) use ($callable) { $frame = call_user_func($callable, $frame); if (!$frame instanceof Fra...
php
public function map($callable) { // Contain the map within a higher-order callable // that enforces type-correctness for the $callable $this->frames = array_map(function ($frame) use ($callable) { $frame = call_user_func($callable, $frame); if (!$frame instanceof Fra...
[ "public", "function", "map", "(", "$", "callable", ")", "{", "// Contain the map within a higher-order callable", "// that enforces type-correctness for the $callable", "$", "this", "->", "frames", "=", "array_map", "(", "function", "(", "$", "frame", ")", "use", "(", ...
Map the collection of frames @param callable $callable @return FrameCollection
[ "Map", "the", "collection", "of", "frames" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/FrameCollection.php#L55-L72
train
filp/whoops
src/Whoops/Exception/FrameCollection.php
FrameCollection.topDiff
public function topDiff(FrameCollection $parentFrames) { $diff = $this->frames; $parentFrames = $parentFrames->getArray(); $p = count($parentFrames)-1; for ($i = count($diff)-1; $i >= 0 && $p >= 0; $i--) { /** @var Frame $tailFrame */ $tailFrame = $diff[$i];...
php
public function topDiff(FrameCollection $parentFrames) { $diff = $this->frames; $parentFrames = $parentFrames->getArray(); $p = count($parentFrames)-1; for ($i = count($diff)-1; $i >= 0 && $p >= 0; $i--) { /** @var Frame $tailFrame */ $tailFrame = $diff[$i];...
[ "public", "function", "topDiff", "(", "FrameCollection", "$", "parentFrames", ")", "{", "$", "diff", "=", "$", "this", "->", "frames", ";", "$", "parentFrames", "=", "$", "parentFrames", "->", "getArray", "(", ")", ";", "$", "p", "=", "count", "(", "$"...
Gets the innermost part of stack trace that is not the same as that of outer exception @param FrameCollection $parentFrames Outer exception frames to compare tail against @return Frame[]
[ "Gets", "the", "innermost", "part", "of", "stack", "trace", "that", "is", "not", "the", "same", "as", "that", "of", "outer", "exception" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/FrameCollection.php#L186-L202
train
filp/whoops
src/Whoops/Exception/Frame.php
Frame.getComments
public function getComments($filter = null) { $comments = $this->comments; if ($filter !== null) { $comments = array_filter($comments, function ($c) use ($filter) { return $c['context'] == $filter; }); } return $comments; }
php
public function getComments($filter = null) { $comments = $this->comments; if ($filter !== null) { $comments = array_filter($comments, function ($c) use ($filter) { return $c['context'] == $filter; }); } return $comments; }
[ "public", "function", "getComments", "(", "$", "filter", "=", "null", ")", "{", "$", "comments", "=", "$", "this", "->", "comments", ";", "if", "(", "$", "filter", "!==", "null", ")", "{", "$", "comments", "=", "array_filter", "(", "$", "comments", "...
Returns all comments for this frame. Optionally allows a filter to only retrieve comments from a specific context. @param string $filter @return array[]
[ "Returns", "all", "comments", "for", "this", "frame", ".", "Optionally", "allows", "a", "filter", "to", "only", "retrieve", "comments", "from", "a", "specific", "context", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Frame.php#L155-L166
train
filp/whoops
src/Whoops/Exception/Frame.php
Frame.getFileLines
public function getFileLines($start = 0, $length = null) { if (null !== ($contents = $this->getFileContents())) { $lines = explode("\n", $contents); // Get a subset of lines from $start to $end if ($length !== null) { $start = (int) $start; ...
php
public function getFileLines($start = 0, $length = null) { if (null !== ($contents = $this->getFileContents())) { $lines = explode("\n", $contents); // Get a subset of lines from $start to $end if ($length !== null) { $start = (int) $start; ...
[ "public", "function", "getFileLines", "(", "$", "start", "=", "0", ",", "$", "length", "=", "null", ")", "{", "if", "(", "null", "!==", "(", "$", "contents", "=", "$", "this", "->", "getFileContents", "(", ")", ")", ")", "{", "$", "lines", "=", "...
Returns the contents of the file for this frame as an array of lines, and optionally as a clamped range of lines. NOTE: lines are 0-indexed @example Get all lines for this file $frame->getFileLines(); // => array( 0 => '<?php', 1 => '...', ...) @example Get one line for this file, starting at line 10 (zero-indexed, r...
[ "Returns", "the", "contents", "of", "the", "file", "for", "this", "frame", "as", "an", "array", "of", "lines", "and", "optionally", "as", "a", "clamped", "range", "of", "lines", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Frame.php#L197-L221
train
filp/whoops
src/Whoops/Exception/Frame.php
Frame.serialize
public function serialize() { $frame = $this->frame; if (!empty($this->comments)) { $frame['_comments'] = $this->comments; } return serialize($frame); }
php
public function serialize() { $frame = $this->frame; if (!empty($this->comments)) { $frame['_comments'] = $this->comments; } return serialize($frame); }
[ "public", "function", "serialize", "(", ")", "{", "$", "frame", "=", "$", "this", "->", "frame", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "comments", ")", ")", "{", "$", "frame", "[", "'_comments'", "]", "=", "$", "this", "->", "comm...
Implements the Serializable interface, with special steps to also save the existing comments. @see Serializable::serialize @return string
[ "Implements", "the", "Serializable", "interface", "with", "special", "steps", "to", "also", "save", "the", "existing", "comments", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Frame.php#L230-L238
train
filp/whoops
src/Whoops/Exception/Frame.php
Frame.unserialize
public function unserialize($serializedFrame) { $frame = unserialize($serializedFrame); if (!empty($frame['_comments'])) { $this->comments = $frame['_comments']; unset($frame['_comments']); } $this->frame = $frame; }
php
public function unserialize($serializedFrame) { $frame = unserialize($serializedFrame); if (!empty($frame['_comments'])) { $this->comments = $frame['_comments']; unset($frame['_comments']); } $this->frame = $frame; }
[ "public", "function", "unserialize", "(", "$", "serializedFrame", ")", "{", "$", "frame", "=", "unserialize", "(", "$", "serializedFrame", ")", ";", "if", "(", "!", "empty", "(", "$", "frame", "[", "'_comments'", "]", ")", ")", "{", "$", "this", "->", ...
Unserializes the frame data, while also preserving any existing comment data. @see Serializable::unserialize @param string $serializedFrame
[ "Unserializes", "the", "frame", "data", "while", "also", "preserving", "any", "existing", "comment", "data", "." ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Frame.php#L247-L257
train
filp/whoops
src/Whoops/Exception/Frame.php
Frame.equals
public function equals(Frame $frame) { if (!$this->getFile() || $this->getFile() === 'Unknown' || !$this->getLine()) { return false; } return $frame->getFile() === $this->getFile() && $frame->getLine() === $this->getLine(); }
php
public function equals(Frame $frame) { if (!$this->getFile() || $this->getFile() === 'Unknown' || !$this->getLine()) { return false; } return $frame->getFile() === $this->getFile() && $frame->getLine() === $this->getLine(); }
[ "public", "function", "equals", "(", "Frame", "$", "frame", ")", "{", "if", "(", "!", "$", "this", "->", "getFile", "(", ")", "||", "$", "this", "->", "getFile", "(", ")", "===", "'Unknown'", "||", "!", "$", "this", "->", "getLine", "(", ")", ")"...
Compares Frame against one another @param Frame $frame @return bool
[ "Compares", "Frame", "against", "one", "another" ]
2583ec09af009d02d20d3d14591359c6c48ae960
https://github.com/filp/whoops/blob/2583ec09af009d02d20d3d14591359c6c48ae960/src/Whoops/Exception/Frame.php#L264-L270
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
SQLServerSchemaManager.getColumnConstraintSQL
private function getColumnConstraintSQL($table, $column) { return "SELECT SysObjects.[Name] FROM SysObjects INNER JOIN (SELECT [Name],[ID] FROM SysObjects WHERE XType = 'U') AS Tab ON Tab.[ID] = Sysobjects.[Parent_Obj] INNER JOIN sys.default_constraints DefCons ON DefCons...
php
private function getColumnConstraintSQL($table, $column) { return "SELECT SysObjects.[Name] FROM SysObjects INNER JOIN (SELECT [Name],[ID] FROM SysObjects WHERE XType = 'U') AS Tab ON Tab.[ID] = Sysobjects.[Parent_Obj] INNER JOIN sys.default_constraints DefCons ON DefCons...
[ "private", "function", "getColumnConstraintSQL", "(", "$", "table", ",", "$", "column", ")", "{", "return", "\"SELECT SysObjects.[Name]\n FROM SysObjects INNER JOIN (SELECT [Name],[ID] FROM SysObjects WHERE XType = 'U') AS Tab\n ON Tab.[ID] = Sysobjects.[Parent_Obj]\n ...
Returns the SQL to retrieve the constraints for a given column. @param string $table @param string $column @return string
[ "Returns", "the", "SQL", "to", "retrieve", "the", "constraints", "for", "a", "given", "column", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php#L297-L306
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
SQLServerSchemaManager.closeActiveDatabaseConnections
private function closeActiveDatabaseConnections($database) { $database = new Identifier($database); $this->_execSql( sprintf( 'ALTER DATABASE %s SET SINGLE_USER WITH ROLLBACK IMMEDIATE', $database->getQuotedName($this->_platform) ) ); ...
php
private function closeActiveDatabaseConnections($database) { $database = new Identifier($database); $this->_execSql( sprintf( 'ALTER DATABASE %s SET SINGLE_USER WITH ROLLBACK IMMEDIATE', $database->getQuotedName($this->_platform) ) ); ...
[ "private", "function", "closeActiveDatabaseConnections", "(", "$", "database", ")", "{", "$", "database", "=", "new", "Identifier", "(", "$", "database", ")", ";", "$", "this", "->", "_execSql", "(", "sprintf", "(", "'ALTER DATABASE %s SET SINGLE_USER WITH ROLLBACK ...
Closes currently active connections on the given database. This is useful to force DROP DATABASE operations which could fail because of active connections. @param string $database The name of the database to close currently active connections for. @return void
[ "Closes", "currently", "active", "connections", "on", "the", "given", "database", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php#L317-L327
train
doctrine/dbal
lib/Doctrine/DBAL/Query/QueryBuilder.php
QueryBuilder.getSQL
public function getSQL() { if ($this->sql !== null && $this->state === self::STATE_CLEAN) { return $this->sql; } switch ($this->type) { case self::INSERT: $sql = $this->getSQLForInsert(); break; case self::DELETE: ...
php
public function getSQL() { if ($this->sql !== null && $this->state === self::STATE_CLEAN) { return $this->sql; } switch ($this->type) { case self::INSERT: $sql = $this->getSQLForInsert(); break; case self::DELETE: ...
[ "public", "function", "getSQL", "(", ")", "{", "if", "(", "$", "this", "->", "sql", "!==", "null", "&&", "$", "this", "->", "state", "===", "self", "::", "STATE_CLEAN", ")", "{", "return", "$", "this", "->", "sql", ";", "}", "switch", "(", "$", "...
Gets the complete SQL string formed by the current specifications of this QueryBuilder. <code> $qb = $em->createQueryBuilder() ->select('u') ->from('User', 'u') echo $qb->getSQL(); // SELECT u FROM User u </code> @return string The SQL query string.
[ "Gets", "the", "complete", "SQL", "string", "formed", "by", "the", "current", "specifications", "of", "this", "QueryBuilder", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/QueryBuilder.php#L218-L246
train
doctrine/dbal
lib/Doctrine/DBAL/Query/QueryBuilder.php
QueryBuilder.setParameter
public function setParameter($key, $value, $type = null) { if ($type !== null) { $this->paramTypes[$key] = $type; } $this->params[$key] = $value; return $this; }
php
public function setParameter($key, $value, $type = null) { if ($type !== null) { $this->paramTypes[$key] = $type; } $this->params[$key] = $value; return $this; }
[ "public", "function", "setParameter", "(", "$", "key", ",", "$", "value", ",", "$", "type", "=", "null", ")", "{", "if", "(", "$", "type", "!==", "null", ")", "{", "$", "this", "->", "paramTypes", "[", "$", "key", "]", "=", "$", "type", ";", "}...
Sets a query parameter for the query being constructed. <code> $qb = $conn->createQueryBuilder() ->select('u') ->from('users', 'u') ->where('u.id = :user_id') ->setParameter(':user_id', 1); </code> @param string|int $key The parameter position or name. @param mixed $value The parameter value. @param ...
[ "Sets", "a", "query", "parameter", "for", "the", "query", "being", "constructed", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/QueryBuilder.php#L265-L274
train
doctrine/dbal
lib/Doctrine/DBAL/Query/QueryBuilder.php
QueryBuilder.setParameters
public function setParameters(array $params, array $types = []) { $this->paramTypes = $types; $this->params = $params; return $this; }
php
public function setParameters(array $params, array $types = []) { $this->paramTypes = $types; $this->params = $params; return $this; }
[ "public", "function", "setParameters", "(", "array", "$", "params", ",", "array", "$", "types", "=", "[", "]", ")", "{", "$", "this", "->", "paramTypes", "=", "$", "types", ";", "$", "this", "->", "params", "=", "$", "params", ";", "return", "$", "...
Sets a collection of query parameters for the query being constructed. <code> $qb = $conn->createQueryBuilder() ->select('u') ->from('users', 'u') ->where('u.id = :user_id1 OR u.id = :user_id2') ->setParameters(array( ':user_id1' => 1, ':user_id2' => 2 )); </code> @param mixed[] $params The query parameters to...
[ "Sets", "a", "collection", "of", "query", "parameters", "for", "the", "query", "being", "constructed", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/QueryBuilder.php#L295-L301
train
doctrine/dbal
lib/Doctrine/DBAL/Query/QueryBuilder.php
QueryBuilder.groupBy
public function groupBy($groupBy) { if (empty($groupBy)) { return $this; } $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); return $this->add('groupBy', $groupBy, false); }
php
public function groupBy($groupBy) { if (empty($groupBy)) { return $this; } $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); return $this->add('groupBy', $groupBy, false); }
[ "public", "function", "groupBy", "(", "$", "groupBy", ")", "{", "if", "(", "empty", "(", "$", "groupBy", ")", ")", "{", "return", "$", "this", ";", "}", "$", "groupBy", "=", "is_array", "(", "$", "groupBy", ")", "?", "$", "groupBy", ":", "func_get_...
Specifies a grouping over the results of the query. Replaces any previously specified groupings, if any. <code> $qb = $conn->createQueryBuilder() ->select('u.name') ->from('users', 'u') ->groupBy('u.id'); </code> @param mixed $groupBy The grouping expression. @return $this This QueryBuilder instance.
[ "Specifies", "a", "grouping", "over", "the", "results", "of", "the", "query", ".", "Replaces", "any", "previously", "specified", "groupings", "if", "any", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/QueryBuilder.php#L858-L867
train
doctrine/dbal
lib/Doctrine/DBAL/Query/QueryBuilder.php
QueryBuilder.getSQLForInsert
private function getSQLForInsert() { return 'INSERT INTO ' . $this->sqlParts['from']['table'] . ' (' . implode(', ', array_keys($this->sqlParts['values'])) . ')' . ' VALUES(' . implode(', ', $this->sqlParts['values']) . ')'; }
php
private function getSQLForInsert() { return 'INSERT INTO ' . $this->sqlParts['from']['table'] . ' (' . implode(', ', array_keys($this->sqlParts['values'])) . ')' . ' VALUES(' . implode(', ', $this->sqlParts['values']) . ')'; }
[ "private", "function", "getSQLForInsert", "(", ")", "{", "return", "'INSERT INTO '", ".", "$", "this", "->", "sqlParts", "[", "'from'", "]", "[", "'table'", "]", ".", "' ('", ".", "implode", "(", "', '", ",", "array_keys", "(", "$", "this", "->", "sqlPar...
Converts this instance into an INSERT string in SQL. @return string
[ "Converts", "this", "instance", "into", "an", "INSERT", "string", "in", "SQL", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/QueryBuilder.php#L1175-L1180
train
doctrine/dbal
lib/Doctrine/DBAL/Query/QueryBuilder.php
QueryBuilder.createPositionalParameter
public function createPositionalParameter($value, $type = ParameterType::STRING) { $this->boundCounter++; $this->setParameter($this->boundCounter, $value, $type); return '?'; }
php
public function createPositionalParameter($value, $type = ParameterType::STRING) { $this->boundCounter++; $this->setParameter($this->boundCounter, $value, $type); return '?'; }
[ "public", "function", "createPositionalParameter", "(", "$", "value", ",", "$", "type", "=", "ParameterType", "::", "STRING", ")", "{", "$", "this", "->", "boundCounter", "++", ";", "$", "this", "->", "setParameter", "(", "$", "this", "->", "boundCounter", ...
Creates a new positional parameter and bind the given value to it. Attention: If you are using positional parameters with the query builder you have to be very careful to bind all parameters in the order they appear in the SQL statement , otherwise they get bound in the wrong order which can lead to serious bugs in yo...
[ "Creates", "a", "new", "positional", "parameter", "and", "bind", "the", "given", "value", "to", "it", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Query/QueryBuilder.php#L1280-L1286
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
Driver._constructPdoDsn
protected function _constructPdoDsn(array $params) { $dsn = 'sqlite:'; if (isset($params['path'])) { $dsn .= $params['path']; } elseif (isset($params['memory'])) { $dsn .= ':memory:'; } return $dsn; }
php
protected function _constructPdoDsn(array $params) { $dsn = 'sqlite:'; if (isset($params['path'])) { $dsn .= $params['path']; } elseif (isset($params['memory'])) { $dsn .= ':memory:'; } return $dsn; }
[ "protected", "function", "_constructPdoDsn", "(", "array", "$", "params", ")", "{", "$", "dsn", "=", "'sqlite:'", ";", "if", "(", "isset", "(", "$", "params", "[", "'path'", "]", ")", ")", "{", "$", "dsn", ".=", "$", "params", "[", "'path'", "]", "...
Constructs the Sqlite PDO DSN. @param mixed[] $params @return string The DSN.
[ "Constructs", "the", "Sqlite", "PDO", "DSN", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php#L62-L72
train
doctrine/dbal
lib/Doctrine/DBAL/SQLParserUtils.php
SQLParserUtils.getPlaceholderPositions
public static function getPlaceholderPositions($statement, $isPositional = true) { return $isPositional ? self::getPositionalPlaceholderPositions($statement) : self::getNamedPlaceholderPositions($statement); }
php
public static function getPlaceholderPositions($statement, $isPositional = true) { return $isPositional ? self::getPositionalPlaceholderPositions($statement) : self::getNamedPlaceholderPositions($statement); }
[ "public", "static", "function", "getPlaceholderPositions", "(", "$", "statement", ",", "$", "isPositional", "=", "true", ")", "{", "return", "$", "isPositional", "?", "self", "::", "getPositionalPlaceholderPositions", "(", "$", "statement", ")", ":", "self", "::...
Gets an array of the placeholders in an sql statements as keys and their positions in the query string. For a statement with positional parameters, returns a zero-indexed list of placeholder position. For a statement with named parameters, returns a map of placeholder positions to their parameter names. @deprecated W...
[ "Gets", "an", "array", "of", "the", "placeholders", "in", "an", "sql", "statements", "as", "keys", "and", "their", "positions", "in", "the", "query", "string", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/SQLParserUtils.php#L54-L59
train
doctrine/dbal
lib/Doctrine/DBAL/SQLParserUtils.php
SQLParserUtils.getPositionalPlaceholderPositions
private static function getPositionalPlaceholderPositions(string $statement) : array { return self::collectPlaceholders( $statement, '?', self::POSITIONAL_TOKEN, static function (string $_, int $placeholderPosition, int $fragmentPosition, array &$carry) : void...
php
private static function getPositionalPlaceholderPositions(string $statement) : array { return self::collectPlaceholders( $statement, '?', self::POSITIONAL_TOKEN, static function (string $_, int $placeholderPosition, int $fragmentPosition, array &$carry) : void...
[ "private", "static", "function", "getPositionalPlaceholderPositions", "(", "string", "$", "statement", ")", ":", "array", "{", "return", "self", "::", "collectPlaceholders", "(", "$", "statement", ",", "'?'", ",", "self", "::", "POSITIONAL_TOKEN", ",", "static", ...
Returns a zero-indexed list of placeholder position. @return int[]
[ "Returns", "a", "zero", "-", "indexed", "list", "of", "placeholder", "position", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/SQLParserUtils.php#L66-L76
train
doctrine/dbal
lib/Doctrine/DBAL/SQLParserUtils.php
SQLParserUtils.getNamedPlaceholderPositions
private static function getNamedPlaceholderPositions(string $statement) : array { return self::collectPlaceholders( $statement, ':', self::NAMED_TOKEN, static function (string $placeholder, int $placeholderPosition, int $fragmentPosition, array &$carry) : void...
php
private static function getNamedPlaceholderPositions(string $statement) : array { return self::collectPlaceholders( $statement, ':', self::NAMED_TOKEN, static function (string $placeholder, int $placeholderPosition, int $fragmentPosition, array &$carry) : void...
[ "private", "static", "function", "getNamedPlaceholderPositions", "(", "string", "$", "statement", ")", ":", "array", "{", "return", "self", "::", "collectPlaceholders", "(", "$", "statement", ",", "':'", ",", "self", "::", "NAMED_TOKEN", ",", "static", "function...
Returns a map of placeholder positions to their parameter names. @return string[]
[ "Returns", "a", "map", "of", "placeholder", "positions", "to", "their", "parameter", "names", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/SQLParserUtils.php#L83-L93
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
PostgreSqlPlatform.isUnchangedBinaryColumn
private function isUnchangedBinaryColumn(ColumnDiff $columnDiff) { $columnType = $columnDiff->column->getType(); if (! $columnType instanceof BinaryType && ! $columnType instanceof BlobType) { return false; } $fromColumn = $columnDiff->fromColumn instanceof Column ? $co...
php
private function isUnchangedBinaryColumn(ColumnDiff $columnDiff) { $columnType = $columnDiff->column->getType(); if (! $columnType instanceof BinaryType && ! $columnType instanceof BlobType) { return false; } $fromColumn = $columnDiff->fromColumn instanceof Column ? $co...
[ "private", "function", "isUnchangedBinaryColumn", "(", "ColumnDiff", "$", "columnDiff", ")", "{", "$", "columnType", "=", "$", "columnDiff", "->", "column", "->", "getType", "(", ")", ";", "if", "(", "!", "$", "columnType", "instanceof", "BinaryType", "&&", ...
Checks whether a given column diff is a logically unchanged binary type column. Used to determine whether a column alteration for a binary type column can be skipped. Doctrine's {@link \Doctrine\DBAL\Types\BinaryType} and {@link \Doctrine\DBAL\Types\BlobType} are mapped to the same database column type on this platfor...
[ "Checks", "whether", "a", "given", "column", "diff", "is", "a", "logically", "unchanged", "binary", "type", "column", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php#L651-L676
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
PostgreSqlPlatform.convertSingleBooleanValue
private function convertSingleBooleanValue($value, $callback) { if ($value === null) { return $callback(null); } if (is_bool($value) || is_numeric($value)) { return $callback((bool) $value); } if (! is_string($value)) { return $callback(t...
php
private function convertSingleBooleanValue($value, $callback) { if ($value === null) { return $callback(null); } if (is_bool($value) || is_numeric($value)) { return $callback((bool) $value); } if (! is_string($value)) { return $callback(t...
[ "private", "function", "convertSingleBooleanValue", "(", "$", "value", ",", "$", "callback", ")", "{", "if", "(", "$", "value", "===", "null", ")", "{", "return", "$", "callback", "(", "null", ")", ";", "}", "if", "(", "is_bool", "(", "$", "value", "...
Converts a single boolean value. First converts the value to its native PHP boolean type and passes it to the given callback function to be reconverted into any custom representation. @param mixed $value The value to convert. @param callable $callback The callback function to use for converting the real boolean...
[ "Converts", "a", "single", "boolean", "value", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php#L817-L843
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
PostgreSqlPlatform.doConvertBooleans
private function doConvertBooleans($item, $callback) { if (is_array($item)) { foreach ($item as $key => $value) { $item[$key] = $this->convertSingleBooleanValue($value, $callback); } return $item; } return $this->convertSingleBooleanValue...
php
private function doConvertBooleans($item, $callback) { if (is_array($item)) { foreach ($item as $key => $value) { $item[$key] = $this->convertSingleBooleanValue($value, $callback); } return $item; } return $this->convertSingleBooleanValue...
[ "private", "function", "doConvertBooleans", "(", "$", "item", ",", "$", "callback", ")", "{", "if", "(", "is_array", "(", "$", "item", ")", ")", "{", "foreach", "(", "$", "item", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "item", "[", "...
Converts one or multiple boolean values. First converts the value(s) to their native PHP boolean type and passes them to the given callback function to be reconverted into any custom representation. @param mixed $item The value(s) to convert. @param callable $callback The callback function to use for convertin...
[ "Converts", "one", "or", "multiple", "boolean", "values", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php#L857-L868
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
PostgreSqlPlatform.typeChangeBreaksDefaultValue
private function typeChangeBreaksDefaultValue(ColumnDiff $columnDiff) : bool { if (! $columnDiff->fromColumn) { return $columnDiff->hasChanged('type'); } $oldTypeIsNumeric = $this->isNumericType($columnDiff->fromColumn->getType()); $newTypeIsNumeric = $this->isNumericTyp...
php
private function typeChangeBreaksDefaultValue(ColumnDiff $columnDiff) : bool { if (! $columnDiff->fromColumn) { return $columnDiff->hasChanged('type'); } $oldTypeIsNumeric = $this->isNumericType($columnDiff->fromColumn->getType()); $newTypeIsNumeric = $this->isNumericTyp...
[ "private", "function", "typeChangeBreaksDefaultValue", "(", "ColumnDiff", "$", "columnDiff", ")", ":", "bool", "{", "if", "(", "!", "$", "columnDiff", "->", "fromColumn", ")", "{", "return", "$", "columnDiff", "->", "hasChanged", "(", "'type'", ")", ";", "}"...
Check whether the type of a column is changed in a way that invalidates the default value for the column
[ "Check", "whether", "the", "type", "of", "a", "column", "is", "changed", "in", "a", "way", "that", "invalidates", "the", "default", "value", "for", "the", "column" ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php#L1232-L1244
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
OCI8Statement.findPlaceholderOrOpeningQuote
private static function findPlaceholderOrOpeningQuote( $statement, &$tokenOffset, &$fragmentOffset, &$fragments, &$currentLiteralDelimiter, &$paramMap ) { $token = self::findToken($statement, $tokenOffset, '/[?\'"]/'); if (! $token) { retu...
php
private static function findPlaceholderOrOpeningQuote( $statement, &$tokenOffset, &$fragmentOffset, &$fragments, &$currentLiteralDelimiter, &$paramMap ) { $token = self::findToken($statement, $tokenOffset, '/[?\'"]/'); if (! $token) { retu...
[ "private", "static", "function", "findPlaceholderOrOpeningQuote", "(", "$", "statement", ",", "&", "$", "tokenOffset", ",", "&", "$", "fragmentOffset", ",", "&", "$", "fragments", ",", "&", "$", "currentLiteralDelimiter", ",", "&", "$", "paramMap", ")", "{", ...
Finds next placeholder or opening quote. @param string $statement The SQL statement to parse @param string $tokenOffset The offset to start searching from @param int $fragmentOffset The offset to build the next fragment from @param string[] ...
[ "Finds", "next", "placeholder", "or", "opening", "quote", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php#L181-L211
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
OCI8Statement.findClosingQuote
private static function findClosingQuote( $statement, &$tokenOffset, &$currentLiteralDelimiter ) { $token = self::findToken( $statement, $tokenOffset, '/' . preg_quote($currentLiteralDelimiter, '/') . '/' ); if (! $token) { ...
php
private static function findClosingQuote( $statement, &$tokenOffset, &$currentLiteralDelimiter ) { $token = self::findToken( $statement, $tokenOffset, '/' . preg_quote($currentLiteralDelimiter, '/') . '/' ); if (! $token) { ...
[ "private", "static", "function", "findClosingQuote", "(", "$", "statement", ",", "&", "$", "tokenOffset", ",", "&", "$", "currentLiteralDelimiter", ")", "{", "$", "token", "=", "self", "::", "findToken", "(", "$", "statement", ",", "$", "tokenOffset", ",", ...
Finds closing quote @param string $statement The SQL statement to parse @param string $tokenOffset The offset to start searching from @param string $currentLiteralDelimiter The delimiter of the current string literal @return bool Whether the token was found
[ "Finds", "closing", "quote" ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php#L222-L241
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
OCI8Statement.findToken
private static function findToken($statement, &$offset, $regex) { if (preg_match($regex, $statement, $matches, PREG_OFFSET_CAPTURE, $offset)) { $offset = $matches[0][1]; return $matches[0][0]; } return null; }
php
private static function findToken($statement, &$offset, $regex) { if (preg_match($regex, $statement, $matches, PREG_OFFSET_CAPTURE, $offset)) { $offset = $matches[0][1]; return $matches[0][0]; } return null; }
[ "private", "static", "function", "findToken", "(", "$", "statement", ",", "&", "$", "offset", ",", "$", "regex", ")", "{", "if", "(", "preg_match", "(", "$", "regex", ",", "$", "statement", ",", "$", "matches", ",", "PREG_OFFSET_CAPTURE", ",", "$", "of...
Finds the token described by regex starting from the given offset. Updates the offset with the position where the token was found. @param string $statement The SQL statement to parse @param int $offset The offset to start searching from @param string $regex The regex containing token pattern @return string|...
[ "Finds", "the", "token", "described", "by", "regex", "starting", "from", "the", "given", "offset", ".", "Updates", "the", "offset", "with", "the", "position", "where", "the", "token", "was", "found", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php#L253-L262
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
OCI8Statement.convertParameterType
private function convertParameterType(int $type) : int { switch ($type) { case ParameterType::BINARY: return OCI_B_BIN; case ParameterType::LARGE_OBJECT: return OCI_B_BLOB; default: return SQLT_CHR; } }
php
private function convertParameterType(int $type) : int { switch ($type) { case ParameterType::BINARY: return OCI_B_BIN; case ParameterType::LARGE_OBJECT: return OCI_B_BLOB; default: return SQLT_CHR; } }
[ "private", "function", "convertParameterType", "(", "int", "$", "type", ")", ":", "int", "{", "switch", "(", "$", "type", ")", "{", "case", "ParameterType", "::", "BINARY", ":", "return", "OCI_B_BIN", ";", "case", "ParameterType", "::", "LARGE_OBJECT", ":", ...
Converts DBAL parameter type to oci8 parameter type
[ "Converts", "DBAL", "parameter", "type", "to", "oci8", "parameter", "type" ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php#L304-L316
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
ForeignKeyConstraint.getQuotedLocalColumns
public function getQuotedLocalColumns(AbstractPlatform $platform) { $columns = []; foreach ($this->_localColumnNames as $column) { $columns[] = $column->getQuotedName($platform); } return $columns; }
php
public function getQuotedLocalColumns(AbstractPlatform $platform) { $columns = []; foreach ($this->_localColumnNames as $column) { $columns[] = $column->getQuotedName($platform); } return $columns; }
[ "public", "function", "getQuotedLocalColumns", "(", "AbstractPlatform", "$", "platform", ")", "{", "$", "columns", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_localColumnNames", "as", "$", "column", ")", "{", "$", "columns", "[", "]", "=", "...
Returns the quoted representation of the referencing table column names the foreign key constraint is associated with. But only if they were defined with one or the referencing table column name is a keyword reserved by the platform. Otherwise the plain unquoted value as inserted is returned. @param AbstractPlatform ...
[ "Returns", "the", "quoted", "representation", "of", "the", "referencing", "table", "column", "names", "the", "foreign", "key", "constraint", "is", "associated", "with", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php#L154-L163
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
ForeignKeyConstraint.getUnqualifiedForeignTableName
public function getUnqualifiedForeignTableName() { $name = $this->_foreignTableName->getName(); $position = strrpos($name, '.'); if ($position !== false) { $name = substr($name, $position); } return strtolower($name); }
php
public function getUnqualifiedForeignTableName() { $name = $this->_foreignTableName->getName(); $position = strrpos($name, '.'); if ($position !== false) { $name = substr($name, $position); } return strtolower($name); }
[ "public", "function", "getUnqualifiedForeignTableName", "(", ")", "{", "$", "name", "=", "$", "this", "->", "_foreignTableName", "->", "getName", "(", ")", ";", "$", "position", "=", "strrpos", "(", "$", "name", ",", "'.'", ")", ";", "if", "(", "$", "p...
Returns the non-schema qualified foreign table name. @return string
[ "Returns", "the", "non", "-", "schema", "qualified", "foreign", "table", "name", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php#L230-L240
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
ForeignKeyConstraint.getQuotedForeignColumns
public function getQuotedForeignColumns(AbstractPlatform $platform) { $columns = []; foreach ($this->_foreignColumnNames as $column) { $columns[] = $column->getQuotedName($platform); } return $columns; }
php
public function getQuotedForeignColumns(AbstractPlatform $platform) { $columns = []; foreach ($this->_foreignColumnNames as $column) { $columns[] = $column->getQuotedName($platform); } return $columns; }
[ "public", "function", "getQuotedForeignColumns", "(", "AbstractPlatform", "$", "platform", ")", "{", "$", "columns", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_foreignColumnNames", "as", "$", "column", ")", "{", "$", "columns", "[", "]", "=",...
Returns the quoted representation of the referenced table column names the foreign key constraint is associated with. But only if they were defined with one or the referenced table column name is a keyword reserved by the platform. Otherwise the plain unquoted value as inserted is returned. @param AbstractPlatform $p...
[ "Returns", "the", "quoted", "representation", "of", "the", "referenced", "table", "column", "names", "the", "foreign", "key", "constraint", "is", "associated", "with", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php#L282-L291
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
ForeignKeyConstraint.onEvent
private function onEvent($event) { if (isset($this->_options[$event])) { $onEvent = strtoupper($this->_options[$event]); if (! in_array($onEvent, ['NO ACTION', 'RESTRICT'])) { return $onEvent; } } return false; }
php
private function onEvent($event) { if (isset($this->_options[$event])) { $onEvent = strtoupper($this->_options[$event]); if (! in_array($onEvent, ['NO ACTION', 'RESTRICT'])) { return $onEvent; } } return false; }
[ "private", "function", "onEvent", "(", "$", "event", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_options", "[", "$", "event", "]", ")", ")", "{", "$", "onEvent", "=", "strtoupper", "(", "$", "this", "->", "_options", "[", "$", "event", ...
Returns the referential action for a given database operation on the referenced table the foreign key constraint is associated with. @param string $event Name of the database operation/event to return the referential action for. @return string|null
[ "Returns", "the", "referential", "action", "for", "a", "given", "database", "operation", "on", "the", "referenced", "table", "the", "foreign", "key", "constraint", "is", "associated", "with", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php#L358-L369
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
ForeignKeyConstraint.intersectsIndexColumns
public function intersectsIndexColumns(Index $index) { foreach ($index->getColumns() as $indexColumn) { foreach ($this->_localColumnNames as $localColumn) { if (strtolower($indexColumn) === strtolower($localColumn->getName())) { return true; } ...
php
public function intersectsIndexColumns(Index $index) { foreach ($index->getColumns() as $indexColumn) { foreach ($this->_localColumnNames as $localColumn) { if (strtolower($indexColumn) === strtolower($localColumn->getName())) { return true; } ...
[ "public", "function", "intersectsIndexColumns", "(", "Index", "$", "index", ")", "{", "foreach", "(", "$", "index", "->", "getColumns", "(", ")", "as", "$", "indexColumn", ")", "{", "foreach", "(", "$", "this", "->", "_localColumnNames", "as", "$", "localC...
Checks whether this foreign key constraint intersects the given index columns. Returns `true` if at least one of this foreign key's local columns matches one of the given index's columns, `false` otherwise. @param Index $index The index to be checked against. @return bool
[ "Checks", "whether", "this", "foreign", "key", "constraint", "intersects", "the", "given", "index", "columns", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php#L381-L392
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php
SQLAnywhereSchemaManager.startDatabase
public function startDatabase($database) { assert($this->_platform instanceof SQLAnywherePlatform); $this->_execSql($this->_platform->getStartDatabaseSQL($database)); }
php
public function startDatabase($database) { assert($this->_platform instanceof SQLAnywherePlatform); $this->_execSql($this->_platform->getStartDatabaseSQL($database)); }
[ "public", "function", "startDatabase", "(", "$", "database", ")", "{", "assert", "(", "$", "this", "->", "_platform", "instanceof", "SQLAnywherePlatform", ")", ";", "$", "this", "->", "_execSql", "(", "$", "this", "->", "_platform", "->", "getStartDatabaseSQL"...
Starts a database. @param string $database The name of the database to start.
[ "Starts", "a", "database", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php#L51-L55
train
doctrine/dbal
lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php
SQLAnywhereSchemaManager.stopDatabase
public function stopDatabase($database) { assert($this->_platform instanceof SQLAnywherePlatform); $this->_execSql($this->_platform->getStopDatabaseSQL($database)); }
php
public function stopDatabase($database) { assert($this->_platform instanceof SQLAnywherePlatform); $this->_execSql($this->_platform->getStopDatabaseSQL($database)); }
[ "public", "function", "stopDatabase", "(", "$", "database", ")", "{", "assert", "(", "$", "this", "->", "_platform", "instanceof", "SQLAnywherePlatform", ")", ";", "$", "this", "->", "_execSql", "(", "$", "this", "->", "_platform", "->", "getStopDatabaseSQL", ...
Stops a database. @param string $database The name of the database to stop.
[ "Stops", "a", "database", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php#L62-L66
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
Driver.constructPdoDsn
private function constructPdoDsn(array $params) { $dsn = 'oci:dbname=' . $this->getEasyConnectString($params); if (isset($params['charset'])) { $dsn .= ';charset=' . $params['charset']; } return $dsn; }
php
private function constructPdoDsn(array $params) { $dsn = 'oci:dbname=' . $this->getEasyConnectString($params); if (isset($params['charset'])) { $dsn .= ';charset=' . $params['charset']; } return $dsn; }
[ "private", "function", "constructPdoDsn", "(", "array", "$", "params", ")", "{", "$", "dsn", "=", "'oci:dbname='", ".", "$", "this", "->", "getEasyConnectString", "(", "$", "params", ")", ";", "if", "(", "isset", "(", "$", "params", "[", "'charset'", "]"...
Constructs the Oracle PDO DSN. @param mixed[] $params @return string The DSN.
[ "Constructs", "the", "Oracle", "PDO", "DSN", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php#L44-L53
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
AbstractMySQLDriver.getOracleMysqlVersionNumber
private function getOracleMysqlVersionNumber(string $versionString) : string { if (! preg_match( '/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $versionString, $versionParts )) { throw DBALException::invalidPlatformVersionSpecified( ...
php
private function getOracleMysqlVersionNumber(string $versionString) : string { if (! preg_match( '/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $versionString, $versionParts )) { throw DBALException::invalidPlatformVersionSpecified( ...
[ "private", "function", "getOracleMysqlVersionNumber", "(", "string", "$", "versionString", ")", ":", "string", "{", "if", "(", "!", "preg_match", "(", "'/^(?P<major>\\d+)(?:\\.(?P<minor>\\d+)(?:\\.(?P<patch>\\d+))?)?/'", ",", "$", "versionString", ",", "$", "versionParts"...
Get a normalized 'version number' from the server string returned by Oracle MySQL servers. @param string $versionString Version string returned by the driver, i.e. '5.7.10' @throws DBALException
[ "Get", "a", "normalized", "version", "number", "from", "the", "server", "string", "returned", "by", "Oracle", "MySQL", "servers", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php#L142-L163
train
doctrine/dbal
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
AbstractMySQLDriver.getMariaDbMysqlVersionNumber
private function getMariaDbMysqlVersionNumber(string $versionString) : string { if (! preg_match( '/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i', $versionString, $versionParts )) { throw DBALException::invalidPlatformVersi...
php
private function getMariaDbMysqlVersionNumber(string $versionString) : string { if (! preg_match( '/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i', $versionString, $versionParts )) { throw DBALException::invalidPlatformVersi...
[ "private", "function", "getMariaDbMysqlVersionNumber", "(", "string", "$", "versionString", ")", ":", "string", "{", "if", "(", "!", "preg_match", "(", "'/^(?:5\\.5\\.5-)?(mariadb-)?(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)/i'", ",", "$", "versionString", ",", "$"...
Detect MariaDB server version, including hack for some mariadb distributions that starts with the prefix '5.5.5-' @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial' @throws DBALException
[ "Detect", "MariaDB", "server", "version", "including", "hack", "for", "some", "mariadb", "distributions", "that", "starts", "with", "the", "prefix", "5", ".", "5", ".", "5", "-" ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php#L173-L187
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
SqlitePlatform.getNonAutoincrementPrimaryKeyDefinition
private function getNonAutoincrementPrimaryKeyDefinition(array $columns, array $options) : string { if (empty($options['primary'])) { return ''; } $keyColumns = array_unique(array_values($options['primary'])); foreach ($keyColumns as $keyColumn) { if (! empt...
php
private function getNonAutoincrementPrimaryKeyDefinition(array $columns, array $options) : string { if (empty($options['primary'])) { return ''; } $keyColumns = array_unique(array_values($options['primary'])); foreach ($keyColumns as $keyColumn) { if (! empt...
[ "private", "function", "getNonAutoincrementPrimaryKeyDefinition", "(", "array", "$", "columns", ",", "array", "$", "options", ")", ":", "string", "{", "if", "(", "empty", "(", "$", "options", "[", "'primary'", "]", ")", ")", "{", "return", "''", ";", "}", ...
Generate a PRIMARY KEY definition if no autoincrement value is used @param mixed[][] $columns @param mixed[] $options
[ "Generate", "a", "PRIMARY", "KEY", "definition", "if", "no", "autoincrement", "value", "is", "used" ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php#L362-L377
train
doctrine/dbal
lib/Doctrine/DBAL/Statement.php
Statement.bindValue
public function bindValue($name, $value, $type = ParameterType::STRING) { $this->params[$name] = $value; $this->types[$name] = $type; if ($type !== null) { if (is_string($type)) { $type = Type::getType($type); } if ($type instanceof Type) ...
php
public function bindValue($name, $value, $type = ParameterType::STRING) { $this->params[$name] = $value; $this->types[$name] = $type; if ($type !== null) { if (is_string($type)) { $type = Type::getType($type); } if ($type instanceof Type) ...
[ "public", "function", "bindValue", "(", "$", "name", ",", "$", "value", ",", "$", "type", "=", "ParameterType", "::", "STRING", ")", "{", "$", "this", "->", "params", "[", "$", "name", "]", "=", "$", "value", ";", "$", "this", "->", "types", "[", ...
Binds a parameter value to the statement. The value can optionally be bound with a PDO binding type or a DBAL mapping type. If bound with a DBAL mapping type, the binding type is derived from the mapping type and the value undergoes the conversion routines of the mapping type before being bound. @param string|int $na...
[ "Binds", "a", "parameter", "value", "to", "the", "statement", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Statement.php#L90-L109
train
doctrine/dbal
lib/Doctrine/DBAL/Statement.php
Statement.bindParam
public function bindParam($name, &$var, $type = ParameterType::STRING, $length = null) { $this->params[$name] = $var; $this->types[$name] = $type; return $this->stmt->bindParam($name, $var, $type, $length); }
php
public function bindParam($name, &$var, $type = ParameterType::STRING, $length = null) { $this->params[$name] = $var; $this->types[$name] = $type; return $this->stmt->bindParam($name, $var, $type, $length); }
[ "public", "function", "bindParam", "(", "$", "name", ",", "&", "$", "var", ",", "$", "type", "=", "ParameterType", "::", "STRING", ",", "$", "length", "=", "null", ")", "{", "$", "this", "->", "params", "[", "$", "name", "]", "=", "$", "var", ";"...
Binds a parameter to a value by reference. Binding a parameter by reference does not support DBAL mapping types. @param string|int $name The name or position of the parameter. @param mixed $var The reference to the variable to bind. @param int $type The PDO binding type. @param int|null $length M...
[ "Binds", "a", "parameter", "to", "a", "value", "by", "reference", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Statement.php#L124-L130
train
doctrine/dbal
lib/Doctrine/DBAL/Statement.php
Statement.execute
public function execute($params = null) { if (is_array($params)) { $this->params = $params; } $logger = $this->conn->getConfiguration()->getSQLLogger(); if ($logger) { $logger->startQuery($this->sql, $this->params, $this->types); } try { ...
php
public function execute($params = null) { if (is_array($params)) { $this->params = $params; } $logger = $this->conn->getConfiguration()->getSQLLogger(); if ($logger) { $logger->startQuery($this->sql, $this->params, $this->types); } try { ...
[ "public", "function", "execute", "(", "$", "params", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "params", ")", ")", "{", "$", "this", "->", "params", "=", "$", "params", ";", "}", "$", "logger", "=", "$", "this", "->", "conn", "->", ...
Executes the statement with the currently bound parameters. @param mixed[]|null $params @return bool TRUE on success, FALSE on failure. @throws DBALException
[ "Executes", "the", "statement", "with", "the", "currently", "bound", "parameters", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Statement.php#L141-L173
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getAlterTableAddColumnClause
protected function getAlterTableAddColumnClause(Column $column) { return 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); }
php
protected function getAlterTableAddColumnClause(Column $column) { return 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); }
[ "protected", "function", "getAlterTableAddColumnClause", "(", "Column", "$", "column", ")", "{", "return", "'ADD '", ".", "$", "this", "->", "getColumnDeclarationSQL", "(", "$", "column", "->", "getQuotedName", "(", "$", "this", ")", ",", "$", "column", "->", ...
Returns the SQL clause for creating a column in a table alteration. @param Column $column The column to add. @return string
[ "Returns", "the", "SQL", "clause", "for", "creating", "a", "column", "in", "a", "table", "alteration", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L211-L214
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getAlterTableRenameColumnClause
protected function getAlterTableRenameColumnClause($oldColumnName, Column $column) { $oldColumnName = new Identifier($oldColumnName); return 'RENAME ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this); }
php
protected function getAlterTableRenameColumnClause($oldColumnName, Column $column) { $oldColumnName = new Identifier($oldColumnName); return 'RENAME ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this); }
[ "protected", "function", "getAlterTableRenameColumnClause", "(", "$", "oldColumnName", ",", "Column", "$", "column", ")", "{", "$", "oldColumnName", "=", "new", "Identifier", "(", "$", "oldColumnName", ")", ";", "return", "'RENAME '", ".", "$", "oldColumnName", ...
Returns the SQL clause for renaming a column in a table alteration. @param string $oldColumnName The quoted name of the column to rename. @param Column $column The column to rename to. @return string
[ "Returns", "the", "SQL", "clause", "for", "renaming", "a", "column", "in", "a", "table", "alteration", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L248-L253
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getAlterTableChangeColumnClause
protected function getAlterTableChangeColumnClause(ColumnDiff $columnDiff) { $column = $columnDiff->column; // Do not return alter clause if only comment has changed. if (! ($columnDiff->hasChanged('comment') && count($columnDiff->changedProperties) === 1)) { $columnAlterationCl...
php
protected function getAlterTableChangeColumnClause(ColumnDiff $columnDiff) { $column = $columnDiff->column; // Do not return alter clause if only comment has changed. if (! ($columnDiff->hasChanged('comment') && count($columnDiff->changedProperties) === 1)) { $columnAlterationCl...
[ "protected", "function", "getAlterTableChangeColumnClause", "(", "ColumnDiff", "$", "columnDiff", ")", "{", "$", "column", "=", "$", "columnDiff", "->", "column", ";", "// Do not return alter clause if only comment has changed.", "if", "(", "!", "(", "$", "columnDiff", ...
Returns the SQL clause for altering a column in a table alteration. This method returns null in case that only the column comment has changed. Changes in column comments have to be handled differently. @param ColumnDiff $columnDiff The diff of the column to alter. @return string|null
[ "Returns", "the", "SQL", "clause", "for", "altering", "a", "column", "in", "a", "table", "alteration", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L277-L294
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getForeignKeyMatchClauseSQL
public function getForeignKeyMatchClauseSQL($type) { switch ((int) $type) { case self::FOREIGN_KEY_MATCH_SIMPLE: return 'SIMPLE'; break; case self::FOREIGN_KEY_MATCH_FULL: return 'FULL'; break; case self::F...
php
public function getForeignKeyMatchClauseSQL($type) { switch ((int) $type) { case self::FOREIGN_KEY_MATCH_SIMPLE: return 'SIMPLE'; break; case self::FOREIGN_KEY_MATCH_FULL: return 'FULL'; break; case self::F...
[ "public", "function", "getForeignKeyMatchClauseSQL", "(", "$", "type", ")", "{", "switch", "(", "(", "int", ")", "$", "type", ")", "{", "case", "self", "::", "FOREIGN_KEY_MATCH_SIMPLE", ":", "return", "'SIMPLE'", ";", "break", ";", "case", "self", "::", "F...
Returns foreign key MATCH clause for given type. @param int $type The foreign key match type @return string @throws InvalidArgumentException If unknown match type given.
[ "Returns", "foreign", "key", "MATCH", "clause", "for", "given", "type", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L625-L645
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getPrimaryKeyDeclarationSQL
public function getPrimaryKeyDeclarationSQL(Index $index, $name = null) { if (! $index->isPrimary()) { throw new InvalidArgumentException( 'Can only create primary key declarations with getPrimaryKeyDeclarationSQL()' ); } return $this->getTableConstra...
php
public function getPrimaryKeyDeclarationSQL(Index $index, $name = null) { if (! $index->isPrimary()) { throw new InvalidArgumentException( 'Can only create primary key declarations with getPrimaryKeyDeclarationSQL()' ); } return $this->getTableConstra...
[ "public", "function", "getPrimaryKeyDeclarationSQL", "(", "Index", "$", "index", ",", "$", "name", "=", "null", ")", "{", "if", "(", "!", "$", "index", "->", "isPrimary", "(", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Can only create ...
Obtain DBMS specific SQL code portion needed to set a primary key declaration to be used in statements like ALTER TABLE. @param Index $index Index definition @param string $name Name of the primary key @return string DBMS specific SQL code portion needed to set a primary key @throws InvalidArgumentException If the...
[ "Obtain", "DBMS", "specific", "SQL", "code", "portion", "needed", "to", "set", "a", "primary", "key", "declaration", "to", "be", "used", "in", "statements", "like", "ALTER", "TABLE", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L1020-L1029
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getAdvancedIndexOptionsSQL
protected function getAdvancedIndexOptionsSQL(Index $index) { $sql = ''; if (! $index->isPrimary() && $index->hasFlag('for_olap_workload')) { $sql .= ' FOR OLAP WORKLOAD'; } return $sql; }
php
protected function getAdvancedIndexOptionsSQL(Index $index) { $sql = ''; if (! $index->isPrimary() && $index->hasFlag('for_olap_workload')) { $sql .= ' FOR OLAP WORKLOAD'; } return $sql; }
[ "protected", "function", "getAdvancedIndexOptionsSQL", "(", "Index", "$", "index", ")", "{", "$", "sql", "=", "''", ";", "if", "(", "!", "$", "index", "->", "isPrimary", "(", ")", "&&", "$", "index", "->", "hasFlag", "(", "'for_olap_workload'", ")", ")",...
Return the INDEX query section dealing with non-standard SQL Anywhere options. @param Index $index Index definition @return string
[ "Return", "the", "INDEX", "query", "section", "dealing", "with", "non", "-", "standard", "SQL", "Anywhere", "options", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L1346-L1355
train
doctrine/dbal
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
SQLAnywherePlatform.getTableConstraintDeclarationSQL
protected function getTableConstraintDeclarationSQL(Constraint $constraint, $name = null) { if ($constraint instanceof ForeignKeyConstraint) { return $this->getForeignKeyDeclarationSQL($constraint); } if (! $constraint instanceof Index) { throw new InvalidArgumentExc...
php
protected function getTableConstraintDeclarationSQL(Constraint $constraint, $name = null) { if ($constraint instanceof ForeignKeyConstraint) { return $this->getForeignKeyDeclarationSQL($constraint); } if (! $constraint instanceof Index) { throw new InvalidArgumentExc...
[ "protected", "function", "getTableConstraintDeclarationSQL", "(", "Constraint", "$", "constraint", ",", "$", "name", "=", "null", ")", "{", "if", "(", "$", "constraint", "instanceof", "ForeignKeyConstraint", ")", "{", "return", "$", "this", "->", "getForeignKeyDec...
Returns the SQL snippet for creating a table constraint. @param Constraint $constraint The table constraint to create the SQL snippet for. @param string|null $name The table constraint name to use if any. @return string @throws InvalidArgumentException If the given table constraint type is not supported by th...
[ "Returns", "the", "SQL", "snippet", "for", "creating", "a", "table", "constraint", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php#L1377-L1417
train
doctrine/dbal
lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php
SQLAzureShardManager.splitFederation
public function splitFederation($splitDistributionValue) { $type = Type::getType($this->distributionType); $sql = 'ALTER FEDERATION ' . $this->getFederationName() . ' ' . 'SPLIT AT (' . $this->getDistributionKey() . ' = ' . $this->conn->quote($splitDistributionValue, $...
php
public function splitFederation($splitDistributionValue) { $type = Type::getType($this->distributionType); $sql = 'ALTER FEDERATION ' . $this->getFederationName() . ' ' . 'SPLIT AT (' . $this->getDistributionKey() . ' = ' . $this->conn->quote($splitDistributionValue, $...
[ "public", "function", "splitFederation", "(", "$", "splitDistributionValue", ")", "{", "$", "type", "=", "Type", "::", "getType", "(", "$", "this", "->", "distributionType", ")", ";", "$", "sql", "=", "'ALTER FEDERATION '", ".", "$", "this", "->", "getFedera...
Splits Federation at a given distribution value. @param mixed $splitDistributionValue @return void
[ "Splits", "Federation", "at", "a", "given", "distribution", "value", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php#L199-L207
train
doctrine/dbal
lib/Doctrine/DBAL/Version.php
Version.compare
public static function compare($version) { $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); $version = str_replace(' ', '', $version); return version_compare($version, $currentVersion); }
php
public static function compare($version) { $currentVersion = str_replace(' ', '', strtolower(self::VERSION)); $version = str_replace(' ', '', $version); return version_compare($version, $currentVersion); }
[ "public", "static", "function", "compare", "(", "$", "version", ")", "{", "$", "currentVersion", "=", "str_replace", "(", "' '", ",", "''", ",", "strtolower", "(", "self", "::", "VERSION", ")", ")", ";", "$", "version", "=", "str_replace", "(", "' '", ...
Compares a Doctrine version with the current one. @param string $version The Doctrine version to compare to. @return int -1 if older, 0 if it is the same, 1 if version passed as argument is newer.
[ "Compares", "a", "Doctrine", "version", "with", "the", "current", "one", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Version.php#L26-L32
train
doctrine/dbal
lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php
PoolingShardConnection.connect
public function connect($shardId = null) { if ($shardId === null && $this->_conn) { return false; } if ($shardId !== null && $shardId === $this->activeShardId) { return false; } if ($this->getTransactionNestingLevel() > 0) { throw new Sha...
php
public function connect($shardId = null) { if ($shardId === null && $this->_conn) { return false; } if ($shardId !== null && $shardId === $this->activeShardId) { return false; } if ($this->getTransactionNestingLevel() > 0) { throw new Sha...
[ "public", "function", "connect", "(", "$", "shardId", "=", "null", ")", "{", "if", "(", "$", "shardId", "===", "null", "&&", "$", "this", "->", "_conn", ")", "{", "return", "false", ";", "}", "if", "(", "$", "shardId", "!==", "null", "&&", "$", "...
Connects to a given shard. @param string|int|null $shardId @return bool @throws ShardingException
[ "Connects", "to", "a", "given", "shard", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php#L173-L203
train
doctrine/dbal
lib/Doctrine/DBAL/Connection.php
Connection.connect
public function connect() { if ($this->isConnected) { return false; } $driverOptions = $this->params['driverOptions'] ?? []; $user = $this->params['user'] ?? null; $password = $this->params['password'] ?? null; $this->_conn = $this->_...
php
public function connect() { if ($this->isConnected) { return false; } $driverOptions = $this->params['driverOptions'] ?? []; $user = $this->params['user'] ?? null; $password = $this->params['password'] ?? null; $this->_conn = $this->_...
[ "public", "function", "connect", "(", ")", "{", "if", "(", "$", "this", "->", "isConnected", ")", "{", "return", "false", ";", "}", "$", "driverOptions", "=", "$", "this", "->", "params", "[", "'driverOptions'", "]", "??", "[", "]", ";", "$", "user",...
Establishes the connection with the database. @return bool TRUE if the connection was successfully established, FALSE if the connection is already open.
[ "Establishes", "the", "connection", "with", "the", "database", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L344-L367
train
doctrine/dbal
lib/Doctrine/DBAL/Connection.php
Connection.detectDatabasePlatform
private function detectDatabasePlatform() { $version = $this->getDatabasePlatformVersion(); if ($version !== null) { assert($this->_driver instanceof VersionAwarePlatformDriver); $this->platform = $this->_driver->createDatabasePlatformForVersion($version); } else { ...
php
private function detectDatabasePlatform() { $version = $this->getDatabasePlatformVersion(); if ($version !== null) { assert($this->_driver instanceof VersionAwarePlatformDriver); $this->platform = $this->_driver->createDatabasePlatformForVersion($version); } else { ...
[ "private", "function", "detectDatabasePlatform", "(", ")", "{", "$", "version", "=", "$", "this", "->", "getDatabasePlatformVersion", "(", ")", ";", "if", "(", "$", "version", "!==", "null", ")", "{", "assert", "(", "$", "this", "->", "_driver", "instanceo...
Detects and sets the database platform. Evaluates custom platform class and version in order to set the correct platform. @throws DBALException If an invalid platform was specified for this connection.
[ "Detects", "and", "sets", "the", "database", "platform", "." ]
e4978c2299d4d8e4f39da94f4d567e698e9bdbeb
https://github.com/doctrine/dbal/blob/e4978c2299d4d8e4f39da94f4d567e698e9bdbeb/lib/Doctrine/DBAL/Connection.php#L376-L389
train