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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
spatie/laravel-medialibrary | src/HasMedia/HasMediaTrait.php | HasMediaTrait.clearMediaCollection | public function clearMediaCollection(string $collectionName = 'default'): self
{
$this->getMedia($collectionName)
->each->delete();
event(new CollectionHasBeenCleared($this, $collectionName));
if ($this->mediaIsPreloaded()) {
unset($this->media);
}
... | php | public function clearMediaCollection(string $collectionName = 'default'): self
{
$this->getMedia($collectionName)
->each->delete();
event(new CollectionHasBeenCleared($this, $collectionName));
if ($this->mediaIsPreloaded()) {
unset($this->media);
}
... | [
"public",
"function",
"clearMediaCollection",
"(",
"string",
"$",
"collectionName",
"=",
"'default'",
")",
":",
"self",
"{",
"$",
"this",
"->",
"getMedia",
"(",
"$",
"collectionName",
")",
"->",
"each",
"->",
"delete",
"(",
")",
";",
"event",
"(",
"new",
... | Remove all media in the given collection.
@param string $collectionName
@return $this | [
"Remove",
"all",
"media",
"in",
"the",
"given",
"collection",
"."
] | 6ffb8a41e60f024abd35ff47e08628354d6efd0e | https://github.com/spatie/laravel-medialibrary/blob/6ffb8a41e60f024abd35ff47e08628354d6efd0e/src/HasMedia/HasMediaTrait.php#L337-L349 | train |
spatie/laravel-medialibrary | src/HasMedia/HasMediaTrait.php | HasMediaTrait.clearMediaCollectionExcept | public function clearMediaCollectionExcept(string $collectionName = 'default', $excludedMedia = [])
{
if ($excludedMedia instanceof Media) {
$excludedMedia = collect()->push($excludedMedia);
}
$excludedMedia = collect($excludedMedia);
if ($excludedMedia->isEmpty()) {
... | php | public function clearMediaCollectionExcept(string $collectionName = 'default', $excludedMedia = [])
{
if ($excludedMedia instanceof Media) {
$excludedMedia = collect()->push($excludedMedia);
}
$excludedMedia = collect($excludedMedia);
if ($excludedMedia->isEmpty()) {
... | [
"public",
"function",
"clearMediaCollectionExcept",
"(",
"string",
"$",
"collectionName",
"=",
"'default'",
",",
"$",
"excludedMedia",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"excludedMedia",
"instanceof",
"Media",
")",
"{",
"$",
"excludedMedia",
"=",
"collec... | Remove all media in the given collection except some.
@param string $collectionName
@param \Spatie\MediaLibrary\Models\Media[]|\Illuminate\Support\Collection $excludedMedia
@return $this | [
"Remove",
"all",
"media",
"in",
"the",
"given",
"collection",
"except",
"some",
"."
] | 6ffb8a41e60f024abd35ff47e08628354d6efd0e | https://github.com/spatie/laravel-medialibrary/blob/6ffb8a41e60f024abd35ff47e08628354d6efd0e/src/HasMedia/HasMediaTrait.php#L359-L382 | train |
spatie/laravel-medialibrary | src/HasMedia/HasMediaTrait.php | HasMediaTrait.deleteMedia | public function deleteMedia($mediaId)
{
if ($mediaId instanceof Media) {
$mediaId = $mediaId->id;
}
$media = $this->media->find($mediaId);
if (! $media) {
throw MediaCannotBeDeleted::doesNotBelongToModel($mediaId, $this);
}
$media->delete();... | php | public function deleteMedia($mediaId)
{
if ($mediaId instanceof Media) {
$mediaId = $mediaId->id;
}
$media = $this->media->find($mediaId);
if (! $media) {
throw MediaCannotBeDeleted::doesNotBelongToModel($mediaId, $this);
}
$media->delete();... | [
"public",
"function",
"deleteMedia",
"(",
"$",
"mediaId",
")",
"{",
"if",
"(",
"$",
"mediaId",
"instanceof",
"Media",
")",
"{",
"$",
"mediaId",
"=",
"$",
"mediaId",
"->",
"id",
";",
"}",
"$",
"media",
"=",
"$",
"this",
"->",
"media",
"->",
"find",
... | Delete the associated media with the given id.
You may also pass a media object.
@param int|\Spatie\MediaLibrary\Models\Media $mediaId
@throws \Spatie\MediaLibrary\Exceptions\MediaCannotBeDeleted | [
"Delete",
"the",
"associated",
"media",
"with",
"the",
"given",
"id",
".",
"You",
"may",
"also",
"pass",
"a",
"media",
"object",
"."
] | 6ffb8a41e60f024abd35ff47e08628354d6efd0e | https://github.com/spatie/laravel-medialibrary/blob/6ffb8a41e60f024abd35ff47e08628354d6efd0e/src/HasMedia/HasMediaTrait.php#L392-L405 | train |
spatie/laravel-medialibrary | src/HasMedia/HasMediaTrait.php | HasMediaTrait.loadMedia | public function loadMedia(string $collectionName)
{
$collection = $this->exists
? $this->media
: collect($this->unAttachedMediaLibraryItems)->pluck('media');
return $collection
->filter(function (Media $mediaItem) use ($collectionName) {
if ($coll... | php | public function loadMedia(string $collectionName)
{
$collection = $this->exists
? $this->media
: collect($this->unAttachedMediaLibraryItems)->pluck('media');
return $collection
->filter(function (Media $mediaItem) use ($collectionName) {
if ($coll... | [
"public",
"function",
"loadMedia",
"(",
"string",
"$",
"collectionName",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"exists",
"?",
"$",
"this",
"->",
"media",
":",
"collect",
"(",
"$",
"this",
"->",
"unAttachedMediaLibraryItems",
")",
"->",
"pluc... | Cache the media on the object.
@param string $collectionName
@return mixed | [
"Cache",
"the",
"media",
"on",
"the",
"object",
"."
] | 6ffb8a41e60f024abd35ff47e08628354d6efd0e | https://github.com/spatie/laravel-medialibrary/blob/6ffb8a41e60f024abd35ff47e08628354d6efd0e/src/HasMedia/HasMediaTrait.php#L462-L478 | train |
mpociot/laravel-apidoc-generator | src/Tools/Traits/ParamHelpers.php | ParamHelpers.cleanParams | protected function cleanParams(array $params)
{
$values = [];
foreach ($params as $name => $details) {
$this->cleanValueFrom($name, $details['value'], $values);
}
return $values;
} | php | protected function cleanParams(array $params)
{
$values = [];
foreach ($params as $name => $details) {
$this->cleanValueFrom($name, $details['value'], $values);
}
return $values;
} | [
"protected",
"function",
"cleanParams",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"params",
"as",
"$",
"name",
"=>",
"$",
"details",
")",
"{",
"$",
"this",
"->",
"cleanValueFrom",
"(",
"$",
"name",... | Create proper arrays from dot-noted parameter names.
@param array $params
@return array | [
"Create",
"proper",
"arrays",
"from",
"dot",
"-",
"noted",
"parameter",
"names",
"."
] | 793f15ace8bf95d13a14d7f90e5be9f28c788c78 | https://github.com/mpociot/laravel-apidoc-generator/blob/793f15ace8bf95d13a14d7f90e5be9f28c788c78/src/Tools/Traits/ParamHelpers.php#L14-L22 | train |
mpociot/laravel-apidoc-generator | src/Tools/Traits/ParamHelpers.php | ParamHelpers.cleanValueFrom | protected function cleanValueFrom($name, $value, array &$values = [])
{
if (str_contains($name, '[')) {
$name = str_replace(['][', '[', ']', '..'], ['.', '.', '', '.*.'], $name);
}
array_set($values, str_replace('.*', '.0', $name), $value);
} | php | protected function cleanValueFrom($name, $value, array &$values = [])
{
if (str_contains($name, '[')) {
$name = str_replace(['][', '[', ']', '..'], ['.', '.', '', '.*.'], $name);
}
array_set($values, str_replace('.*', '.0', $name), $value);
} | [
"protected",
"function",
"cleanValueFrom",
"(",
"$",
"name",
",",
"$",
"value",
",",
"array",
"&",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"str_contains",
"(",
"$",
"name",
",",
"'['",
")",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",... | Converts dot notation names to arrays and sets the value at the right depth.
@param string $name
@param mixed $value
@param array $values The array that holds the result
@return void | [
"Converts",
"dot",
"notation",
"names",
"to",
"arrays",
"and",
"sets",
"the",
"value",
"at",
"the",
"right",
"depth",
"."
] | 793f15ace8bf95d13a14d7f90e5be9f28c788c78 | https://github.com/mpociot/laravel-apidoc-generator/blob/793f15ace8bf95d13a14d7f90e5be9f28c788c78/src/Tools/Traits/ParamHelpers.php#L33-L39 | train |
mpociot/laravel-apidoc-generator | src/Tools/ResponseStrategies/ResponseTagStrategy.php | ResponseTagStrategy.getDocBlockResponses | protected function getDocBlockResponses(array $tags)
{
$responseTags = array_values(
array_filter($tags, function ($tag) {
return $tag instanceof Tag && strtolower($tag->getName()) === 'response';
})
);
if (empty($responseTags)) {
return;
... | php | protected function getDocBlockResponses(array $tags)
{
$responseTags = array_values(
array_filter($tags, function ($tag) {
return $tag instanceof Tag && strtolower($tag->getName()) === 'response';
})
);
if (empty($responseTags)) {
return;
... | [
"protected",
"function",
"getDocBlockResponses",
"(",
"array",
"$",
"tags",
")",
"{",
"$",
"responseTags",
"=",
"array_values",
"(",
"array_filter",
"(",
"$",
"tags",
",",
"function",
"(",
"$",
"tag",
")",
"{",
"return",
"$",
"tag",
"instanceof",
"Tag",
"&... | Get the response from the docblock if available.
@param array $tags
@return array|null | [
"Get",
"the",
"response",
"from",
"the",
"docblock",
"if",
"available",
"."
] | 793f15ace8bf95d13a14d7f90e5be9f28c788c78 | https://github.com/mpociot/laravel-apidoc-generator/blob/793f15ace8bf95d13a14d7f90e5be9f28c788c78/src/Tools/ResponseStrategies/ResponseTagStrategy.php#L33-L53 | train |
mpociot/laravel-apidoc-generator | src/Tools/ResponseStrategies/ResponseFileStrategy.php | ResponseFileStrategy.getFileResponses | protected function getFileResponses(array $tags)
{
// avoid "holes" in the keys of the filtered array, by using array_values on the filtered array
$responseFileTags = array_values(
array_filter($tags, function ($tag) {
return $tag instanceof Tag && strtolower($tag->getNam... | php | protected function getFileResponses(array $tags)
{
// avoid "holes" in the keys of the filtered array, by using array_values on the filtered array
$responseFileTags = array_values(
array_filter($tags, function ($tag) {
return $tag instanceof Tag && strtolower($tag->getNam... | [
"protected",
"function",
"getFileResponses",
"(",
"array",
"$",
"tags",
")",
"{",
"// avoid \"holes\" in the keys of the filtered array, by using array_values on the filtered array",
"$",
"responseFileTags",
"=",
"array_values",
"(",
"array_filter",
"(",
"$",
"tags",
",",
"fu... | Get the response from the file if available.
@param array $tags
@return array|null | [
"Get",
"the",
"response",
"from",
"the",
"file",
"if",
"available",
"."
] | 793f15ace8bf95d13a14d7f90e5be9f28c788c78 | https://github.com/mpociot/laravel-apidoc-generator/blob/793f15ace8bf95d13a14d7f90e5be9f28c788c78/src/Tools/ResponseStrategies/ResponseFileStrategy.php#L33-L55 | train |
mpociot/laravel-apidoc-generator | src/Tools/Generator.php | Generator.castToType | private function castToType(string $value, string $type)
{
$casts = [
'integer' => 'intval',
'number' => 'floatval',
'float' => 'floatval',
'boolean' => 'boolval',
];
// First, we handle booleans. We can't use a regular cast,
//because... | php | private function castToType(string $value, string $type)
{
$casts = [
'integer' => 'intval',
'number' => 'floatval',
'float' => 'floatval',
'boolean' => 'boolval',
];
// First, we handle booleans. We can't use a regular cast,
//because... | [
"private",
"function",
"castToType",
"(",
"string",
"$",
"value",
",",
"string",
"$",
"type",
")",
"{",
"$",
"casts",
"=",
"[",
"'integer'",
"=>",
"'intval'",
",",
"'number'",
"=>",
"'floatval'",
",",
"'float'",
"=>",
"'floatval'",
",",
"'boolean'",
"=>",
... | Cast a value from a string to a specified type.
@param string $value
@param string $type
@return mixed | [
"Cast",
"a",
"value",
"from",
"a",
"string",
"to",
"a",
"specified",
"type",
"."
] | 793f15ace8bf95d13a14d7f90e5be9f28c788c78 | https://github.com/mpociot/laravel-apidoc-generator/blob/793f15ace8bf95d13a14d7f90e5be9f28c788c78/src/Tools/Generator.php#L379-L399 | train |
mpociot/laravel-apidoc-generator | src/Tools/ResponseStrategies/TransformerTagsStrategy.php | TransformerTagsStrategy.getTransformerResponse | protected function getTransformerResponse(array $tags)
{
try {
if (empty($transformerTag = $this->getTransformerTag($tags))) {
return;
}
$transformer = $this->getTransformerClass($transformerTag);
$model = $this->getClassToBeTransformed($tags,... | php | protected function getTransformerResponse(array $tags)
{
try {
if (empty($transformerTag = $this->getTransformerTag($tags))) {
return;
}
$transformer = $this->getTransformerClass($transformerTag);
$model = $this->getClassToBeTransformed($tags,... | [
"protected",
"function",
"getTransformerResponse",
"(",
"array",
"$",
"tags",
")",
"{",
"try",
"{",
"if",
"(",
"empty",
"(",
"$",
"transformerTag",
"=",
"$",
"this",
"->",
"getTransformerTag",
"(",
"$",
"tags",
")",
")",
")",
"{",
"return",
";",
"}",
"... | Get a response from the transformer tags.
@param array $tags
@return array|null | [
"Get",
"a",
"response",
"from",
"the",
"transformer",
"tags",
"."
] | 793f15ace8bf95d13a14d7f90e5be9f28c788c78 | https://github.com/mpociot/laravel-apidoc-generator/blob/793f15ace8bf95d13a14d7f90e5be9f28c788c78/src/Tools/ResponseStrategies/TransformerTagsStrategy.php#L37-L62 | train |
UniSharp/laravel-filemanager | src/Lfm.php | Lfm.currentLfmType | public function currentLfmType()
{
$lfm_type = 'file';
$request_type = lcfirst(str_singular($this->input('type') ?: ''));
$available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);
if (in_array($request_type, $available_types)) {
$lfm_type = $requ... | php | public function currentLfmType()
{
$lfm_type = 'file';
$request_type = lcfirst(str_singular($this->input('type') ?: ''));
$available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);
if (in_array($request_type, $available_types)) {
$lfm_type = $requ... | [
"public",
"function",
"currentLfmType",
"(",
")",
"{",
"$",
"lfm_type",
"=",
"'file'",
";",
"$",
"request_type",
"=",
"lcfirst",
"(",
"str_singular",
"(",
"$",
"this",
"->",
"input",
"(",
"'type'",
")",
"?",
":",
"''",
")",
")",
";",
"$",
"available_ty... | Get current lfm type.
@return string | [
"Get",
"current",
"lfm",
"type",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Lfm.php#L72-L84 | train |
UniSharp/laravel-filemanager | src/Lfm.php | Lfm.translateFromUtf8 | public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
}
return $input;
} | php | public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
}
return $input;
} | [
"public",
"function",
"translateFromUtf8",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRunningOnWindows",
"(",
")",
")",
"{",
"$",
"input",
"=",
"iconv",
"(",
"'UTF-8'",
",",
"mb_detect_encoding",
"(",
"$",
"input",
")",
",",
"$",
"in... | Translate file name to make it compatible on Windows.
@param string $input Any string.
@return string | [
"Translate",
"file",
"name",
"to",
"make",
"it",
"compatible",
"on",
"Windows",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Lfm.php#L191-L198 | train |
UniSharp/laravel-filemanager | src/Lfm.php | Lfm.routes | public static function routes()
{
$middleware = [ CreateDefaultFolder::class, MultiUser::class ];
$as = 'unisharp.lfm.';
$namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\';
Route::group(compact('middleware', 'as', 'namespace'), function () {
// display main la... | php | public static function routes()
{
$middleware = [ CreateDefaultFolder::class, MultiUser::class ];
$as = 'unisharp.lfm.';
$namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\';
Route::group(compact('middleware', 'as', 'namespace'), function () {
// display main la... | [
"public",
"static",
"function",
"routes",
"(",
")",
"{",
"$",
"middleware",
"=",
"[",
"CreateDefaultFolder",
"::",
"class",
",",
"MultiUser",
"::",
"class",
"]",
";",
"$",
"as",
"=",
"'unisharp.lfm.'",
";",
"$",
"namespace",
"=",
"'\\\\UniSharp\\\\LaravelFilem... | Generates routes of this package.
@return void | [
"Generates",
"routes",
"of",
"this",
"package",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Lfm.php#L242-L340 | train |
UniSharp/laravel-filemanager | src/Controllers/ItemsController.php | ItemsController.getItems | public function getItems()
{
return [
'items' => array_map(function ($item) {
return $item->fill()->attributes;
}, array_merge($this->lfm->folders(), $this->lfm->files())),
'display' => $this->helper->getDisplayMode(),
'working_dir' => $this->l... | php | public function getItems()
{
return [
'items' => array_map(function ($item) {
return $item->fill()->attributes;
}, array_merge($this->lfm->folders(), $this->lfm->files())),
'display' => $this->helper->getDisplayMode(),
'working_dir' => $this->l... | [
"public",
"function",
"getItems",
"(",
")",
"{",
"return",
"[",
"'items'",
"=>",
"array_map",
"(",
"function",
"(",
"$",
"item",
")",
"{",
"return",
"$",
"item",
"->",
"fill",
"(",
")",
"->",
"attributes",
";",
"}",
",",
"array_merge",
"(",
"$",
"thi... | Get the images to load for a selected folder.
@return mixed | [
"Get",
"the",
"images",
"to",
"load",
"for",
"a",
"selected",
"folder",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Controllers/ItemsController.php#L17-L26 | train |
UniSharp/laravel-filemanager | src/Controllers/FolderController.php | FolderController.getAddfolder | public function getAddfolder()
{
$folder_name = $this->helper->input('name');
try {
if (empty($folder_name)) {
return $this->helper->error('folder-name');
} elseif ($this->lfm->setName($folder_name)->exists()) {
return $this->helper->error('fo... | php | public function getAddfolder()
{
$folder_name = $this->helper->input('name');
try {
if (empty($folder_name)) {
return $this->helper->error('folder-name');
} elseif ($this->lfm->setName($folder_name)->exists()) {
return $this->helper->error('fo... | [
"public",
"function",
"getAddfolder",
"(",
")",
"{",
"$",
"folder_name",
"=",
"$",
"this",
"->",
"helper",
"->",
"input",
"(",
"'name'",
")",
";",
"try",
"{",
"if",
"(",
"empty",
"(",
"$",
"folder_name",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Add a new folder.
@return mixed | [
"Add",
"a",
"new",
"folder",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Controllers/FolderController.php#L38-L57 | train |
UniSharp/laravel-filemanager | src/Controllers/DeleteController.php | DeleteController.getDelete | public function getDelete()
{
$item_names = request('items');
$errors = [];
foreach ($item_names as $name_to_delete) {
$file_to_delete = $this->lfm->pretty($name_to_delete);
$file_path = $file_to_delete->path();
event(new ImageIsDeleting($file_path));
... | php | public function getDelete()
{
$item_names = request('items');
$errors = [];
foreach ($item_names as $name_to_delete) {
$file_to_delete = $this->lfm->pretty($name_to_delete);
$file_path = $file_to_delete->path();
event(new ImageIsDeleting($file_path));
... | [
"public",
"function",
"getDelete",
"(",
")",
"{",
"$",
"item_names",
"=",
"request",
"(",
"'items'",
")",
";",
"$",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"item_names",
"as",
"$",
"name_to_delete",
")",
"{",
"$",
"file_to_delete",
"=",
"$",... | Delete image and associated thumbnail.
@return mixed | [
"Delete",
"image",
"and",
"associated",
"thumbnail",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Controllers/DeleteController.php#L15-L57 | train |
UniSharp/laravel-filemanager | src/LfmPath.php | LfmPath.createFolder | public function createFolder()
{
if ($this->storage->exists($this)) {
return false;
}
$this->storage->makeDirectory(0777, true, true);
} | php | public function createFolder()
{
if ($this->storage->exists($this)) {
return false;
}
$this->storage->makeDirectory(0777, true, true);
} | [
"public",
"function",
"createFolder",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"->",
"exists",
"(",
"$",
"this",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"storage",
"->",
"makeDirectory",
"(",
"0777",
",",
"true",... | Create folder if not exist.
@param string $path Real path of a directory.
@return bool | [
"Create",
"folder",
"if",
"not",
"exist",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/LfmPath.php#L141-L148 | train |
UniSharp/laravel-filemanager | src/LfmPath.php | LfmPath.sortByColumn | public function sortByColumn($arr_items)
{
$sort_by = $this->helper->input('sort_type');
if (in_array($sort_by, ['name', 'time'])) {
$key_to_sort = $sort_by;
} else {
$key_to_sort = 'name';
}
uasort($arr_items, function ($a, $b) use ($key_to_sort) {
... | php | public function sortByColumn($arr_items)
{
$sort_by = $this->helper->input('sort_type');
if (in_array($sort_by, ['name', 'time'])) {
$key_to_sort = $sort_by;
} else {
$key_to_sort = 'name';
}
uasort($arr_items, function ($a, $b) use ($key_to_sort) {
... | [
"public",
"function",
"sortByColumn",
"(",
"$",
"arr_items",
")",
"{",
"$",
"sort_by",
"=",
"$",
"this",
"->",
"helper",
"->",
"input",
"(",
"'sort_type'",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"sort_by",
",",
"[",
"'name'",
",",
"'time'",
"]",
... | Sort files and directories.
@param mixed $arr_items Array of files or folders or both.
@return array of object | [
"Sort",
"files",
"and",
"directories",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/LfmPath.php#L196-L210 | train |
UniSharp/laravel-filemanager | src/Controllers/LfmController.php | LfmController.getErrors | public function getErrors()
{
$arr_errors = [];
if (! extension_loaded('gd') && ! extension_loaded('imagick')) {
array_push($arr_errors, trans('laravel-filemanager::lfm.message-extension_not_found'));
}
if (! extension_loaded('exif')) {
array_push($arr_error... | php | public function getErrors()
{
$arr_errors = [];
if (! extension_loaded('gd') && ! extension_loaded('imagick')) {
array_push($arr_errors, trans('laravel-filemanager::lfm.message-extension_not_found'));
}
if (! extension_loaded('exif')) {
array_push($arr_error... | [
"public",
"function",
"getErrors",
"(",
")",
"{",
"$",
"arr_errors",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"extension_loaded",
"(",
"'gd'",
")",
"&&",
"!",
"extension_loaded",
"(",
"'imagick'",
")",
")",
"{",
"array_push",
"(",
"$",
"arr_errors",
",",
"t... | Check if any extension or config is missing.
@return array | [
"Check",
"if",
"any",
"extension",
"or",
"config",
"is",
"missing",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Controllers/LfmController.php#L47-L72 | train |
UniSharp/laravel-filemanager | src/Controllers/LfmController.php | LfmController.applyIniOverrides | public function applyIniOverrides()
{
$overrides = config('lfm.php_ini_overrides');
if ($overrides && is_array($overrides) && count($overrides) === 0) {
return;
}
foreach ($overrides as $key => $value) {
if ($value && $value != 'false') {
ini_... | php | public function applyIniOverrides()
{
$overrides = config('lfm.php_ini_overrides');
if ($overrides && is_array($overrides) && count($overrides) === 0) {
return;
}
foreach ($overrides as $key => $value) {
if ($value && $value != 'false') {
ini_... | [
"public",
"function",
"applyIniOverrides",
"(",
")",
"{",
"$",
"overrides",
"=",
"config",
"(",
"'lfm.php_ini_overrides'",
")",
";",
"if",
"(",
"$",
"overrides",
"&&",
"is_array",
"(",
"$",
"overrides",
")",
"&&",
"count",
"(",
"$",
"overrides",
")",
"==="... | Overrides settings in php.ini.
@return null | [
"Overrides",
"settings",
"in",
"php",
".",
"ini",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Controllers/LfmController.php#L84-L96 | train |
UniSharp/laravel-filemanager | src/Controllers/ResizeController.php | ResizeController.getResize | public function getResize()
{
$ratio = 1.0;
$image = request('img');
$original_image = Image::make($this->lfm->setName($image)->path('absolute'));
$original_width = $original_image->width();
$original_height = $original_image->height();
$scaled = false;
// ... | php | public function getResize()
{
$ratio = 1.0;
$image = request('img');
$original_image = Image::make($this->lfm->setName($image)->path('absolute'));
$original_width = $original_image->width();
$original_height = $original_image->height();
$scaled = false;
// ... | [
"public",
"function",
"getResize",
"(",
")",
"{",
"$",
"ratio",
"=",
"1.0",
";",
"$",
"image",
"=",
"request",
"(",
"'img'",
")",
";",
"$",
"original_image",
"=",
"Image",
"::",
"make",
"(",
"$",
"this",
"->",
"lfm",
"->",
"setName",
"(",
"$",
"ima... | Dipsplay image for resizing.
@return mixed | [
"Dipsplay",
"image",
"for",
"resizing",
"."
] | 64ac677461e14bc9883faa8d9bb3bbd72f707257 | https://github.com/UniSharp/laravel-filemanager/blob/64ac677461e14bc9883faa8d9bb3bbd72f707257/src/Controllers/ResizeController.php#L16-L53 | train |
ratchetphp/Ratchet | src/Ratchet/Server/FlashPolicy.php | FlashPolicy.addAllowedAccess | public function addAllowedAccess($domain, $ports = '*', $secure = false) {
if (!$this->validateDomain($domain)) {
throw new \UnexpectedValueException('Invalid domain');
}
if (!$this->validatePorts($ports)) {
throw new \UnexpectedValueException('Invalid Port');
}
... | php | public function addAllowedAccess($domain, $ports = '*', $secure = false) {
if (!$this->validateDomain($domain)) {
throw new \UnexpectedValueException('Invalid domain');
}
if (!$this->validatePorts($ports)) {
throw new \UnexpectedValueException('Invalid Port');
}
... | [
"public",
"function",
"addAllowedAccess",
"(",
"$",
"domain",
",",
"$",
"ports",
"=",
"'*'",
",",
"$",
"secure",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateDomain",
"(",
"$",
"domain",
")",
")",
"{",
"throw",
"new",
"\\",
"... | Add a domain to an allowed access list.
@param string $domain Specifies a requesting domain to be granted access. Both named domains and IP
addresses are acceptable values. Subdomains are considered different domains. A wildcard (*) can
be used to match all domains when used alone, or multiple domains (subdomains) whe... | [
"Add",
"a",
"domain",
"to",
"an",
"allowed",
"access",
"list",
"."
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/FlashPolicy.php#L60-L73 | train |
ratchetphp/Ratchet | src/Ratchet/Server/FlashPolicy.php | FlashPolicy.setSiteControl | public function setSiteControl($permittedCrossDomainPolicies = 'all') {
if (!$this->validateSiteControl($permittedCrossDomainPolicies)) {
throw new \UnexpectedValueException('Invalid site control set');
}
$this->_siteControl = $permittedCrossDomainPolicies;
$this->_cacheVali... | php | public function setSiteControl($permittedCrossDomainPolicies = 'all') {
if (!$this->validateSiteControl($permittedCrossDomainPolicies)) {
throw new \UnexpectedValueException('Invalid site control set');
}
$this->_siteControl = $permittedCrossDomainPolicies;
$this->_cacheVali... | [
"public",
"function",
"setSiteControl",
"(",
"$",
"permittedCrossDomainPolicies",
"=",
"'all'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateSiteControl",
"(",
"$",
"permittedCrossDomainPolicies",
")",
")",
"{",
"throw",
"new",
"\\",
"UnexpectedValueExcep... | site-control defines the meta-policy for the current domain. A meta-policy specifies acceptable
domain policy files other than the master policy file located in the target domain's root and named
crossdomain.xml.
@param string $permittedCrossDomainPolicies
@throws \UnexpectedValueException
@return FlashPolicy | [
"site",
"-",
"control",
"defines",
"the",
"meta",
"-",
"policy",
"for",
"the",
"current",
"domain",
".",
"A",
"meta",
"-",
"policy",
"specifies",
"acceptable",
"domain",
"policy",
"files",
"other",
"than",
"the",
"master",
"policy",
"file",
"located",
"in",
... | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/FlashPolicy.php#L96-L105 | train |
ratchetphp/Ratchet | src/Ratchet/Server/FlashPolicy.php | FlashPolicy.renderPolicy | public function renderPolicy() {
$policy = new \SimpleXMLElement($this->_policy);
$siteControl = $policy->addChild('site-control');
if ($this->_siteControl == '') {
$this->setSiteControl();
}
$siteControl->addAttribute('permitted-cross-domain-policies', $this->_sit... | php | public function renderPolicy() {
$policy = new \SimpleXMLElement($this->_policy);
$siteControl = $policy->addChild('site-control');
if ($this->_siteControl == '') {
$this->setSiteControl();
}
$siteControl->addAttribute('permitted-cross-domain-policies', $this->_sit... | [
"public",
"function",
"renderPolicy",
"(",
")",
"{",
"$",
"policy",
"=",
"new",
"\\",
"SimpleXMLElement",
"(",
"$",
"this",
"->",
"_policy",
")",
";",
"$",
"siteControl",
"=",
"$",
"policy",
"->",
"addChild",
"(",
"'site-control'",
")",
";",
"if",
"(",
... | Builds the crossdomain file based on the template policy
@throws \UnexpectedValueException
@return \SimpleXMLElement | [
"Builds",
"the",
"crossdomain",
"file",
"based",
"on",
"the",
"template",
"policy"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/FlashPolicy.php#L145-L168 | train |
ratchetphp/Ratchet | src/Ratchet/Wamp/Topic.php | Topic.broadcast | public function broadcast($msg, array $exclude = array(), array $eligible = array()) {
$useEligible = (bool)count($eligible);
foreach ($this->subscribers as $client) {
if (in_array($client->WAMP->sessionId, $exclude)) {
continue;
}
if ($useEligible &&... | php | public function broadcast($msg, array $exclude = array(), array $eligible = array()) {
$useEligible = (bool)count($eligible);
foreach ($this->subscribers as $client) {
if (in_array($client->WAMP->sessionId, $exclude)) {
continue;
}
if ($useEligible &&... | [
"public",
"function",
"broadcast",
"(",
"$",
"msg",
",",
"array",
"$",
"exclude",
"=",
"array",
"(",
")",
",",
"array",
"$",
"eligible",
"=",
"array",
"(",
")",
")",
"{",
"$",
"useEligible",
"=",
"(",
"bool",
")",
"count",
"(",
"$",
"eligible",
")"... | Send a message to all the connections in this topic
@param string|array $msg Payload to publish
@param array $exclude A list of session IDs the message should be excluded from (blacklist)
@param array $eligible A list of session Ids the message should be send to (whitelist)
@return Topic The same Topic object to chain | [
"Send",
"a",
"message",
"to",
"all",
"the",
"connections",
"in",
"this",
"topic"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Wamp/Topic.php#L39-L54 | train |
ratchetphp/Ratchet | src/Ratchet/Server/IoServer.php | IoServer.handleConnect | public function handleConnect($conn) {
$conn->decor = new IoConnection($conn);
$conn->decor->resourceId = (int)$conn->stream;
$uri = $conn->getRemoteAddress();
$conn->decor->remoteAddress = trim(
parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_HOST)... | php | public function handleConnect($conn) {
$conn->decor = new IoConnection($conn);
$conn->decor->resourceId = (int)$conn->stream;
$uri = $conn->getRemoteAddress();
$conn->decor->remoteAddress = trim(
parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_HOST)... | [
"public",
"function",
"handleConnect",
"(",
"$",
"conn",
")",
"{",
"$",
"conn",
"->",
"decor",
"=",
"new",
"IoConnection",
"(",
"$",
"conn",
")",
";",
"$",
"conn",
"->",
"decor",
"->",
"resourceId",
"=",
"(",
"int",
")",
"$",
"conn",
"->",
"stream",
... | Triggered when a new connection is received from React
@param \React\Socket\ConnectionInterface $conn | [
"Triggered",
"when",
"a",
"new",
"connection",
"is",
"received",
"from",
"React"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/IoServer.php#L82-L103 | train |
ratchetphp/Ratchet | src/Ratchet/Server/IoServer.php | IoServer.handleData | public function handleData($data, $conn) {
try {
$this->app->onMessage($conn->decor, $data);
} catch (\Exception $e) {
$this->handleError($e, $conn);
}
} | php | public function handleData($data, $conn) {
try {
$this->app->onMessage($conn->decor, $data);
} catch (\Exception $e) {
$this->handleError($e, $conn);
}
} | [
"public",
"function",
"handleData",
"(",
"$",
"data",
",",
"$",
"conn",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"app",
"->",
"onMessage",
"(",
"$",
"conn",
"->",
"decor",
",",
"$",
"data",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e"... | Data has been received from React
@param string $data
@param \React\Socket\ConnectionInterface $conn | [
"Data",
"has",
"been",
"received",
"from",
"React"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/IoServer.php#L110-L116 | train |
ratchetphp/Ratchet | src/Ratchet/Server/IoServer.php | IoServer.handleEnd | public function handleEnd($conn) {
try {
$this->app->onClose($conn->decor);
} catch (\Exception $e) {
$this->handleError($e, $conn);
}
unset($conn->decor);
} | php | public function handleEnd($conn) {
try {
$this->app->onClose($conn->decor);
} catch (\Exception $e) {
$this->handleError($e, $conn);
}
unset($conn->decor);
} | [
"public",
"function",
"handleEnd",
"(",
"$",
"conn",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"app",
"->",
"onClose",
"(",
"$",
"conn",
"->",
"decor",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"handleE... | A connection has been closed by React
@param \React\Socket\ConnectionInterface $conn | [
"A",
"connection",
"has",
"been",
"closed",
"by",
"React"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/IoServer.php#L122-L130 | train |
ratchetphp/Ratchet | src/Ratchet/Server/IoServer.php | IoServer.handleError | public function handleError(\Exception $e, $conn) {
$this->app->onError($conn->decor, $e);
} | php | public function handleError(\Exception $e, $conn) {
$this->app->onError($conn->decor, $e);
} | [
"public",
"function",
"handleError",
"(",
"\\",
"Exception",
"$",
"e",
",",
"$",
"conn",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"onError",
"(",
"$",
"conn",
"->",
"decor",
",",
"$",
"e",
")",
";",
"}"
] | An error has occurred, let the listening application know
@param \Exception $e
@param \React\Socket\ConnectionInterface $conn | [
"An",
"error",
"has",
"occurred",
"let",
"the",
"listening",
"application",
"know"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/IoServer.php#L137-L139 | train |
ratchetphp/Ratchet | src/Ratchet/Http/CloseResponseTrait.php | CloseResponseTrait.close | private function close(ConnectionInterface $conn, $code = 400, array $additional_headers = []) {
$response = new Response($code, array_merge([
'X-Powered-By' => \Ratchet\VERSION
], $additional_headers));
$conn->send(gPsr\str($response));
$conn->close();
} | php | private function close(ConnectionInterface $conn, $code = 400, array $additional_headers = []) {
$response = new Response($code, array_merge([
'X-Powered-By' => \Ratchet\VERSION
], $additional_headers));
$conn->send(gPsr\str($response));
$conn->close();
} | [
"private",
"function",
"close",
"(",
"ConnectionInterface",
"$",
"conn",
",",
"$",
"code",
"=",
"400",
",",
"array",
"$",
"additional_headers",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
"$",
"code",
",",
"array_merge",
"(",
... | Close a connection with an HTTP response
@param \Ratchet\ConnectionInterface $conn
@param int $code HTTP status code
@return null | [
"Close",
"a",
"connection",
"with",
"an",
"HTTP",
"response"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Http/CloseResponseTrait.php#L14-L21 | train |
ratchetphp/Ratchet | src/Ratchet/Session/SessionProvider.php | SessionProvider.parseCookie | private function parseCookie($cookie, $host = null, $path = null, $decode = false) {
// Explode the cookie string using a series of semicolons
$pieces = array_filter(array_map('trim', explode(';', $cookie)));
// The name of the cookie (first kvp) must include an equal sign.
if (empty($p... | php | private function parseCookie($cookie, $host = null, $path = null, $decode = false) {
// Explode the cookie string using a series of semicolons
$pieces = array_filter(array_map('trim', explode(';', $cookie)));
// The name of the cookie (first kvp) must include an equal sign.
if (empty($p... | [
"private",
"function",
"parseCookie",
"(",
"$",
"cookie",
",",
"$",
"host",
"=",
"null",
",",
"$",
"path",
"=",
"null",
",",
"$",
"decode",
"=",
"false",
")",
"{",
"// Explode the cookie string using a series of semicolons",
"$",
"pieces",
"=",
"array_filter",
... | Taken from Guzzle3 | [
"Taken",
"from",
"Guzzle3"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Session/SessionProvider.php#L183-L242 | train |
ratchetphp/Ratchet | src/Ratchet/Server/IpBlackList.php | IpBlackList.unblockAddress | public function unblockAddress($ip) {
if (isset($this->_blacklist[$this->filterAddress($ip)])) {
unset($this->_blacklist[$this->filterAddress($ip)]);
}
return $this;
} | php | public function unblockAddress($ip) {
if (isset($this->_blacklist[$this->filterAddress($ip)])) {
unset($this->_blacklist[$this->filterAddress($ip)]);
}
return $this;
} | [
"public",
"function",
"unblockAddress",
"(",
"$",
"ip",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_blacklist",
"[",
"$",
"this",
"->",
"filterAddress",
"(",
"$",
"ip",
")",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"_blackli... | Unblock an address so they can access your application again
@param string $ip IP address to unblock from connecting to your application
@return IpBlackList | [
"Unblock",
"an",
"address",
"so",
"they",
"can",
"access",
"your",
"application",
"again"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Server/IpBlackList.php#L40-L46 | train |
ratchetphp/Ratchet | src/Ratchet/Wamp/WampConnection.php | WampConnection.callResult | public function callResult($id, $data = array()) {
return $this->send(json_encode(array(WAMP::MSG_CALL_RESULT, $id, $data)));
} | php | public function callResult($id, $data = array()) {
return $this->send(json_encode(array(WAMP::MSG_CALL_RESULT, $id, $data)));
} | [
"public",
"function",
"callResult",
"(",
"$",
"id",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"send",
"(",
"json_encode",
"(",
"array",
"(",
"WAMP",
"::",
"MSG_CALL_RESULT",
",",
"$",
"id",
",",
"$",
"data",
"... | Successfully respond to a call made by the client
@param string $id The unique ID given by the client to respond to
@param array $data an object or array
@return WampConnection | [
"Successfully",
"respond",
"to",
"a",
"call",
"made",
"by",
"the",
"client"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Wamp/WampConnection.php#L32-L34 | train |
ratchetphp/Ratchet | src/Ratchet/Wamp/WampConnection.php | WampConnection.callError | public function callError($id, $errorUri, $desc = '', $details = null) {
if ($errorUri instanceof Topic) {
$errorUri = (string)$errorUri;
}
$data = array(WAMP::MSG_CALL_ERROR, $id, $errorUri, $desc);
if (null !== $details) {
$data[] = $details;
}
... | php | public function callError($id, $errorUri, $desc = '', $details = null) {
if ($errorUri instanceof Topic) {
$errorUri = (string)$errorUri;
}
$data = array(WAMP::MSG_CALL_ERROR, $id, $errorUri, $desc);
if (null !== $details) {
$data[] = $details;
}
... | [
"public",
"function",
"callError",
"(",
"$",
"id",
",",
"$",
"errorUri",
",",
"$",
"desc",
"=",
"''",
",",
"$",
"details",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"errorUri",
"instanceof",
"Topic",
")",
"{",
"$",
"errorUri",
"=",
"(",
"string",
")",... | Respond with an error to a client call
@param string $id The unique ID given by the client to respond to
@param string $errorUri The URI given to identify the specific error
@param string $desc A developer-oriented description of the error
@param string $details An optional human readable detail message to send b... | [
"Respond",
"with",
"an",
"error",
"to",
"a",
"client",
"call"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Wamp/WampConnection.php#L44-L56 | train |
ratchetphp/Ratchet | src/Ratchet/Wamp/WampConnection.php | WampConnection.getUri | public function getUri($uri) {
$curieSeperator = ':';
if (preg_match('/http(s*)\:\/\//', $uri) == false) {
if (strpos($uri, $curieSeperator) !== false) {
list($prefix, $action) = explode($curieSeperator, $uri);
if(isset($this->WAMP->prefixes[... | php | public function getUri($uri) {
$curieSeperator = ':';
if (preg_match('/http(s*)\:\/\//', $uri) == false) {
if (strpos($uri, $curieSeperator) !== false) {
list($prefix, $action) = explode($curieSeperator, $uri);
if(isset($this->WAMP->prefixes[... | [
"public",
"function",
"getUri",
"(",
"$",
"uri",
")",
"{",
"$",
"curieSeperator",
"=",
"':'",
";",
"if",
"(",
"preg_match",
"(",
"'/http(s*)\\:\\/\\//'",
",",
"$",
"uri",
")",
"==",
"false",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"uri",
",",
"$",
... | Get the full request URI from the connection object if a prefix has been established for it
@param string $uri
@return string | [
"Get",
"the",
"full",
"request",
"URI",
"from",
"the",
"connection",
"object",
"if",
"a",
"prefix",
"has",
"been",
"established",
"for",
"it"
] | b85c2a1f189e43f7f0861daf7ff81d016c5d6403 | https://github.com/ratchetphp/Ratchet/blob/b85c2a1f189e43f7f0861daf7ff81d016c5d6403/src/Ratchet/Wamp/WampConnection.php#L83-L97 | train |
doctrine/orm | lib/Doctrine/ORM/Query/Parameter.php | Parameter.setValue | public function setValue($value, $type = null)
{
$this->value = $value;
$this->type = $type ?: ParameterTypeInferer::inferType($value);
} | php | public function setValue($value, $type = null)
{
$this->value = $value;
$this->type = $type ?: ParameterTypeInferer::inferType($value);
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"value",
"=",
"$",
"value",
";",
"$",
"this",
"->",
"type",
"=",
"$",
"type",
"?",
":",
"ParameterTypeInferer",
"::",
"inferType",
"(",
... | Defines the Parameter value.
@param mixed $value Parameter value.
@param mixed $type Parameter type. | [
"Defines",
"the",
"Parameter",
"value",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/Parameter.php#L83-L87 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Driver/FileDriver.php | FileDriver.getElement | public function getElement($className)
{
if ($this->classCache === null) {
$this->initialize();
}
if (isset($this->classCache[$className])) {
return $this->classCache[$className];
}
$result = $this->loadMappingFile($this->locator->findMappingFile($cl... | php | public function getElement($className)
{
if ($this->classCache === null) {
$this->initialize();
}
if (isset($this->classCache[$className])) {
return $this->classCache[$className];
}
$result = $this->loadMappingFile($this->locator->findMappingFile($cl... | [
"public",
"function",
"getElement",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"classCache",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"classCache",
... | Gets the element of schema meta data for the class from the mapping file.
This will lazily load the mapping file if it is not loaded yet.
@param string $className
@return mixed[] The element of schema meta data.
@throws MappingException | [
"Gets",
"the",
"element",
"of",
"schema",
"meta",
"data",
"for",
"the",
"class",
"from",
"the",
"mapping",
"file",
".",
"This",
"will",
"lazily",
"load",
"the",
"mapping",
"file",
"if",
"it",
"is",
"not",
"loaded",
"yet",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Driver/FileDriver.php#L99-L117 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Driver/FileDriver.php | FileDriver.initialize | protected function initialize()
{
$this->classCache = [];
if ($this->globalBasename !== null) {
foreach ($this->locator->getPaths() as $path) {
$file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension();
if (is_file($file)) {
... | php | protected function initialize()
{
$this->classCache = [];
if ($this->globalBasename !== null) {
foreach ($this->locator->getPaths() as $path) {
$file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension();
if (is_file($file)) {
... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"classCache",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"globalBasename",
"!==",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"locator",
"->",
"getPaths",
"(",
"... | Initializes the class cache from all the global files.
Using this feature adds a substantial performance hit to file drivers as
more metadata has to be loaded into memory than might actually be
necessary. This may not be relevant to scenarios where caching of
metadata is in place, however hits very hard in scenarios w... | [
"Initializes",
"the",
"class",
"cache",
"from",
"all",
"the",
"global",
"files",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Driver/FileDriver.php#L173-L187 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.findRootAlias | private function findRootAlias($alias, $parentAlias)
{
$rootAlias = null;
if (in_array($parentAlias, $this->getRootAliases(), true)) {
$rootAlias = $parentAlias;
} elseif (isset($this->joinRootAliases[$parentAlias])) {
$rootAlias = $this->joinRootAliases[$parentAlias... | php | private function findRootAlias($alias, $parentAlias)
{
$rootAlias = null;
if (in_array($parentAlias, $this->getRootAliases(), true)) {
$rootAlias = $parentAlias;
} elseif (isset($this->joinRootAliases[$parentAlias])) {
$rootAlias = $this->joinRootAliases[$parentAlias... | [
"private",
"function",
"findRootAlias",
"(",
"$",
"alias",
",",
"$",
"parentAlias",
")",
"{",
"$",
"rootAlias",
"=",
"null",
";",
"if",
"(",
"in_array",
"(",
"$",
"parentAlias",
",",
"$",
"this",
"->",
"getRootAliases",
"(",
")",
",",
"true",
")",
")",... | Finds the root entity alias of the joined entity.
@param string $alias The alias of the new join entity
@param string $parentAlias The parent entity alias of the join relationship
@return string | [
"Finds",
"the",
"root",
"entity",
"alias",
"of",
"the",
"joined",
"entity",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L379-L396 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.getRootAliases | public function getRootAliases()
{
$aliases = [];
foreach ($this->dqlParts['from'] as &$fromClause) {
if (is_string($fromClause)) {
$spacePos = strrpos($fromClause, ' ');
$from = substr($fromClause, 0, $spacePos);
$alias = substr($f... | php | public function getRootAliases()
{
$aliases = [];
foreach ($this->dqlParts['from'] as &$fromClause) {
if (is_string($fromClause)) {
$spacePos = strrpos($fromClause, ' ');
$from = substr($fromClause, 0, $spacePos);
$alias = substr($f... | [
"public",
"function",
"getRootAliases",
"(",
")",
"{",
"$",
"aliases",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dqlParts",
"[",
"'from'",
"]",
"as",
"&",
"$",
"fromClause",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"fromClause",
")",... | Gets the root aliases of the query. This is the entity aliases involved
in the construction of the query.
<code>
$qb = $em->createQueryBuilder()
->select('u')
->from('User', 'u');
$qb->getRootAliases(); // array('u')
</code>
@return string[] | [
"Gets",
"the",
"root",
"aliases",
"of",
"the",
"query",
".",
"This",
"is",
"the",
"entity",
"aliases",
"involved",
"in",
"the",
"construction",
"of",
"the",
"query",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L441-L458 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.getRootEntities | public function getRootEntities()
{
$entities = [];
foreach ($this->dqlParts['from'] as &$fromClause) {
if (is_string($fromClause)) {
$spacePos = strrpos($fromClause, ' ');
$from = substr($fromClause, 0, $spacePos);
$alias = substr(... | php | public function getRootEntities()
{
$entities = [];
foreach ($this->dqlParts['from'] as &$fromClause) {
if (is_string($fromClause)) {
$spacePos = strrpos($fromClause, ' ');
$from = substr($fromClause, 0, $spacePos);
$alias = substr(... | [
"public",
"function",
"getRootEntities",
"(",
")",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"dqlParts",
"[",
"'from'",
"]",
"as",
"&",
"$",
"fromClause",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"fromClause",
")... | Gets the root entities of the query. This is the entity aliases involved
in the construction of the query.
<code>
$qb = $em->createQueryBuilder()
->select('u')
->from('User', 'u');
$qb->getRootEntities(); // array('User')
</code>
@return string[] | [
"Gets",
"the",
"root",
"entities",
"of",
"the",
"query",
".",
"This",
"is",
"the",
"entity",
"aliases",
"involved",
"in",
"the",
"construction",
"of",
"the",
"query",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L494-L511 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.update | public function update($update = null, $alias = null)
{
$this->type = self::UPDATE;
if (! $update) {
return $this;
}
return $this->add('from', new Expr\From($update, $alias));
} | php | public function update($update = null, $alias = null)
{
$this->type = self::UPDATE;
if (! $update) {
return $this;
}
return $this->add('from', new Expr\From($update, $alias));
} | [
"public",
"function",
"update",
"(",
"$",
"update",
"=",
"null",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"type",
"=",
"self",
"::",
"UPDATE",
";",
"if",
"(",
"!",
"$",
"update",
")",
"{",
"return",
"$",
"this",
";",
"}",
"r... | Turns the query being built into a bulk update query that ranges over
a certain entity type.
<code>
$qb = $em->createQueryBuilder()
->update('User', 'u')
->set('u.password', '?1')
->where('u.id = ?2');
</code>
@param string $update The class/type whose instances are subject to the update.
@param string $alias The cl... | [
"Turns",
"the",
"query",
"being",
"built",
"into",
"a",
"bulk",
"update",
"query",
"that",
"ranges",
"over",
"a",
"certain",
"entity",
"type",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L843-L852 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.from | public function from($from, $alias, $indexBy = null)
{
return $this->add('from', new Expr\From($from, $alias, $indexBy), true);
} | php | public function from($from, $alias, $indexBy = null)
{
return $this->add('from', new Expr\From($from, $alias, $indexBy), true);
} | [
"public",
"function",
"from",
"(",
"$",
"from",
",",
"$",
"alias",
",",
"$",
"indexBy",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"'from'",
",",
"new",
"Expr",
"\\",
"From",
"(",
"$",
"from",
",",
"$",
"alias",
",",
"$",
"... | Creates and adds a query root corresponding to the entity identified by the given alias,
forming a cartesian product with any existing query roots.
<code>
$qb = $em->createQueryBuilder()
->select('u')
->from('User', 'u');
</code>
@param string $from The class name.
@param string $alias The alias of the class.
@p... | [
"Creates",
"and",
"adds",
"a",
"query",
"root",
"corresponding",
"to",
"the",
"entity",
"identified",
"by",
"the",
"given",
"alias",
"forming",
"a",
"cartesian",
"product",
"with",
"any",
"existing",
"query",
"roots",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L870-L873 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.set | public function set($key, $value)
{
return $this->add('set', new Expr\Comparison($key, Expr\Comparison::EQ, $value), true);
} | php | public function set($key, $value)
{
return $this->add('set', new Expr\Comparison($key, Expr\Comparison::EQ, $value), true);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"'set'",
",",
"new",
"Expr",
"\\",
"Comparison",
"(",
"$",
"key",
",",
"Expr",
"\\",
"Comparison",
"::",
"EQ",
",",
"$",
"value",
... | Sets a new value for a field in a bulk update query.
<code>
$qb = $em->createQueryBuilder()
->update('User', 'u')
->set('u.password', '?1')
->where('u.id = ?2');
</code>
@param string $key The key/field to set.
@param string $value The value, expression, placeholder, etc.
@return self | [
"Sets",
"a",
"new",
"value",
"for",
"a",
"field",
"in",
"a",
"bulk",
"update",
"query",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L1032-L1035 | train |
doctrine/orm | lib/Doctrine/ORM/QueryBuilder.php | QueryBuilder.addCriteria | public function addCriteria(Criteria $criteria)
{
$allAliases = $this->getAllAliases();
if (! isset($allAliases[0])) {
throw new Query\QueryException('No aliases are set before invoking addCriteria().');
}
$visitor = new QueryExpressionVisitor($this->getAllAliase... | php | public function addCriteria(Criteria $criteria)
{
$allAliases = $this->getAllAliases();
if (! isset($allAliases[0])) {
throw new Query\QueryException('No aliases are set before invoking addCriteria().');
}
$visitor = new QueryExpressionVisitor($this->getAllAliase... | [
"public",
"function",
"addCriteria",
"(",
"Criteria",
"$",
"criteria",
")",
"{",
"$",
"allAliases",
"=",
"$",
"this",
"->",
"getAllAliases",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"allAliases",
"[",
"0",
"]",
")",
")",
"{",
"throw",
"new",... | Adds criteria to the query.
Adds where expressions with AND operator.
Adds orderings.
Overrides firstResult and maxResults if they're set.
@return self
@throws Query\QueryException | [
"Adds",
"criteria",
"to",
"the",
"query",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/QueryBuilder.php#L1277-L1324 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.createSchema | public function createSchema(array $classes)
{
$createSchemaSql = $this->getCreateSchemaSql($classes);
$conn = $this->em->getConnection();
foreach ($createSchemaSql as $sql) {
try {
$conn->executeQuery($sql);
} catch (Throwable $e) {
... | php | public function createSchema(array $classes)
{
$createSchemaSql = $this->getCreateSchemaSql($classes);
$conn = $this->em->getConnection();
foreach ($createSchemaSql as $sql) {
try {
$conn->executeQuery($sql);
} catch (Throwable $e) {
... | [
"public",
"function",
"createSchema",
"(",
"array",
"$",
"classes",
")",
"{",
"$",
"createSchemaSql",
"=",
"$",
"this",
"->",
"getCreateSchemaSql",
"(",
"$",
"classes",
")",
";",
"$",
"conn",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",... | Creates the database schema for the given array of ClassMetadata instances.
@param ClassMetadata[] $classes
@throws ToolsException | [
"Creates",
"the",
"database",
"schema",
"for",
"the",
"given",
"array",
"of",
"ClassMetadata",
"instances",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L71-L83 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.getCreateSchemaSql | public function getCreateSchemaSql(array $classes)
{
$schema = $this->getSchemaFromMetadata($classes);
return $schema->toSql($this->platform);
} | php | public function getCreateSchemaSql(array $classes)
{
$schema = $this->getSchemaFromMetadata($classes);
return $schema->toSql($this->platform);
} | [
"public",
"function",
"getCreateSchemaSql",
"(",
"array",
"$",
"classes",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"getSchemaFromMetadata",
"(",
"$",
"classes",
")",
";",
"return",
"$",
"schema",
"->",
"toSql",
"(",
"$",
"this",
"->",
"platform",
... | Gets the list of DDL statements that are required to create the database schema for
the given list of ClassMetadata instances.
@param ClassMetadata[] $classes
@return string[] The SQL statements needed to create the schema for the classes. | [
"Gets",
"the",
"list",
"of",
"DDL",
"statements",
"that",
"are",
"required",
"to",
"create",
"the",
"database",
"schema",
"for",
"the",
"given",
"list",
"of",
"ClassMetadata",
"instances",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L93-L98 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.dropSchema | public function dropSchema(array $classes)
{
$dropSchemaSql = $this->getDropSchemaSQL($classes);
$conn = $this->em->getConnection();
foreach ($dropSchemaSql as $sql) {
try {
$conn->executeQuery($sql);
} catch (Throwable $e) {
... | php | public function dropSchema(array $classes)
{
$dropSchemaSql = $this->getDropSchemaSQL($classes);
$conn = $this->em->getConnection();
foreach ($dropSchemaSql as $sql) {
try {
$conn->executeQuery($sql);
} catch (Throwable $e) {
... | [
"public",
"function",
"dropSchema",
"(",
"array",
"$",
"classes",
")",
"{",
"$",
"dropSchemaSql",
"=",
"$",
"this",
"->",
"getDropSchemaSQL",
"(",
"$",
"classes",
")",
";",
"$",
"conn",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
";"... | Drops the database schema for the given classes.
In any way when an exception is thrown it is suppressed since drop was
issued for all classes of the schema and some probably just don't exist.
@param ClassMetadata[] $classes | [
"Drops",
"the",
"database",
"schema",
"for",
"the",
"given",
"classes",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L786-L798 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.dropDatabase | public function dropDatabase()
{
$dropSchemaSql = $this->getDropDatabaseSQL();
$conn = $this->em->getConnection();
foreach ($dropSchemaSql as $sql) {
$conn->executeQuery($sql);
}
} | php | public function dropDatabase()
{
$dropSchemaSql = $this->getDropDatabaseSQL();
$conn = $this->em->getConnection();
foreach ($dropSchemaSql as $sql) {
$conn->executeQuery($sql);
}
} | [
"public",
"function",
"dropDatabase",
"(",
")",
"{",
"$",
"dropSchemaSql",
"=",
"$",
"this",
"->",
"getDropDatabaseSQL",
"(",
")",
";",
"$",
"conn",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
";",
"foreach",
"(",
"$",
"dropSchemaSql",... | Drops all elements in the database of the current connection. | [
"Drops",
"all",
"elements",
"in",
"the",
"database",
"of",
"the",
"current",
"connection",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L803-L811 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.getDropDatabaseSQL | public function getDropDatabaseSQL()
{
$sm = $this->em->getConnection()->getSchemaManager();
$schema = $sm->createSchema();
$visitor = new DropSchemaSqlCollector($this->platform);
$schema->visit($visitor);
return $visitor->getQueries();
} | php | public function getDropDatabaseSQL()
{
$sm = $this->em->getConnection()->getSchemaManager();
$schema = $sm->createSchema();
$visitor = new DropSchemaSqlCollector($this->platform);
$schema->visit($visitor);
return $visitor->getQueries();
} | [
"public",
"function",
"getDropDatabaseSQL",
"(",
")",
"{",
"$",
"sm",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
"->",
"getSchemaManager",
"(",
")",
";",
"$",
"schema",
"=",
"$",
"sm",
"->",
"createSchema",
"(",
")",
";",
"$",
"vi... | Gets the SQL needed to drop the database schema for the connections database.
@return string[] | [
"Gets",
"the",
"SQL",
"needed",
"to",
"drop",
"the",
"database",
"schema",
"for",
"the",
"connections",
"database",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L818-L827 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.getDropSchemaSQL | public function getDropSchemaSQL(array $classes)
{
$visitor = new DropSchemaSqlCollector($this->platform);
$schema = $this->getSchemaFromMetadata($classes);
$sm = $this->em->getConnection()->getSchemaManager();
$fullSchema = $sm->createSchema();
foreach ($fullSchem... | php | public function getDropSchemaSQL(array $classes)
{
$visitor = new DropSchemaSqlCollector($this->platform);
$schema = $this->getSchemaFromMetadata($classes);
$sm = $this->em->getConnection()->getSchemaManager();
$fullSchema = $sm->createSchema();
foreach ($fullSchem... | [
"public",
"function",
"getDropSchemaSQL",
"(",
"array",
"$",
"classes",
")",
"{",
"$",
"visitor",
"=",
"new",
"DropSchemaSqlCollector",
"(",
"$",
"this",
"->",
"platform",
")",
";",
"$",
"schema",
"=",
"$",
"this",
"->",
"getSchemaFromMetadata",
"(",
"$",
... | Gets SQL to drop the tables defined by the passed classes.
@param ClassMetadata[] $classes
@return string[] | [
"Gets",
"SQL",
"to",
"drop",
"the",
"tables",
"defined",
"by",
"the",
"passed",
"classes",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L836-L880 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.updateSchema | public function updateSchema(array $classes, $saveMode = false)
{
$updateSchemaSql = $this->getUpdateSchemaSql($classes, $saveMode);
$conn = $this->em->getConnection();
foreach ($updateSchemaSql as $sql) {
$conn->executeQuery($sql);
}
} | php | public function updateSchema(array $classes, $saveMode = false)
{
$updateSchemaSql = $this->getUpdateSchemaSql($classes, $saveMode);
$conn = $this->em->getConnection();
foreach ($updateSchemaSql as $sql) {
$conn->executeQuery($sql);
}
} | [
"public",
"function",
"updateSchema",
"(",
"array",
"$",
"classes",
",",
"$",
"saveMode",
"=",
"false",
")",
"{",
"$",
"updateSchemaSql",
"=",
"$",
"this",
"->",
"getUpdateSchemaSql",
"(",
"$",
"classes",
",",
"$",
"saveMode",
")",
";",
"$",
"conn",
"=",... | Updates the database schema of the given classes by comparing the ClassMetadata
instances to the current database schema that is inspected.
@param ClassMetadata[] $classes
@param bool $saveMode If TRUE, only performs a partial update
without dropping assets which are scheduled for deletion. | [
"Updates",
"the",
"database",
"schema",
"of",
"the",
"given",
"classes",
"by",
"comparing",
"the",
"ClassMetadata",
"instances",
"to",
"the",
"current",
"database",
"schema",
"that",
"is",
"inspected",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L890-L898 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/SchemaTool.php | SchemaTool.getUpdateSchemaSql | public function getUpdateSchemaSql(array $classes, $saveMode = false)
{
$sm = $this->em->getConnection()->getSchemaManager();
$fromSchema = $sm->createSchema();
$toSchema = $this->getSchemaFromMetadata($classes);
$comparator = new Comparator();
$schemaDiff = $comparator->... | php | public function getUpdateSchemaSql(array $classes, $saveMode = false)
{
$sm = $this->em->getConnection()->getSchemaManager();
$fromSchema = $sm->createSchema();
$toSchema = $this->getSchemaFromMetadata($classes);
$comparator = new Comparator();
$schemaDiff = $comparator->... | [
"public",
"function",
"getUpdateSchemaSql",
"(",
"array",
"$",
"classes",
",",
"$",
"saveMode",
"=",
"false",
")",
"{",
"$",
"sm",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
"->",
"getSchemaManager",
"(",
")",
";",
"$",
"fromSchema",
... | Gets the sequence of SQL statements that need to be performed in order
to bring the given class mappings in-synch with the relational schema.
@param ClassMetadata[] $classes The classes to consider.
@param bool $saveMode If TRUE, only generates SQL for a partial update
that does not include SQL for droppin... | [
"Gets",
"the",
"sequence",
"of",
"SQL",
"statements",
"that",
"need",
"to",
"be",
"performed",
"in",
"order",
"to",
"bring",
"the",
"given",
"class",
"mappings",
"in",
"-",
"synch",
"with",
"the",
"relational",
"schema",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/SchemaTool.php#L910-L925 | train |
doctrine/orm | lib/Doctrine/ORM/AbstractQuery.php | AbstractQuery.setParameters | public function setParameters($parameters)
{
// BC compatibility with 2.3-
if (is_array($parameters)) {
$parameterCollection = new ArrayCollection();
foreach ($parameters as $key => $value) {
$parameterCollection->add(new Parameter($key, $value));
... | php | public function setParameters($parameters)
{
// BC compatibility with 2.3-
if (is_array($parameters)) {
$parameterCollection = new ArrayCollection();
foreach ($parameters as $key => $value) {
$parameterCollection->add(new Parameter($key, $value));
... | [
"public",
"function",
"setParameters",
"(",
"$",
"parameters",
")",
"{",
"// BC compatibility with 2.3-",
"if",
"(",
"is_array",
"(",
"$",
"parameters",
")",
")",
"{",
"$",
"parameterCollection",
"=",
"new",
"ArrayCollection",
"(",
")",
";",
"foreach",
"(",
"$... | Sets a collection of query parameters.
@param ArrayCollection|array|Parameter[]|mixed[] $parameters
@return static This query instance. | [
"Sets",
"a",
"collection",
"of",
"query",
"parameters",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/AbstractQuery.php#L320-L336 | train |
doctrine/orm | lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php | DefaultRepositoryFactory.createRepository | private function createRepository(EntityManagerInterface $entityManager, $entityName)
{
/** @var ClassMetadata $metadata */
$metadata = $entityManager->getClassMetadata($entityName);
$repositoryClassName = $metadata->getCustomRepositoryClassName()
?: $entityManager->ge... | php | private function createRepository(EntityManagerInterface $entityManager, $entityName)
{
/** @var ClassMetadata $metadata */
$metadata = $entityManager->getClassMetadata($entityName);
$repositoryClassName = $metadata->getCustomRepositoryClassName()
?: $entityManager->ge... | [
"private",
"function",
"createRepository",
"(",
"EntityManagerInterface",
"$",
"entityManager",
",",
"$",
"entityName",
")",
"{",
"/** @var ClassMetadata $metadata */",
"$",
"metadata",
"=",
"$",
"entityManager",
"->",
"getClassMetadata",
"(",
"$",
"entityName",
")",
... | Create a new repository instance for an entity class.
@param EntityManagerInterface $entityManager The EntityManager instance.
@param string $entityName The name of the entity.
@return ObjectRepository | [
"Create",
"a",
"new",
"repository",
"instance",
"for",
"an",
"entity",
"class",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php#L43-L51 | train |
doctrine/orm | lib/Doctrine/ORM/Internal/CommitOrderCalculator.php | CommitOrderCalculator.sort | public function sort()
{
foreach ($this->nodeList as $vertex) {
if ($vertex->state !== self::NOT_VISITED) {
continue;
}
$this->visit($vertex);
}
$sortedList = $this->sortedNodeList;
$this->nodeList = [];
$this->sort... | php | public function sort()
{
foreach ($this->nodeList as $vertex) {
if ($vertex->state !== self::NOT_VISITED) {
continue;
}
$this->visit($vertex);
}
$sortedList = $this->sortedNodeList;
$this->nodeList = [];
$this->sort... | [
"public",
"function",
"sort",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"nodeList",
"as",
"$",
"vertex",
")",
"{",
"if",
"(",
"$",
"vertex",
"->",
"state",
"!==",
"self",
"::",
"NOT_VISITED",
")",
"{",
"continue",
";",
"}",
"$",
"this",
"->... | Return a valid order list of all current nodes.
The desired topological sorting is the reverse post order of these searches.
{@internal Highly performance-sensitive method. }}
@return object[] | [
"Return",
"a",
"valid",
"order",
"list",
"of",
"all",
"current",
"nodes",
".",
"The",
"desired",
"topological",
"sorting",
"is",
"the",
"reverse",
"post",
"order",
"of",
"these",
"searches",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php#L106-L122 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.validateLifecycleCallbacks | public function validateLifecycleCallbacks(ReflectionService $reflectionService) : void
{
foreach ($this->lifecycleCallbacks as $callbacks) {
/** @var array $callbacks */
foreach ($callbacks as $callbackFuncName) {
if (! $reflectionService->hasPublicMethod($this->clas... | php | public function validateLifecycleCallbacks(ReflectionService $reflectionService) : void
{
foreach ($this->lifecycleCallbacks as $callbacks) {
/** @var array $callbacks */
foreach ($callbacks as $callbackFuncName) {
if (! $reflectionService->hasPublicMethod($this->clas... | [
"public",
"function",
"validateLifecycleCallbacks",
"(",
"ReflectionService",
"$",
"reflectionService",
")",
":",
"void",
"{",
"foreach",
"(",
"$",
"this",
"->",
"lifecycleCallbacks",
"as",
"$",
"callbacks",
")",
"{",
"/** @var array $callbacks */",
"foreach",
"(",
... | Validates lifecycle callbacks.
@throws MappingException | [
"Validates",
"lifecycle",
"callbacks",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L419-L429 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.validateAndCompleteToOneAssociationMetadata | protected function validateAndCompleteToOneAssociationMetadata(ToOneAssociationMetadata $property)
{
$fieldName = $property->getName();
if ($property->isOwningSide()) {
if (empty($property->getJoinColumns())) {
// Apply default join column
$property->addJ... | php | protected function validateAndCompleteToOneAssociationMetadata(ToOneAssociationMetadata $property)
{
$fieldName = $property->getName();
if ($property->isOwningSide()) {
if (empty($property->getJoinColumns())) {
// Apply default join column
$property->addJ... | [
"protected",
"function",
"validateAndCompleteToOneAssociationMetadata",
"(",
"ToOneAssociationMetadata",
"$",
"property",
")",
"{",
"$",
"fieldName",
"=",
"$",
"property",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"$",
"property",
"->",
"isOwningSide",
"(",
")",
... | Validates & completes a to-one association mapping.
@param ToOneAssociationMetadata $property The association mapping to validate & complete.
@throws RuntimeException
@throws MappingException | [
"Validates",
"&",
"completes",
"a",
"to",
"-",
"one",
"association",
"mapping",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L609-L681 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.validateAndCompleteManyToOneMapping | protected function validateAndCompleteManyToOneMapping(ManyToOneAssociationMetadata $property)
{
// A many-to-one mapping is essentially a one-one backreference
if ($property->isOrphanRemoval()) {
throw MappingException::illegalOrphanRemoval($this->className, $property->getName());
... | php | protected function validateAndCompleteManyToOneMapping(ManyToOneAssociationMetadata $property)
{
// A many-to-one mapping is essentially a one-one backreference
if ($property->isOrphanRemoval()) {
throw MappingException::illegalOrphanRemoval($this->className, $property->getName());
... | [
"protected",
"function",
"validateAndCompleteManyToOneMapping",
"(",
"ManyToOneAssociationMetadata",
"$",
"property",
")",
"{",
"// A many-to-one mapping is essentially a one-one backreference",
"if",
"(",
"$",
"property",
"->",
"isOrphanRemoval",
"(",
")",
")",
"{",
"throw",... | Validates & completes a many-to-one association mapping.
@param ManyToOneAssociationMetadata $property The association mapping to validate & complete.
@throws MappingException | [
"Validates",
"&",
"completes",
"a",
"many",
"-",
"to",
"-",
"one",
"association",
"mapping",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L712-L718 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.getSingleIdentifierFieldName | public function getSingleIdentifierFieldName()
{
if ($this->isIdentifierComposite()) {
throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className);
}
if (! isset($this->identifier[0])) {
throw MappingException::noIdDefined($this->className);
... | php | public function getSingleIdentifierFieldName()
{
if ($this->isIdentifierComposite()) {
throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className);
}
if (! isset($this->identifier[0])) {
throw MappingException::noIdDefined($this->className);
... | [
"public",
"function",
"getSingleIdentifierFieldName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isIdentifierComposite",
"(",
")",
")",
"{",
"throw",
"MappingException",
"::",
"singleIdNotAllowedOnCompositePrimaryKey",
"(",
"$",
"this",
"->",
"className",
")",
... | Gets the name of the single id field. Note that this only works on
entity classes that have a single-field pk.
@return string
@throws MappingException If the class has a composite primary key. | [
"Gets",
"the",
"name",
"of",
"the",
"single",
"id",
"field",
".",
"Note",
"that",
"this",
"only",
"works",
"on",
"entity",
"classes",
"that",
"have",
"a",
"single",
"-",
"field",
"pk",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L852-L863 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.getIdentifierColumns | public function getIdentifierColumns(EntityManagerInterface $em) : array
{
$columns = [];
foreach ($this->identifier as $idProperty) {
$property = $this->getProperty($idProperty);
if ($property instanceof FieldMetadata) {
$columns[$property->getColumnName()]... | php | public function getIdentifierColumns(EntityManagerInterface $em) : array
{
$columns = [];
foreach ($this->identifier as $idProperty) {
$property = $this->getProperty($idProperty);
if ($property instanceof FieldMetadata) {
$columns[$property->getColumnName()]... | [
"public",
"function",
"getIdentifierColumns",
"(",
"EntityManagerInterface",
"$",
"em",
")",
":",
"array",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"identifier",
"as",
"$",
"idProperty",
")",
"{",
"$",
"property",
"=",
... | Returns an array with identifier column names and their corresponding ColumnMetadata.
@return ColumnMetadata[] | [
"Returns",
"an",
"array",
"with",
"identifier",
"column",
"names",
"and",
"their",
"corresponding",
"ColumnMetadata",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L899-L940 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.getTemporaryIdTableName | public function getTemporaryIdTableName() : string
{
$schema = $this->getSchemaName() === null
? ''
: $this->getSchemaName() . '_';
// replace dots with underscores because PostgreSQL creates temporary tables in a special schema
return $schema . $this->getTableName()... | php | public function getTemporaryIdTableName() : string
{
$schema = $this->getSchemaName() === null
? ''
: $this->getSchemaName() . '_';
// replace dots with underscores because PostgreSQL creates temporary tables in a special schema
return $schema . $this->getTableName()... | [
"public",
"function",
"getTemporaryIdTableName",
"(",
")",
":",
"string",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"getSchemaName",
"(",
")",
"===",
"null",
"?",
"''",
":",
"$",
"this",
"->",
"getSchemaName",
"(",
")",
".",
"'_'",
";",
"// replace dot... | Gets the table name to use for temporary identifier tables of this class. | [
"Gets",
"the",
"table",
"name",
"to",
"use",
"for",
"temporary",
"identifier",
"tables",
"of",
"this",
"class",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L961-L969 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.setPropertyOverride | public function setPropertyOverride(Property $property) : void
{
$fieldName = $property->getName();
if (! isset($this->declaredProperties[$fieldName])) {
throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
}
$originalProperty = $this... | php | public function setPropertyOverride(Property $property) : void
{
$fieldName = $property->getName();
if (! isset($this->declaredProperties[$fieldName])) {
throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
}
$originalProperty = $this... | [
"public",
"function",
"setPropertyOverride",
"(",
"Property",
"$",
"property",
")",
":",
"void",
"{",
"$",
"fieldName",
"=",
"$",
"property",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"declaredProperties",
"[",
"$",... | Sets the override property mapping for an entity relationship.
@throws RuntimeException
@throws MappingException
@throws CacheException | [
"Sets",
"the",
"override",
"property",
"mapping",
"for",
"an",
"entity",
"relationship",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L1016-L1082 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.isInheritedProperty | public function isInheritedProperty($fieldName)
{
$declaringClass = $this->declaredProperties[$fieldName]->getDeclaringClass();
return $declaringClass->className !== $this->className;
} | php | public function isInheritedProperty($fieldName)
{
$declaringClass = $this->declaredProperties[$fieldName]->getDeclaringClass();
return $declaringClass->className !== $this->className;
} | [
"public",
"function",
"isInheritedProperty",
"(",
"$",
"fieldName",
")",
"{",
"$",
"declaringClass",
"=",
"$",
"this",
"->",
"declaredProperties",
"[",
"$",
"fieldName",
"]",
"->",
"getDeclaringClass",
"(",
")",
";",
"return",
"$",
"declaringClass",
"->",
"cla... | Checks whether a mapped field is inherited from a superclass.
@param string $fieldName
@return bool TRUE if the field is inherited, FALSE otherwise. | [
"Checks",
"whether",
"a",
"mapped",
"field",
"is",
"inherited",
"from",
"a",
"superclass",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L1101-L1106 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/ClassMetadata.php | ClassMetadata.addProperty | public function addProperty(Property $property)
{
$fieldName = $property->getName();
// Check for empty field name
if (empty($fieldName)) {
throw MappingException::missingFieldName($this->className);
}
$property->setDeclaringClass($this);
switch (true) ... | php | public function addProperty(Property $property)
{
$fieldName = $property->getName();
// Check for empty field name
if (empty($fieldName)) {
throw MappingException::missingFieldName($this->className);
}
$property->setDeclaringClass($this);
switch (true) ... | [
"public",
"function",
"addProperty",
"(",
"Property",
"$",
"property",
")",
"{",
"$",
"fieldName",
"=",
"$",
"property",
"->",
"getName",
"(",
")",
";",
"// Check for empty field name",
"if",
"(",
"empty",
"(",
"$",
"fieldName",
")",
")",
"{",
"throw",
"Ma... | Add a property mapping.
@throws RuntimeException
@throws MappingException
@throws CacheException | [
"Add",
"a",
"property",
"mapping",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L1153-L1204 | train |
doctrine/orm | lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php | ArrayHydrator.updateResultPointer | private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne)
{
if ($coll === null) {
unset($this->resultPointers[$dqlAlias]); // Ticket #1228
return;
}
if ($oneToOne) {
$this->resultPointers[$dqlAlias] =& $coll;
return;
... | php | private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne)
{
if ($coll === null) {
unset($this->resultPointers[$dqlAlias]); // Ticket #1228
return;
}
if ($oneToOne) {
$this->resultPointers[$dqlAlias] =& $coll;
return;
... | [
"private",
"function",
"updateResultPointer",
"(",
"array",
"&",
"$",
"coll",
",",
"$",
"index",
",",
"$",
"dqlAlias",
",",
"$",
"oneToOne",
")",
"{",
"if",
"(",
"$",
"coll",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"resultPointers",
... | Updates the result pointer for an Entity. The result pointers point to the
last seen instance of each Entity type. This is used for graph construction.
@param mixed[] $coll The element.
@param bool|int $index Index of the element in the collection.
@param string $dqlAlias
@param bool $oneToOne Whether it... | [
"Updates",
"the",
"result",
"pointer",
"for",
"an",
"Entity",
".",
"The",
"result",
"pointers",
"point",
"to",
"the",
"last",
"seen",
"instance",
"of",
"each",
"Entity",
"type",
".",
"This",
"is",
"used",
"for",
"graph",
"construction",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php#L253-L279 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | LimitSubqueryOutputWalker.platformSupportsRowNumber | private function platformSupportsRowNumber()
{
return $this->platform instanceof PostgreSqlPlatform
|| $this->platform instanceof SQLServerPlatform
|| $this->platform instanceof OraclePlatform
|| $this->platform instanceof SQLAnywherePlatform
|| $this->platfor... | php | private function platformSupportsRowNumber()
{
return $this->platform instanceof PostgreSqlPlatform
|| $this->platform instanceof SQLServerPlatform
|| $this->platform instanceof OraclePlatform
|| $this->platform instanceof SQLAnywherePlatform
|| $this->platfor... | [
"private",
"function",
"platformSupportsRowNumber",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"platform",
"instanceof",
"PostgreSqlPlatform",
"||",
"$",
"this",
"->",
"platform",
"instanceof",
"SQLServerPlatform",
"||",
"$",
"this",
"->",
"platform",
"instanceof",... | Check if the platform supports the ROW_NUMBER window function.
@return bool | [
"Check",
"if",
"the",
"platform",
"supports",
"the",
"ROW_NUMBER",
"window",
"function",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L116-L125 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | LimitSubqueryOutputWalker.walkSelectStatement | public function walkSelectStatement(SelectStatement $AST)
{
if ($this->platformSupportsRowNumber()) {
return $this->walkSelectStatementWithRowNumber($AST);
}
return $this->walkSelectStatementWithoutRowNumber($AST);
} | php | public function walkSelectStatement(SelectStatement $AST)
{
if ($this->platformSupportsRowNumber()) {
return $this->walkSelectStatementWithRowNumber($AST);
}
return $this->walkSelectStatementWithoutRowNumber($AST);
} | [
"public",
"function",
"walkSelectStatement",
"(",
"SelectStatement",
"$",
"AST",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"platformSupportsRowNumber",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"walkSelectStatementWithRowNumber",
"(",
"$",
"AST",
")",
";"... | Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.
@return string
@throws RuntimeException | [
"Walks",
"down",
"a",
"SelectStatement",
"AST",
"node",
"wrapping",
"it",
"in",
"a",
"SELECT",
"DISTINCT",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L163-L170 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | LimitSubqueryOutputWalker.walkSelectStatementWithoutRowNumber | public function walkSelectStatementWithoutRowNumber(SelectStatement $AST, $addMissingItemsFromOrderByToSelect = true)
{
// We don't want to call this recursively!
if ($AST->orderByClause instanceof OrderByClause && $addMissingItemsFromOrderByToSelect) {
// In the case of ordering a query... | php | public function walkSelectStatementWithoutRowNumber(SelectStatement $AST, $addMissingItemsFromOrderByToSelect = true)
{
// We don't want to call this recursively!
if ($AST->orderByClause instanceof OrderByClause && $addMissingItemsFromOrderByToSelect) {
// In the case of ordering a query... | [
"public",
"function",
"walkSelectStatementWithoutRowNumber",
"(",
"SelectStatement",
"$",
"AST",
",",
"$",
"addMissingItemsFromOrderByToSelect",
"=",
"true",
")",
"{",
"// We don't want to call this recursively!",
"if",
"(",
"$",
"AST",
"->",
"orderByClause",
"instanceof",
... | Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.
This method is for platforms which DO NOT support ROW_NUMBER.
@param bool $addMissingItemsFromOrderByToSelect
@return string
@throws RuntimeException | [
"Walks",
"down",
"a",
"SelectStatement",
"AST",
"node",
"wrapping",
"it",
"in",
"a",
"SELECT",
"DISTINCT",
".",
"This",
"method",
"is",
"for",
"platforms",
"which",
"DO",
"NOT",
"support",
"ROW_NUMBER",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L240-L286 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | LimitSubqueryOutputWalker.addMissingItemsFromOrderByToSelect | private function addMissingItemsFromOrderByToSelect(SelectStatement $AST)
{
$this->orderByPathExpressions = [];
// We need to do this in another walker because otherwise we'll end up
// polluting the state of this one.
$walker = clone $this;
// This will populate $orderByPa... | php | private function addMissingItemsFromOrderByToSelect(SelectStatement $AST)
{
$this->orderByPathExpressions = [];
// We need to do this in another walker because otherwise we'll end up
// polluting the state of this one.
$walker = clone $this;
// This will populate $orderByPa... | [
"private",
"function",
"addMissingItemsFromOrderByToSelect",
"(",
"SelectStatement",
"$",
"AST",
")",
"{",
"$",
"this",
"->",
"orderByPathExpressions",
"=",
"[",
"]",
";",
"// We need to do this in another walker because otherwise we'll end up",
"// polluting the state of this on... | Finds all PathExpressions in an AST's OrderByClause, and ensures that
the referenced fields are present in the SelectClause of the passed AST. | [
"Finds",
"all",
"PathExpressions",
"in",
"an",
"AST",
"s",
"OrderByClause",
"and",
"ensures",
"that",
"the",
"referenced",
"fields",
"are",
"present",
"in",
"the",
"SelectClause",
"of",
"the",
"passed",
"AST",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L292-L348 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | LimitSubqueryOutputWalker.recreateInnerSql | private function recreateInnerSql(
OrderByClause $orderByClause,
array $identifiers,
string $innerSql
) : string {
[$searchPatterns, $replacements] = $this->generateSqlAliasReplacements();
$orderByItems = [];
foreach ($orderByClause->orderByItems as $orderByItem) {
... | php | private function recreateInnerSql(
OrderByClause $orderByClause,
array $identifiers,
string $innerSql
) : string {
[$searchPatterns, $replacements] = $this->generateSqlAliasReplacements();
$orderByItems = [];
foreach ($orderByClause->orderByItems as $orderByItem) {
... | [
"private",
"function",
"recreateInnerSql",
"(",
"OrderByClause",
"$",
"orderByClause",
",",
"array",
"$",
"identifiers",
",",
"string",
"$",
"innerSql",
")",
":",
"string",
"{",
"[",
"$",
"searchPatterns",
",",
"$",
"replacements",
"]",
"=",
"$",
"this",
"->... | Generates a new SQL statement for the inner query to keep the correct sorting
@param mixed[][] $identifiers | [
"Generates",
"a",
"new",
"SQL",
"statement",
"for",
"the",
"inner",
"query",
"to",
"keep",
"the",
"correct",
"sorting"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L379-L411 | train |
doctrine/orm | lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php | AbstractCollectionPersister.evictCollectionCache | protected function evictCollectionCache(PersistentCollection $collection)
{
$key = new CollectionCacheKey(
$this->sourceEntity->getRootClassName(),
$this->association->getName(),
$this->uow->getEntityIdentifier($collection->getOwner())
);
$this->region->e... | php | protected function evictCollectionCache(PersistentCollection $collection)
{
$key = new CollectionCacheKey(
$this->sourceEntity->getRootClassName(),
$this->association->getName(),
$this->uow->getEntityIdentifier($collection->getOwner())
);
$this->region->e... | [
"protected",
"function",
"evictCollectionCache",
"(",
"PersistentCollection",
"$",
"collection",
")",
"{",
"$",
"key",
"=",
"new",
"CollectionCacheKey",
"(",
"$",
"this",
"->",
"sourceEntity",
"->",
"getRootClassName",
"(",
")",
",",
"$",
"this",
"->",
"associat... | Clears cache entries related to the current collection | [
"Clears",
"cache",
"entries",
"related",
"to",
"the",
"current",
"collection"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php#L248-L261 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php | AnnotationDriver.convertJoinTableAnnotationToJoinTableMetadata | private function convertJoinTableAnnotationToJoinTableMetadata(
Annotation\JoinTable $joinTableAnnot
) : Mapping\JoinTableMetadata {
$joinTable = new Mapping\JoinTableMetadata();
if (! empty($joinTableAnnot->name)) {
$joinTable->setName($joinTableAnnot->name);
}
... | php | private function convertJoinTableAnnotationToJoinTableMetadata(
Annotation\JoinTable $joinTableAnnot
) : Mapping\JoinTableMetadata {
$joinTable = new Mapping\JoinTableMetadata();
if (! empty($joinTableAnnot->name)) {
$joinTable->setName($joinTableAnnot->name);
}
... | [
"private",
"function",
"convertJoinTableAnnotationToJoinTableMetadata",
"(",
"Annotation",
"\\",
"JoinTable",
"$",
"joinTableAnnot",
")",
":",
"Mapping",
"\\",
"JoinTableMetadata",
"{",
"$",
"joinTable",
"=",
"new",
"Mapping",
"\\",
"JoinTableMetadata",
"(",
")",
";",... | Parse the given JoinTable as JoinTableMetadata | [
"Parse",
"the",
"given",
"JoinTable",
"as",
"JoinTableMetadata"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php#L897-L923 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php | AnnotationDriver.getCascade | private function getCascade(string $className, string $fieldName, array $originalCascades)
{
$cascadeTypes = ['remove', 'persist', 'refresh'];
$cascades = array_map('strtolower', $originalCascades);
if (in_array('all', $cascades, true)) {
$cascades = $cascadeTypes;
}... | php | private function getCascade(string $className, string $fieldName, array $originalCascades)
{
$cascadeTypes = ['remove', 'persist', 'refresh'];
$cascades = array_map('strtolower', $originalCascades);
if (in_array('all', $cascades, true)) {
$cascades = $cascadeTypes;
}... | [
"private",
"function",
"getCascade",
"(",
"string",
"$",
"className",
",",
"string",
"$",
"fieldName",
",",
"array",
"$",
"originalCascades",
")",
"{",
"$",
"cascadeTypes",
"=",
"[",
"'remove'",
",",
"'persist'",
",",
"'refresh'",
"]",
";",
"$",
"cascades",
... | Attempts to resolve the cascade modes.
@param string $className The class name.
@param string $fieldName The field name.
@param string[] $originalCascades The original unprocessed field cascades.
@return string[] The processed field cascades.
@throws Mapping\MappingException If a cascade option is ... | [
"Attempts",
"to",
"resolve",
"the",
"cascade",
"modes",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php#L1232-L1248 | train |
doctrine/orm | lib/Doctrine/ORM/EntityManager.php | EntityManager.clear | public function clear($entityName = null)
{
$this->unitOfWork->clear();
$this->unitOfWork = new UnitOfWork($this);
if ($this->eventManager->hasListeners(Events::onClear)) {
$this->eventManager->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this));
}
} | php | public function clear($entityName = null)
{
$this->unitOfWork->clear();
$this->unitOfWork = new UnitOfWork($this);
if ($this->eventManager->hasListeners(Events::onClear)) {
$this->eventManager->dispatchEvent(Events::onClear, new Event\OnClearEventArgs($this));
}
} | [
"public",
"function",
"clear",
"(",
"$",
"entityName",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"unitOfWork",
"->",
"clear",
"(",
")",
";",
"$",
"this",
"->",
"unitOfWork",
"=",
"new",
"UnitOfWork",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"thi... | Clears the EntityManager. All entities that are currently managed
by this EntityManager become detached.
@param null $entityName Unused. @todo Remove from ObjectManager. | [
"Clears",
"the",
"EntityManager",
".",
"All",
"entities",
"that",
"are",
"currently",
"managed",
"by",
"this",
"EntityManager",
"become",
"detached",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/EntityManager.php#L592-L601 | train |
doctrine/orm | lib/Doctrine/ORM/EntityManager.php | EntityManager.persist | public function persist($entity)
{
if (! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
}
$this->errorIfClosed();
$this->unitOfWork->persist($entity);
} | php | public function persist($entity)
{
if (! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
}
$this->errorIfClosed();
$this->unitOfWork->persist($entity);
} | [
"public",
"function",
"persist",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"entity",
")",
")",
"{",
"throw",
"ORMInvalidArgumentException",
"::",
"invalidObject",
"(",
"'EntityManager#persist()'",
",",
"$",
"entity",
")",
";",
"}",... | Tells the EntityManager to make an instance managed and persistent.
The entity will be entered into the database at or before transaction
commit or as a result of the flush operation.
NOTE: The persist operation always considers entities that are not yet known to
this EntityManager as NEW. Do not pass detached entiti... | [
"Tells",
"the",
"EntityManager",
"to",
"make",
"an",
"instance",
"managed",
"and",
"persistent",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/EntityManager.php#L627-L636 | train |
doctrine/orm | lib/Doctrine/ORM/EntityManager.php | EntityManager.refresh | public function refresh($entity)
{
if (! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
}
$this->errorIfClosed();
$this->unitOfWork->refresh($entity);
} | php | public function refresh($entity)
{
if (! is_object($entity)) {
throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
}
$this->errorIfClosed();
$this->unitOfWork->refresh($entity);
} | [
"public",
"function",
"refresh",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"entity",
")",
")",
"{",
"throw",
"ORMInvalidArgumentException",
"::",
"invalidObject",
"(",
"'EntityManager#refresh()'",
",",
"$",
"entity",
")",
";",
"}",... | Refreshes the persistent state of an entity from the database,
overriding any local changes that have not yet been persisted.
@param object $entity The entity to refresh.
@throws ORMInvalidArgumentException
@throws ORMException | [
"Refreshes",
"the",
"persistent",
"state",
"of",
"an",
"entity",
"from",
"the",
"database",
"overriding",
"any",
"local",
"changes",
"that",
"have",
"not",
"yet",
"been",
"persisted",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/EntityManager.php#L669-L678 | train |
doctrine/orm | lib/Doctrine/ORM/EntityManager.php | EntityManager.contains | public function contains($entity)
{
return $this->unitOfWork->isScheduledForInsert($entity)
|| ($this->unitOfWork->isInIdentityMap($entity) && ! $this->unitOfWork->isScheduledForDelete($entity));
} | php | public function contains($entity)
{
return $this->unitOfWork->isScheduledForInsert($entity)
|| ($this->unitOfWork->isInIdentityMap($entity) && ! $this->unitOfWork->isScheduledForDelete($entity));
} | [
"public",
"function",
"contains",
"(",
"$",
"entity",
")",
"{",
"return",
"$",
"this",
"->",
"unitOfWork",
"->",
"isScheduledForInsert",
"(",
"$",
"entity",
")",
"||",
"(",
"$",
"this",
"->",
"unitOfWork",
"->",
"isInIdentityMap",
"(",
"$",
"entity",
")",
... | Determines whether an entity instance is managed in this EntityManager.
@param object $entity
@return bool TRUE if this EntityManager currently manages the given entity, FALSE otherwise. | [
"Determines",
"whether",
"an",
"entity",
"instance",
"is",
"managed",
"in",
"this",
"EntityManager",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/EntityManager.php#L707-L711 | train |
doctrine/orm | lib/Doctrine/ORM/EntityManager.php | EntityManager.createConnection | protected static function createConnection($connection, Configuration $config, ?EventManager $eventManager = null)
{
if (is_array($connection)) {
return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager());
}
if (! $connection instanceof Connec... | php | protected static function createConnection($connection, Configuration $config, ?EventManager $eventManager = null)
{
if (is_array($connection)) {
return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager());
}
if (! $connection instanceof Connec... | [
"protected",
"static",
"function",
"createConnection",
"(",
"$",
"connection",
",",
"Configuration",
"$",
"config",
",",
"?",
"EventManager",
"$",
"eventManager",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"connection",
")",
")",
"{",
"return",
... | Factory method to create Connection instances.
@param Connection|mixed[] $connection An array with the connection parameters or an existing Connection instance.
@param Configuration $config The Configuration instance to use.
@param EventManager $eventManager The EventManager instance to use.
@retur... | [
"Factory",
"method",
"to",
"create",
"Connection",
"instances",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/EntityManager.php#L842-L863 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php | MappingDescribeCommand.getClassMetadata | private function getClassMetadata($entityName, EntityManagerInterface $entityManager)
{
try {
return $entityManager->getClassMetadata($entityName);
} catch (MappingException $e) {
}
$matches = array_filter(
$this->getMappedEntities($entityManager),
... | php | private function getClassMetadata($entityName, EntityManagerInterface $entityManager)
{
try {
return $entityManager->getClassMetadata($entityName);
} catch (MappingException $e) {
}
$matches = array_filter(
$this->getMappedEntities($entityManager),
... | [
"private",
"function",
"getClassMetadata",
"(",
"$",
"entityName",
",",
"EntityManagerInterface",
"$",
"entityManager",
")",
"{",
"try",
"{",
"return",
"$",
"entityManager",
"->",
"getClassMetadata",
"(",
"$",
"entityName",
")",
";",
"}",
"catch",
"(",
"MappingE... | Return the class metadata for the given entity
name
@param string $entityName Full or partial entity name
@return ClassMetadata | [
"Return",
"the",
"class",
"metadata",
"for",
"the",
"given",
"entity",
"name"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php#L163-L193 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php | MappingDescribeCommand.formatValue | private function formatValue($value)
{
if ($value === '') {
return '';
}
if ($value === null) {
return '<comment>Null</comment>';
}
if (is_bool($value)) {
return '<comment>' . ($value ? 'True' : 'False') . '</comment>';
}
... | php | private function formatValue($value)
{
if ($value === '') {
return '';
}
if ($value === null) {
return '<comment>Null</comment>';
}
if (is_bool($value)) {
return '<comment>' . ($value ? 'True' : 'False') . '</comment>';
}
... | [
"private",
"function",
"formatValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"''",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"'<comment>Null</comment>'",
";",
"}",
"if",
"(",... | Format the given value for console output
@param mixed $value
@return string | [
"Format",
"the",
"given",
"value",
"for",
"console",
"output"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php#L243-L274 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php | MappingDescribeCommand.formatField | private function formatField($label, $value)
{
if ($value === null) {
$value = '<comment>None</comment>';
}
return [sprintf('<info>%s</info>', $label), $this->formatValue($value)];
} | php | private function formatField($label, $value)
{
if ($value === null) {
$value = '<comment>None</comment>';
}
return [sprintf('<info>%s</info>', $label), $this->formatValue($value)];
} | [
"private",
"function",
"formatField",
"(",
"$",
"label",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"value",
"=",
"'<comment>None</comment>'",
";",
"}",
"return",
"[",
"sprintf",
"(",
"'<info>%s</info>'",
",",
"$"... | Add the given label and value to the two column table output
@param string $label Label for the value
@param mixed $value A Value to show
@return string[] | [
"Add",
"the",
"given",
"label",
"and",
"value",
"to",
"the",
"two",
"column",
"table",
"output"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php#L284-L291 | train |
doctrine/orm | lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php | MappingDescribeCommand.formatPropertyMappings | private function formatPropertyMappings(iterable $propertyMappings)
{
$output = [];
foreach ($propertyMappings as $propertyName => $property) {
$output[] = $this->formatField(sprintf(' %s', $propertyName), '');
if ($property instanceof FieldMetadata) {
$out... | php | private function formatPropertyMappings(iterable $propertyMappings)
{
$output = [];
foreach ($propertyMappings as $propertyName => $property) {
$output[] = $this->formatField(sprintf(' %s', $propertyName), '');
if ($property instanceof FieldMetadata) {
$out... | [
"private",
"function",
"formatPropertyMappings",
"(",
"iterable",
"$",
"propertyMappings",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"propertyMappings",
"as",
"$",
"propertyName",
"=>",
"$",
"property",
")",
"{",
"$",
"output",
"[",
... | Format the property mappings
@param iterable|Property[] $propertyMappings
@return string[] | [
"Format",
"the",
"property",
"mappings"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php#L300-L318 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Factory/Autoloader.php | Autoloader.resolveFile | public static function resolveFile(string $metadataDir, string $metadataNamespace, string $className) : string
{
if (strpos($className, $metadataNamespace) !== 0) {
throw new InvalidArgumentException(
sprintf('The class "%s" is not part of the metadata namespace "%s"', $className... | php | public static function resolveFile(string $metadataDir, string $metadataNamespace, string $className) : string
{
if (strpos($className, $metadataNamespace) !== 0) {
throw new InvalidArgumentException(
sprintf('The class "%s" is not part of the metadata namespace "%s"', $className... | [
"public",
"static",
"function",
"resolveFile",
"(",
"string",
"$",
"metadataDir",
",",
"string",
"$",
"metadataNamespace",
",",
"string",
"$",
"className",
")",
":",
"string",
"{",
"if",
"(",
"strpos",
"(",
"$",
"className",
",",
"$",
"metadataNamespace",
")... | Resolves ClassMetadata class name to a filename based on the following pattern.
1. Remove Metadata namespace from class name.
2. Remove namespace separators from remaining class name.
3. Return PHP filename from metadata-dir with the result from 2.
@throws InvalidArgumentException | [
"Resolves",
"ClassMetadata",
"class",
"name",
"to",
"a",
"filename",
"based",
"on",
"the",
"following",
"pattern",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Factory/Autoloader.php#L35-L50 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Factory/Autoloader.php | Autoloader.register | public static function register(
string $metadataDir,
string $metadataNamespace,
?callable $notFoundCallback = null
) : Closure {
$metadataNamespace = ltrim($metadataNamespace, '\\');
if (! ($notFoundCallback === null || is_callable($notFoundCallback))) {
$type =... | php | public static function register(
string $metadataDir,
string $metadataNamespace,
?callable $notFoundCallback = null
) : Closure {
$metadataNamespace = ltrim($metadataNamespace, '\\');
if (! ($notFoundCallback === null || is_callable($notFoundCallback))) {
$type =... | [
"public",
"static",
"function",
"register",
"(",
"string",
"$",
"metadataDir",
",",
"string",
"$",
"metadataNamespace",
",",
"?",
"callable",
"$",
"notFoundCallback",
"=",
"null",
")",
":",
"Closure",
"{",
"$",
"metadataNamespace",
"=",
"ltrim",
"(",
"$",
"m... | Registers and returns autoloader callback for the given metadata dir and namespace.
@param callable|null $notFoundCallback Invoked when the proxy file is not found.
@throws InvalidArgumentException | [
"Registers",
"and",
"returns",
"autoloader",
"callback",
"for",
"the",
"given",
"metadata",
"dir",
"and",
"namespace",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Factory/Autoloader.php#L59-L89 | train |
doctrine/orm | lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php | HydrationCompleteHandler.deferPostLoadInvoking | public function deferPostLoadInvoking(ClassMetadata $class, $entity)
{
$invoke = $this->listenersInvoker->getSubscribedSystems($class, Events::postLoad);
if ($invoke === ListenersInvoker::INVOKE_NONE) {
return;
}
$this->deferredPostLoadInvocations[] = [$class, $invoke, ... | php | public function deferPostLoadInvoking(ClassMetadata $class, $entity)
{
$invoke = $this->listenersInvoker->getSubscribedSystems($class, Events::postLoad);
if ($invoke === ListenersInvoker::INVOKE_NONE) {
return;
}
$this->deferredPostLoadInvocations[] = [$class, $invoke, ... | [
"public",
"function",
"deferPostLoadInvoking",
"(",
"ClassMetadata",
"$",
"class",
",",
"$",
"entity",
")",
"{",
"$",
"invoke",
"=",
"$",
"this",
"->",
"listenersInvoker",
"->",
"getSubscribedSystems",
"(",
"$",
"class",
",",
"Events",
"::",
"postLoad",
")",
... | Method schedules invoking of postLoad entity to the very end of current hydration cycle.
@param object $entity | [
"Method",
"schedules",
"invoking",
"of",
"postLoad",
"entity",
"to",
"the",
"very",
"end",
"of",
"current",
"hydration",
"cycle",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php#L42-L51 | train |
doctrine/orm | lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php | HydrationCompleteHandler.hydrationComplete | public function hydrationComplete()
{
$toInvoke = $this->deferredPostLoadInvocations;
$this->deferredPostLoadInvocations = [];
foreach ($toInvoke as $classAndEntity) {
[$class, $invoke, $entity] = $classAndEntity;
$this->listenersInvoker->in... | php | public function hydrationComplete()
{
$toInvoke = $this->deferredPostLoadInvocations;
$this->deferredPostLoadInvocations = [];
foreach ($toInvoke as $classAndEntity) {
[$class, $invoke, $entity] = $classAndEntity;
$this->listenersInvoker->in... | [
"public",
"function",
"hydrationComplete",
"(",
")",
"{",
"$",
"toInvoke",
"=",
"$",
"this",
"->",
"deferredPostLoadInvocations",
";",
"$",
"this",
"->",
"deferredPostLoadInvocations",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"toInvoke",
"as",
"$",
"classAndEn... | This method should me called after any hydration cycle completed.
Method fires all deferred invocations of postLoad events | [
"This",
"method",
"should",
"me",
"called",
"after",
"any",
"hydration",
"cycle",
"completed",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php#L58-L74 | train |
doctrine/orm | lib/Doctrine/ORM/Mapping/Factory/AbstractClassMetadataFactory.php | AbstractClassMetadataFactory.getOrCreateClassMetadataDefinition | private function getOrCreateClassMetadataDefinition(string $className, ?ClassMetadata $parent) : ClassMetadataDefinition
{
if (! isset($this->definitions[$className])) {
$this->definitions[$className] = $this->definitionFactory->build($className, $parent);
}
return $this->defini... | php | private function getOrCreateClassMetadataDefinition(string $className, ?ClassMetadata $parent) : ClassMetadataDefinition
{
if (! isset($this->definitions[$className])) {
$this->definitions[$className] = $this->definitionFactory->build($className, $parent);
}
return $this->defini... | [
"private",
"function",
"getOrCreateClassMetadataDefinition",
"(",
"string",
"$",
"className",
",",
"?",
"ClassMetadata",
"$",
"parent",
")",
":",
"ClassMetadataDefinition",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"definitions",
"[",
"$",
"className... | Create a class metadata definition for the given class name. | [
"Create",
"a",
"class",
"metadata",
"definition",
"for",
"the",
"given",
"class",
"name",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Mapping/Factory/AbstractClassMetadataFactory.php#L152-L159 | train |
doctrine/orm | lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php | StatisticsCacheLogger.clearRegionStats | public function clearRegionStats($regionName)
{
$this->cachePutCountMap[$regionName] = 0;
$this->cacheHitCountMap[$regionName] = 0;
$this->cacheMissCountMap[$regionName] = 0;
} | php | public function clearRegionStats($regionName)
{
$this->cachePutCountMap[$regionName] = 0;
$this->cacheHitCountMap[$regionName] = 0;
$this->cacheMissCountMap[$regionName] = 0;
} | [
"public",
"function",
"clearRegionStats",
"(",
"$",
"regionName",
")",
"{",
"$",
"this",
"->",
"cachePutCountMap",
"[",
"$",
"regionName",
"]",
"=",
"0",
";",
"$",
"this",
"->",
"cacheHitCountMap",
"[",
"$",
"regionName",
"]",
"=",
"0",
";",
"$",
"this",... | Clear region statistics
@param string $regionName The name of the cache region. | [
"Clear",
"region",
"statistics"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php#L181-L186 | train |
doctrine/orm | lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | BasicEntityPersister.getSelectColumnSQL | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r')
{
$property = $class->getProperty($field);
$columnAlias = $this->getSQLColumnAlias();
$sql = sprintf(
'%s.%s',
$this->getSQLTableAlias($property->getTableName(), ($alias === '... | php | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r')
{
$property = $class->getProperty($field);
$columnAlias = $this->getSQLColumnAlias();
$sql = sprintf(
'%s.%s',
$this->getSQLTableAlias($property->getTableName(), ($alias === '... | [
"protected",
"function",
"getSelectColumnSQL",
"(",
"$",
"field",
",",
"ClassMetadata",
"$",
"class",
",",
"$",
"alias",
"=",
"'r'",
")",
"{",
"$",
"property",
"=",
"$",
"class",
"->",
"getProperty",
"(",
"$",
"field",
")",
";",
"$",
"columnAlias",
"=",
... | Gets the SQL snippet of a qualified column name for the given field name.
@param string $field The field name.
@param ClassMetadata $class The class that declares this field. The table this class is
mapped to must own the column for the given field.
@param string $alias
@return string | [
"Gets",
"the",
"SQL",
"snippet",
"of",
"a",
"qualified",
"column",
"name",
"for",
"the",
"given",
"field",
"name",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php#L1581-L1594 | train |
doctrine/orm | lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | BasicEntityPersister.getSelectConditionCriteriaSQL | protected function getSelectConditionCriteriaSQL(Criteria $criteria)
{
$expression = $criteria->getWhereExpression();
if ($expression === null) {
return '';
}
$visitor = new SqlExpressionVisitor($this, $this->class);
return $visitor->dispatch($expression);
... | php | protected function getSelectConditionCriteriaSQL(Criteria $criteria)
{
$expression = $criteria->getWhereExpression();
if ($expression === null) {
return '';
}
$visitor = new SqlExpressionVisitor($this, $this->class);
return $visitor->dispatch($expression);
... | [
"protected",
"function",
"getSelectConditionCriteriaSQL",
"(",
"Criteria",
"$",
"criteria",
")",
"{",
"$",
"expression",
"=",
"$",
"criteria",
"->",
"getWhereExpression",
"(",
")",
";",
"if",
"(",
"$",
"expression",
"===",
"null",
")",
"{",
"return",
"''",
"... | Gets the Select Where Condition from a Criteria object.
@return string | [
"Gets",
"the",
"Select",
"Where",
"Condition",
"from",
"a",
"Criteria",
"object",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php#L1673-L1684 | train |
doctrine/orm | lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | BasicEntityPersister.getIndividualValue | private function getIndividualValue($value)
{
if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
return $value;
}
return $this->em->getUnitOfWork()->getSingleIdentifierValue($value);
} | php | private function getIndividualValue($value)
{
if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) {
return $value;
}
return $this->em->getUnitOfWork()->getSingleIdentifierValue($value);
} | [
"private",
"function",
"getIndividualValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"value",
")",
"||",
"!",
"$",
"this",
"->",
"em",
"->",
"getMetadataFactory",
"(",
")",
"->",
"hasMetadataFor",
"(",
"StaticClassNameConverter",
... | Retrieves an individual parameter value.
@param mixed $value
@return mixed | [
"Retrieves",
"an",
"individual",
"parameter",
"value",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php#L2089-L2096 | train |
doctrine/orm | lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | BasicEntityPersister.getJoinSQLForAssociation | protected function getJoinSQLForAssociation(AssociationMetadata $association)
{
if (! $association->isOwningSide()) {
return 'LEFT JOIN';
}
// if one of the join columns is nullable, return left join
foreach ($association->getJoinColumns() as $joinColumn) {
i... | php | protected function getJoinSQLForAssociation(AssociationMetadata $association)
{
if (! $association->isOwningSide()) {
return 'LEFT JOIN';
}
// if one of the join columns is nullable, return left join
foreach ($association->getJoinColumns() as $joinColumn) {
i... | [
"protected",
"function",
"getJoinSQLForAssociation",
"(",
"AssociationMetadata",
"$",
"association",
")",
"{",
"if",
"(",
"!",
"$",
"association",
"->",
"isOwningSide",
"(",
")",
")",
"{",
"return",
"'LEFT JOIN'",
";",
"}",
"// if one of the join columns is nullable, ... | Generates the appropriate join SQL for the given association.
@return string LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise. | [
"Generates",
"the",
"appropriate",
"join",
"SQL",
"for",
"the",
"given",
"association",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php#L2139-L2155 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.setSQLTableAlias | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '')
{
$tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : '';
$this->tableAliasMap[$tableName] = $alias;
return $alias;
} | php | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '')
{
$tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : '';
$this->tableAliasMap[$tableName] = $alias;
return $alias;
} | [
"public",
"function",
"setSQLTableAlias",
"(",
"$",
"tableName",
",",
"$",
"alias",
",",
"$",
"dqlAlias",
"=",
"''",
")",
"{",
"$",
"tableName",
".=",
"$",
"dqlAlias",
"?",
"'@['",
".",
"$",
"dqlAlias",
".",
"']'",
":",
"''",
";",
"$",
"this",
"->",
... | Forces the SqlWalker to use a specific alias for a table name, rather than
generating an alias on its own.
@param string $tableName
@param string $alias
@param string $dqlAlias
@return string | [
"Forces",
"the",
"SqlWalker",
"to",
"use",
"a",
"specific",
"alias",
"for",
"a",
"table",
"name",
"rather",
"than",
"generating",
"an",
"alias",
"on",
"its",
"own",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L292-L299 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.walkIdentificationVariableDeclaration | public function walkIdentificationVariableDeclaration($identificationVariableDecl)
{
$sql = $this->walkRangeVariableDeclaration($identificationVariableDecl->rangeVariableDeclaration);
if ($identificationVariableDecl->indexBy) {
$this->walkIndexBy($identificationVariableDecl->indexBy);
... | php | public function walkIdentificationVariableDeclaration($identificationVariableDecl)
{
$sql = $this->walkRangeVariableDeclaration($identificationVariableDecl->rangeVariableDeclaration);
if ($identificationVariableDecl->indexBy) {
$this->walkIndexBy($identificationVariableDecl->indexBy);
... | [
"public",
"function",
"walkIdentificationVariableDeclaration",
"(",
"$",
"identificationVariableDecl",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"walkRangeVariableDeclaration",
"(",
"$",
"identificationVariableDecl",
"->",
"rangeVariableDeclaration",
")",
";",
"if",
... | Walks down a IdentificationVariableDeclaration AST node, thereby generating the appropriate SQL.
@param AST\IdentificationVariableDeclaration $identificationVariableDecl
@return string | [
"Walks",
"down",
"a",
"IdentificationVariableDeclaration",
"AST",
"node",
"thereby",
"generating",
"the",
"appropriate",
"SQL",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L864-L877 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.walkIndexBy | public function walkIndexBy($indexBy)
{
$pathExpression = $indexBy->simpleStateFieldPathExpression;
$alias = $pathExpression->identificationVariable;
$field = $pathExpression->field;
if (isset($this->scalarFields[$alias][$field])) {
$this->rsm->addIndex... | php | public function walkIndexBy($indexBy)
{
$pathExpression = $indexBy->simpleStateFieldPathExpression;
$alias = $pathExpression->identificationVariable;
$field = $pathExpression->field;
if (isset($this->scalarFields[$alias][$field])) {
$this->rsm->addIndex... | [
"public",
"function",
"walkIndexBy",
"(",
"$",
"indexBy",
")",
"{",
"$",
"pathExpression",
"=",
"$",
"indexBy",
"->",
"simpleStateFieldPathExpression",
";",
"$",
"alias",
"=",
"$",
"pathExpression",
"->",
"identificationVariable",
";",
"$",
"field",
"=",
"$",
... | Walks down a IndexBy AST node.
@param AST\IndexBy $indexBy | [
"Walks",
"down",
"a",
"IndexBy",
"AST",
"node",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L884-L897 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.generateRangeVariableDeclarationSQL | private function generateRangeVariableDeclarationSQL($rangeVariableDeclaration, bool $buildNestedJoins) : string
{
$class = $this->em->getClassMetadata($rangeVariableDeclaration->abstractSchemaName);
$dqlAlias = $rangeVariableDeclaration->aliasIdentificationVariable;
if ($rangeVariableDe... | php | private function generateRangeVariableDeclarationSQL($rangeVariableDeclaration, bool $buildNestedJoins) : string
{
$class = $this->em->getClassMetadata($rangeVariableDeclaration->abstractSchemaName);
$dqlAlias = $rangeVariableDeclaration->aliasIdentificationVariable;
if ($rangeVariableDe... | [
"private",
"function",
"generateRangeVariableDeclarationSQL",
"(",
"$",
"rangeVariableDeclaration",
",",
"bool",
"$",
"buildNestedJoins",
")",
":",
"string",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",
"(",
"$",
"rangeVariableDeclarati... | Generate appropriate SQL for RangeVariableDeclaration AST node
@param AST\RangeVariableDeclaration $rangeVariableDeclaration | [
"Generate",
"appropriate",
"SQL",
"for",
"RangeVariableDeclaration",
"AST",
"node"
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L916-L944 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.walkCoalesceExpression | public function walkCoalesceExpression($coalesceExpression)
{
$sql = 'COALESCE(';
$scalarExpressions = [];
foreach ($coalesceExpression->scalarExpressions as $scalarExpression) {
$scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression);
}
... | php | public function walkCoalesceExpression($coalesceExpression)
{
$sql = 'COALESCE(';
$scalarExpressions = [];
foreach ($coalesceExpression->scalarExpressions as $scalarExpression) {
$scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression);
}
... | [
"public",
"function",
"walkCoalesceExpression",
"(",
"$",
"coalesceExpression",
")",
"{",
"$",
"sql",
"=",
"'COALESCE('",
";",
"$",
"scalarExpressions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"coalesceExpression",
"->",
"scalarExpressions",
"as",
"$",
"scalarE... | Walks down a CoalesceExpression AST node and generates the corresponding SQL.
@param AST\CoalesceExpression $coalesceExpression
@return string The SQL. | [
"Walks",
"down",
"a",
"CoalesceExpression",
"AST",
"node",
"and",
"generates",
"the",
"corresponding",
"SQL",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L1252-L1263 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.walkNullIfExpression | public function walkNullIfExpression($nullIfExpression)
{
$firstExpression = is_string($nullIfExpression->firstExpression)
? $this->conn->quote($nullIfExpression->firstExpression)
: $this->walkSimpleArithmeticExpression($nullIfExpression->firstExpression);
$secondExpression ... | php | public function walkNullIfExpression($nullIfExpression)
{
$firstExpression = is_string($nullIfExpression->firstExpression)
? $this->conn->quote($nullIfExpression->firstExpression)
: $this->walkSimpleArithmeticExpression($nullIfExpression->firstExpression);
$secondExpression ... | [
"public",
"function",
"walkNullIfExpression",
"(",
"$",
"nullIfExpression",
")",
"{",
"$",
"firstExpression",
"=",
"is_string",
"(",
"$",
"nullIfExpression",
"->",
"firstExpression",
")",
"?",
"$",
"this",
"->",
"conn",
"->",
"quote",
"(",
"$",
"nullIfExpression... | Walks down a NullIfExpression AST node and generates the corresponding SQL.
@param AST\NullIfExpression $nullIfExpression
@return string The SQL. | [
"Walks",
"down",
"a",
"NullIfExpression",
"AST",
"node",
"and",
"generates",
"the",
"corresponding",
"SQL",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L1272-L1283 | train |
doctrine/orm | lib/Doctrine/ORM/Query/SqlWalker.php | SqlWalker.walkGeneralCaseExpression | public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression)
{
$sql = 'CASE';
foreach ($generalCaseExpression->whenClauses as $whenClause) {
$sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression);
$sql .= ' TH... | php | public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression)
{
$sql = 'CASE';
foreach ($generalCaseExpression->whenClauses as $whenClause) {
$sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression);
$sql .= ' TH... | [
"public",
"function",
"walkGeneralCaseExpression",
"(",
"AST",
"\\",
"GeneralCaseExpression",
"$",
"generalCaseExpression",
")",
"{",
"$",
"sql",
"=",
"'CASE'",
";",
"foreach",
"(",
"$",
"generalCaseExpression",
"->",
"whenClauses",
"as",
"$",
"whenClause",
")",
"... | Walks down a GeneralCaseExpression AST node and generates the corresponding SQL.
@return string The SQL. | [
"Walks",
"down",
"a",
"GeneralCaseExpression",
"AST",
"node",
"and",
"generates",
"the",
"corresponding",
"SQL",
"."
] | 8bb91280ed1d359c421f4b49ffca6d4453f1ef16 | https://github.com/doctrine/orm/blob/8bb91280ed1d359c421f4b49ffca6d4453f1ef16/lib/Doctrine/ORM/Query/SqlWalker.php#L1290-L1302 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.