id
int32
0
241k
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
32,700
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectMaemoTablet
function DetectMaemoTablet() { if (stripos($this->useragent, $this->maemo) > -1) return $this->true; //For Nokia N810, must be Linux + Tablet, or else it could be something else. if ((stripos($this->useragent, $this->linux) > -1) && (stripos($this->useragent, $this->deviceTablet)...
php
function DetectMaemoTablet() { if (stripos($this->useragent, $this->maemo) > -1) return $this->true; //For Nokia N810, must be Linux + Tablet, or else it could be something else. if ((stripos($this->useragent, $this->linux) > -1) && (stripos($this->useragent, $this->deviceTablet)...
[ "function", "DetectMaemoTablet", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "maemo", ")", ">", "-", "1", ")", "return", "$", "this", "->", "true", ";", "//For Nokia N810, must be Linux + Tablet, or else ...
Detects if the current device is on one of the Maemo-based Nokia Internet Tablets.
[ "Detects", "if", "the", "current", "device", "is", "on", "one", "of", "the", "Maemo", "-", "based", "Nokia", "Internet", "Tablets", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L939-L951
32,701
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectGameConsole
function DetectGameConsole() { if ($this->DetectSonyPlaystation() == $this->true) return $this->true; else if ($this->DetectNintendo() == $this->true) return $this->true; else if ($this->DetectXbox() == $this->true) return $this->true; else r...
php
function DetectGameConsole() { if ($this->DetectSonyPlaystation() == $this->true) return $this->true; else if ($this->DetectNintendo() == $this->true) return $this->true; else if ($this->DetectXbox() == $this->true) return $this->true; else r...
[ "function", "DetectGameConsole", "(", ")", "{", "if", "(", "$", "this", "->", "DetectSonyPlaystation", "(", ")", "==", "$", "this", "->", "true", ")", "return", "$", "this", "->", "true", ";", "else", "if", "(", "$", "this", "->", "DetectNintendo", "("...
Includes many handheld consoles.
[ "Includes", "many", "handheld", "consoles", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L966-L976
32,702
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectSonyPlaystation
function DetectSonyPlaystation() { if (stripos($this->useragent, $this->devicePlaystation) > -1) return $this->true; else return $this->false; }
php
function DetectSonyPlaystation() { if (stripos($this->useragent, $this->devicePlaystation) > -1) return $this->true; else return $this->false; }
[ "function", "DetectSonyPlaystation", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "devicePlaystation", ")", ">", "-", "1", ")", "return", "$", "this", "->", "true", ";", "else", "return", "$", "this"...
Detects if the current device is a Sony Playstation.
[ "Detects", "if", "the", "current", "device", "is", "a", "Sony", "Playstation", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L980-L986
32,703
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectGamingHandheld
function DetectGamingHandheld() { if ((stripos($this->useragent, $this->devicePlaystation) > -1) && (stripos($this->useragent, $this->devicePlaystationVita) > -1)) return $this->true; else return $this->false; }
php
function DetectGamingHandheld() { if ((stripos($this->useragent, $this->devicePlaystation) > -1) && (stripos($this->useragent, $this->devicePlaystationVita) > -1)) return $this->true; else return $this->false; }
[ "function", "DetectGamingHandheld", "(", ")", "{", "if", "(", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "devicePlaystation", ")", ">", "-", "1", ")", "&&", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "...
a touchscreen and modern iPhone-class browser. Includes the Playstation Vita.
[ "a", "touchscreen", "and", "modern", "iPhone", "-", "class", "browser", ".", "Includes", "the", "Playstation", "Vita", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L991-L998
32,704
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectNintendo
function DetectNintendo() { if (stripos($this->useragent, $this->deviceNintendo) > -1 || stripos($this->useragent, $this->deviceWii) > -1 || stripos($this->useragent, $this->deviceNintendoDs) > -1) return $this->true; else return $this->false; }
php
function DetectNintendo() { if (stripos($this->useragent, $this->deviceNintendo) > -1 || stripos($this->useragent, $this->deviceWii) > -1 || stripos($this->useragent, $this->deviceNintendoDs) > -1) return $this->true; else return $this->false; }
[ "function", "DetectNintendo", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "deviceNintendo", ")", ">", "-", "1", "||", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "devic...
Detects if the current device is a Nintendo game device.
[ "Detects", "if", "the", "current", "device", "is", "a", "Nintendo", "game", "device", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1002-L1010
32,705
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectXbox
function DetectXbox() { if (stripos($this->useragent, $this->deviceXbox) > -1) return $this->true; else return $this->false; }
php
function DetectXbox() { if (stripos($this->useragent, $this->deviceXbox) > -1) return $this->true; else return $this->false; }
[ "function", "DetectXbox", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "deviceXbox", ")", ">", "-", "1", ")", "return", "$", "this", "->", "true", ";", "else", "return", "$", "this", "->", "false...
Detects if the current device is a Microsoft Xbox.
[ "Detects", "if", "the", "current", "device", "is", "a", "Microsoft", "Xbox", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1014-L1020
32,706
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectBrewDevice
function DetectBrewDevice() { if (stripos($this->useragent, $this->deviceBrew) > -1) return $this->true; else return $this->false; }
php
function DetectBrewDevice() { if (stripos($this->useragent, $this->deviceBrew) > -1) return $this->true; else return $this->false; }
[ "function", "DetectBrewDevice", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "deviceBrew", ")", ">", "-", "1", ")", "return", "$", "this", "->", "true", ";", "else", "return", "$", "this", "->", ...
Detects whether the device is a Brew-powered device.
[ "Detects", "whether", "the", "device", "is", "a", "Brew", "-", "powered", "device", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1024-L1030
32,707
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectWapWml
function DetectWapWml() { if (stripos($this->httpaccept, $this->vndwap) > -1 || stripos($this->httpaccept, $this->wml) > -1) return $this->true; else return $this->false; }
php
function DetectWapWml() { if (stripos($this->httpaccept, $this->vndwap) > -1 || stripos($this->httpaccept, $this->wml) > -1) return $this->true; else return $this->false; }
[ "function", "DetectWapWml", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "httpaccept", ",", "$", "this", "->", "vndwap", ")", ">", "-", "1", "||", "stripos", "(", "$", "this", "->", "httpaccept", ",", "$", "this", "->", "wml", ")", ...
Detects whether the device supports WAP or WML.
[ "Detects", "whether", "the", "device", "supports", "WAP", "or", "WML", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1034-L1041
32,708
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectMidpCapable
function DetectMidpCapable() { if (stripos($this->useragent, $this->deviceMidp) > -1 || stripos($this->httpaccept, $this->deviceMidp) > -1) return $this->true; else return $this->false; }
php
function DetectMidpCapable() { if (stripos($this->useragent, $this->deviceMidp) > -1 || stripos($this->httpaccept, $this->deviceMidp) > -1) return $this->true; else return $this->false; }
[ "function", "DetectMidpCapable", "(", ")", "{", "if", "(", "stripos", "(", "$", "this", "->", "useragent", ",", "$", "this", "->", "deviceMidp", ")", ">", "-", "1", "||", "stripos", "(", "$", "this", "->", "httpaccept", ",", "$", "this", "->", "devic...
Detects if the current device supports MIDP, a mobile Java technology.
[ "Detects", "if", "the", "current", "device", "supports", "MIDP", "a", "mobile", "Java", "technology", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1045-L1052
32,709
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectMobileQuick
function DetectMobileQuick() { if ($this->initCompleted == $this->true || $this->isMobilePhone == $this->true) return $this->isMobilePhone; //Let's exclude tablets if ($this->isTierTablet == $this->true) return $this->false; //Most mobile browsin...
php
function DetectMobileQuick() { if ($this->initCompleted == $this->true || $this->isMobilePhone == $this->true) return $this->isMobilePhone; //Let's exclude tablets if ($this->isTierTablet == $this->true) return $this->false; //Most mobile browsin...
[ "function", "DetectMobileQuick", "(", ")", "{", "if", "(", "$", "this", "->", "initCompleted", "==", "$", "this", "->", "true", "||", "$", "this", "->", "isMobilePhone", "==", "$", "this", "->", "true", ")", "return", "$", "this", "->", "isMobilePhone", ...
as well as smartphone-class devices. Excludes Apple iPads and other modern tablets.
[ "as", "well", "as", "smartphone", "-", "class", "devices", ".", "Excludes", "Apple", "iPads", "and", "other", "modern", "tablets", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1082-L1118
32,710
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectMobileLong
function DetectMobileLong() { if ($this->DetectMobileQuick() == $this->true) return $this->true; if ($this->DetectGameConsole() == $this->true) return $this->true; if (($this->DetectDangerHiptop() == $this->true) || ($this->DetectMaemoTablet() == $this->t...
php
function DetectMobileLong() { if ($this->DetectMobileQuick() == $this->true) return $this->true; if ($this->DetectGameConsole() == $this->true) return $this->true; if (($this->DetectDangerHiptop() == $this->true) || ($this->DetectMaemoTablet() == $this->t...
[ "function", "DetectMobileLong", "(", ")", "{", "if", "(", "$", "this", "->", "DetectMobileQuick", "(", ")", "==", "$", "this", "->", "true", ")", "return", "$", "this", "->", "true", ";", "if", "(", "$", "this", "->", "DetectGameConsole", "(", ")", "...
but no promises on thoroughness!
[ "but", "no", "promises", "on", "thoroughness!" ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1127-L1156
32,711
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectTierIphone
function DetectTierIphone() { if ($this->initCompleted == $this->true || $this->isTierIphone == $this->true) return $this->isTierIphone; if (($this->DetectIphoneOrIpod() == $this->true) || ($this->DetectAndroidPhone() == $this->true) || ($this->DetectWindowsPhone() == $t...
php
function DetectTierIphone() { if ($this->initCompleted == $this->true || $this->isTierIphone == $this->true) return $this->isTierIphone; if (($this->DetectIphoneOrIpod() == $this->true) || ($this->DetectAndroidPhone() == $this->true) || ($this->DetectWindowsPhone() == $t...
[ "function", "DetectTierIphone", "(", ")", "{", "if", "(", "$", "this", "->", "initCompleted", "==", "$", "this", "->", "true", "||", "$", "this", "->", "isTierIphone", "==", "$", "this", "->", "true", ")", "return", "$", "this", "->", "isTierIphone", "...
Includes iPhone, iPod Touch, Android, Windows Phone, BB10, Playstation Vita, etc.
[ "Includes", "iPhone", "iPod", "Touch", "Android", "Windows", "Phone", "BB10", "Playstation", "Vita", "etc", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1191-L1217
32,712
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectTierRichCss
function DetectTierRichCss() { if ($this->initCompleted == $this->true || $this->isTierRichCss == $this->true) return $this->isTierRichCss; if ($this->DetectMobileQuick() == $this->true) { //Exclude iPhone Tier and e-Ink Kindle devices if (($this->Detec...
php
function DetectTierRichCss() { if ($this->initCompleted == $this->true || $this->isTierRichCss == $this->true) return $this->isTierRichCss; if ($this->DetectMobileQuick() == $this->true) { //Exclude iPhone Tier and e-Ink Kindle devices if (($this->Detec...
[ "function", "DetectTierRichCss", "(", ")", "{", "if", "(", "$", "this", "->", "initCompleted", "==", "$", "this", "->", "true", "||", "$", "this", "->", "isTierRichCss", "==", "$", "this", "->", "true", ")", "return", "$", "this", "->", "isTierRichCss", ...
Excludes all iPhone Tier devices.
[ "Excludes", "all", "iPhone", "Tier", "devices", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1225-L1260
32,713
ahand/mobileesp
PHP/mdetect.php
uagent_info.DetectTierOtherPhones
function DetectTierOtherPhones() { if ($this->initCompleted == $this->true || $this->isTierGenericMobile == $this->true) return $this->isTierGenericMobile; //Exclude devices in the other 2 categories if (($this->DetectMobileLong() == $this->true) && ($this->DetectTier...
php
function DetectTierOtherPhones() { if ($this->initCompleted == $this->true || $this->isTierGenericMobile == $this->true) return $this->isTierGenericMobile; //Exclude devices in the other 2 categories if (($this->DetectMobileLong() == $this->true) && ($this->DetectTier...
[ "function", "DetectTierOtherPhones", "(", ")", "{", "if", "(", "$", "this", "->", "initCompleted", "==", "$", "this", "->", "true", "||", "$", "this", "->", "isTierGenericMobile", "==", "$", "this", "->", "true", ")", "return", "$", "this", "->", "isTier...
but excludes the iPhone and RichCSS Tier devices.
[ "but", "excludes", "the", "iPhone", "and", "RichCSS", "Tier", "devices", "." ]
c02055dbe9baee63aab11438f4d7b5d25075d347
https://github.com/ahand/mobileesp/blob/c02055dbe9baee63aab11438f4d7b5d25075d347/PHP/mdetect.php#L1266-L1279
32,714
plank/laravel-metable
src/DataType/Registry.php
Registry.getHandlerForType
public function getHandlerForType(string $type) : HandlerInterface { if ($this->hasHandlerForType($type)) { return $this->handlers[$type]; } throw DataTypeException::handlerNotFound($type); }
php
public function getHandlerForType(string $type) : HandlerInterface { if ($this->hasHandlerForType($type)) { return $this->handlers[$type]; } throw DataTypeException::handlerNotFound($type); }
[ "public", "function", "getHandlerForType", "(", "string", "$", "type", ")", ":", "HandlerInterface", "{", "if", "(", "$", "this", "->", "hasHandlerForType", "(", "$", "type", ")", ")", "{", "return", "$", "this", "->", "handlers", "[", "$", "type", "]", ...
Retrieve the handler assigned to a given type identifier. @param string $type @throws DataTypeException if no handler is found. @return HandlerInterface
[ "Retrieve", "the", "handler", "assigned", "to", "a", "given", "type", "identifier", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/DataType/Registry.php#L43-L50
32,715
plank/laravel-metable
src/DataType/Registry.php
Registry.getTypeForValue
public function getTypeForValue($value) : string { foreach ($this->handlers as $type => $handler) { if ($handler->canHandleValue($value)) { return $type; } } throw DataTypeException::handlerNotFoundForValue($value); }
php
public function getTypeForValue($value) : string { foreach ($this->handlers as $type => $handler) { if ($handler->canHandleValue($value)) { return $type; } } throw DataTypeException::handlerNotFoundForValue($value); }
[ "public", "function", "getTypeForValue", "(", "$", "value", ")", ":", "string", "{", "foreach", "(", "$", "this", "->", "handlers", "as", "$", "type", "=>", "$", "handler", ")", "{", "if", "(", "$", "handler", "->", "canHandleValue", "(", "$", "value",...
Find a data type Handler that is able to operate on the value, return the type identifier associated with it. @param mixed $value @throws DataTypeException if no handler can handle the value. @return string
[ "Find", "a", "data", "type", "Handler", "that", "is", "able", "to", "operate", "on", "the", "value", "return", "the", "type", "identifier", "associated", "with", "it", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/DataType/Registry.php#L85-L94
32,716
plank/laravel-metable
src/Metable.php
Metable.setMeta
public function setMeta(string $key, $value) { if ($this->hasMeta($key)) { $meta = $this->getMetaRecord($key); $meta->setAttribute('value', $value); $meta->save(); } else { $meta = $this->makeMeta($key, $value); $this->meta()->save($meta); ...
php
public function setMeta(string $key, $value) { if ($this->hasMeta($key)) { $meta = $this->getMetaRecord($key); $meta->setAttribute('value', $value); $meta->save(); } else { $meta = $this->makeMeta($key, $value); $this->meta()->save($meta); ...
[ "public", "function", "setMeta", "(", "string", "$", "key", ",", "$", "value", ")", "{", "if", "(", "$", "this", "->", "hasMeta", "(", "$", "key", ")", ")", "{", "$", "meta", "=", "$", "this", "->", "getMetaRecord", "(", "$", "key", ")", ";", "...
Add or update the value of the `Meta` at a given key. @param string $key @param mixed $value
[ "Add", "or", "update", "the", "value", "of", "the", "Meta", "at", "a", "given", "key", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L48-L63
32,717
plank/laravel-metable
src/Metable.php
Metable.syncMeta
public function syncMeta($array) { $meta = []; foreach ($array as $key => $value) { $meta[$key] = $this->makeMeta($key, $value); } $this->meta()->delete(); $this->meta()->saveMany($meta); // Update cached relationship. $collection = $this->makeM...
php
public function syncMeta($array) { $meta = []; foreach ($array as $key => $value) { $meta[$key] = $this->makeMeta($key, $value); } $this->meta()->delete(); $this->meta()->saveMany($meta); // Update cached relationship. $collection = $this->makeM...
[ "public", "function", "syncMeta", "(", "$", "array", ")", "{", "$", "meta", "=", "[", "]", ";", "foreach", "(", "$", "array", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "meta", "[", "$", "key", "]", "=", "$", "this", "->", "makeMeta",...
Replace all associated `Meta` with the keys and values provided. @param array|Traversable $array @return void
[ "Replace", "all", "associated", "Meta", "with", "the", "keys", "and", "values", "provided", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L72-L86
32,718
plank/laravel-metable
src/Metable.php
Metable.getMeta
public function getMeta(string $key, $default = null) { if ($this->hasMeta($key)) { return $this->getMetaRecord($key)->getAttribute('value'); } return $default; }
php
public function getMeta(string $key, $default = null) { if ($this->hasMeta($key)) { return $this->getMetaRecord($key)->getAttribute('value'); } return $default; }
[ "public", "function", "getMeta", "(", "string", "$", "key", ",", "$", "default", "=", "null", ")", "{", "if", "(", "$", "this", "->", "hasMeta", "(", "$", "key", ")", ")", "{", "return", "$", "this", "->", "getMetaRecord", "(", "$", "key", ")", "...
Retrieve the value of the `Meta` at a given key. @param string $key @param mixed $default Fallback value if no Meta is found. @return mixed
[ "Retrieve", "the", "value", "of", "the", "Meta", "at", "a", "given", "key", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L96-L103
32,719
plank/laravel-metable
src/Metable.php
Metable.scopeWhereHasMeta
public function scopeWhereHasMeta(Builder $q, $key) { $q->whereHas('meta', function (Builder $q) use ($key) { $q->whereIn('key', (array) $key); }); }
php
public function scopeWhereHasMeta(Builder $q, $key) { $q->whereHas('meta', function (Builder $q) use ($key) { $q->whereIn('key', (array) $key); }); }
[ "public", "function", "scopeWhereHasMeta", "(", "Builder", "$", "q", ",", "$", "key", ")", "{", "$", "q", "->", "whereHas", "(", "'meta'", ",", "function", "(", "Builder", "$", "q", ")", "use", "(", "$", "key", ")", "{", "$", "q", "->", "whereIn", ...
Query scope to restrict the query to records which have `Meta` attached to a given key. If an array of keys is passed instead, will restrict the query to records having one or more Meta with any of the keys. @param Builder $q @param string|array $key @return void
[ "Query", "scope", "to", "restrict", "the", "query", "to", "records", "which", "have", "Meta", "attached", "to", "a", "given", "key", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L174-L179
32,720
plank/laravel-metable
src/Metable.php
Metable.scopeWhereDoesntHaveMeta
public function scopeWhereDoesntHaveMeta(Builder $q, $key) { $q->whereDoesntHave('meta', function (Builder $q) use ($key) { $q->whereIn('key', (array) $key); }); }
php
public function scopeWhereDoesntHaveMeta(Builder $q, $key) { $q->whereDoesntHave('meta', function (Builder $q) use ($key) { $q->whereIn('key', (array) $key); }); }
[ "public", "function", "scopeWhereDoesntHaveMeta", "(", "Builder", "$", "q", ",", "$", "key", ")", "{", "$", "q", "->", "whereDoesntHave", "(", "'meta'", ",", "function", "(", "Builder", "$", "q", ")", "use", "(", "$", "key", ")", "{", "$", "q", "->",...
Query scope to restrict the query to records which doesnt have `Meta` attached to a given key. If an array of keys is passed instead, will restrict the query to records having one or more Meta with any of the keys. @param Builder $q @param string|array $key @return void
[ "Query", "scope", "to", "restrict", "the", "query", "to", "records", "which", "doesnt", "have", "Meta", "attached", "to", "a", "given", "key", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L191-L196
32,721
plank/laravel-metable
src/Metable.php
Metable.scopeWhereHasMetaKeys
public function scopeWhereHasMetaKeys(Builder $q, array $keys) { $q->whereHas('meta', function (Builder $q) use ($keys) { $q->whereIn('key', $keys); }, '=', count($keys)); }
php
public function scopeWhereHasMetaKeys(Builder $q, array $keys) { $q->whereHas('meta', function (Builder $q) use ($keys) { $q->whereIn('key', $keys); }, '=', count($keys)); }
[ "public", "function", "scopeWhereHasMetaKeys", "(", "Builder", "$", "q", ",", "array", "$", "keys", ")", "{", "$", "q", "->", "whereHas", "(", "'meta'", ",", "function", "(", "Builder", "$", "q", ")", "use", "(", "$", "keys", ")", "{", "$", "q", "-...
Query scope to restrict the query to records which have `Meta` for all of the provided keys. @param Builder $q @param array $keys @return void
[ "Query", "scope", "to", "restrict", "the", "query", "to", "records", "which", "have", "Meta", "for", "all", "of", "the", "provided", "keys", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L206-L211
32,722
plank/laravel-metable
src/Metable.php
Metable.scopeWhereMeta
public function scopeWhereMeta(Builder $q, string $key, $operator, $value = null) { // Shift arguments if no operator is present. if (!isset($value)) { $value = $operator; $operator = '='; } // Convert value to its serialized version for comparison. i...
php
public function scopeWhereMeta(Builder $q, string $key, $operator, $value = null) { // Shift arguments if no operator is present. if (!isset($value)) { $value = $operator; $operator = '='; } // Convert value to its serialized version for comparison. i...
[ "public", "function", "scopeWhereMeta", "(", "Builder", "$", "q", ",", "string", "$", "key", ",", "$", "operator", ",", "$", "value", "=", "null", ")", "{", "// Shift arguments if no operator is present.", "if", "(", "!", "isset", "(", "$", "value", ")", "...
Query scope to restrict the query to records which have `Meta` with a specific key and value. If the `$value` parameter is omitted, the $operator parameter will be considered the value. Values will be serialized to a string before comparison. If using the `>`, `>=`, `<`, or `<=` comparison operators, note that the va...
[ "Query", "scope", "to", "restrict", "the", "query", "to", "records", "which", "have", "Meta", "with", "a", "specific", "key", "and", "value", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L227-L244
32,723
plank/laravel-metable
src/Metable.php
Metable.scopeWhereMetaNumeric
public function scopeWhereMetaNumeric(Builder $q, string $key, string $operator, $value) { // Since we are manually interpolating into the query, // escape the operator to protect against injection. $validOperators = ['<', '<=', '>', '>=', '=', '<>', '!=']; $operator = in_array($oper...
php
public function scopeWhereMetaNumeric(Builder $q, string $key, string $operator, $value) { // Since we are manually interpolating into the query, // escape the operator to protect against injection. $validOperators = ['<', '<=', '>', '>=', '=', '<>', '!=']; $operator = in_array($oper...
[ "public", "function", "scopeWhereMetaNumeric", "(", "Builder", "$", "q", ",", "string", "$", "key", ",", "string", "$", "operator", ",", "$", "value", ")", "{", "// Since we are manually interpolating into the query,", "// escape the operator to protect against injection.",...
Query scope to restrict the query to records which have `Meta` with a specific key and numeric value. Performs numeric comparison instead of string comparison. @param Builder $q @param string $key @param string $operator @param int|float $value @return void
[ "Query", "scope", "to", "restrict", "the", "query", "to", "records", "which", "have", "Meta", "with", "a", "specific", "key", "and", "numeric", "value", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L258-L270
32,724
plank/laravel-metable
src/Metable.php
Metable.scopeWhereMetaIn
public function scopeWhereMetaIn(Builder $q, string $key, array $values) { $values = array_map(function ($val) use ($key) { return is_string($val) ? $val : $this->makeMeta($key, $val)->getRawValue(); }, $values); $q->whereHas('meta', function (Builder $q) use ($key, $values) { ...
php
public function scopeWhereMetaIn(Builder $q, string $key, array $values) { $values = array_map(function ($val) use ($key) { return is_string($val) ? $val : $this->makeMeta($key, $val)->getRawValue(); }, $values); $q->whereHas('meta', function (Builder $q) use ($key, $values) { ...
[ "public", "function", "scopeWhereMetaIn", "(", "Builder", "$", "q", ",", "string", "$", "key", ",", "array", "$", "values", ")", "{", "$", "values", "=", "array_map", "(", "function", "(", "$", "val", ")", "use", "(", "$", "key", ")", "{", "return", ...
Query scope to restrict the query to records which have `Meta` with a specific key and a value within a specified set of options. @param Builder $q @param string $key @param array $values @return void
[ "Query", "scope", "to", "restrict", "the", "query", "to", "records", "which", "have", "Meta", "with", "a", "specific", "key", "and", "a", "value", "within", "a", "specified", "set", "of", "options", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L281-L291
32,725
plank/laravel-metable
src/Metable.php
Metable.scopeOrderByMeta
public function scopeOrderByMeta(Builder $q, string $key, string $direction = 'asc', $strict = false) { $table = $this->joinMetaTable($q, $key, $strict ? 'inner' : 'left'); $q->orderBy("{$table}.value", $direction); }
php
public function scopeOrderByMeta(Builder $q, string $key, string $direction = 'asc', $strict = false) { $table = $this->joinMetaTable($q, $key, $strict ? 'inner' : 'left'); $q->orderBy("{$table}.value", $direction); }
[ "public", "function", "scopeOrderByMeta", "(", "Builder", "$", "q", ",", "string", "$", "key", ",", "string", "$", "direction", "=", "'asc'", ",", "$", "strict", "=", "false", ")", "{", "$", "table", "=", "$", "this", "->", "joinMetaTable", "(", "$", ...
Query scope to order the query results by the string value of an attached meta. @param Builder $q @param string $key @param string $direction @param bool $strict if true, will exclude records that do not have meta for the provided `$key`. @return void
[ "Query", "scope", "to", "order", "the", "query", "results", "by", "the", "string", "value", "of", "an", "attached", "meta", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L303-L307
32,726
plank/laravel-metable
src/Metable.php
Metable.scopeOrderByMetaNumeric
public function scopeOrderByMetaNumeric(Builder $q, string $key, string $direction = 'asc', $strict = false) { $table = $this->joinMetaTable($q, $key, $strict ? 'inner' : 'left'); $direction = strtolower($direction) == 'asc' ? 'asc' : 'desc'; $field = $q->getQuery()->getGrammar()->wrap("{$ta...
php
public function scopeOrderByMetaNumeric(Builder $q, string $key, string $direction = 'asc', $strict = false) { $table = $this->joinMetaTable($q, $key, $strict ? 'inner' : 'left'); $direction = strtolower($direction) == 'asc' ? 'asc' : 'desc'; $field = $q->getQuery()->getGrammar()->wrap("{$ta...
[ "public", "function", "scopeOrderByMetaNumeric", "(", "Builder", "$", "q", ",", "string", "$", "key", ",", "string", "$", "direction", "=", "'asc'", ",", "$", "strict", "=", "false", ")", "{", "$", "table", "=", "$", "this", "->", "joinMetaTable", "(", ...
Query scope to order the query results by the numeric value of an attached meta. @param Builder $q @param string $key @param string $direction @param bool $strict if true, will exclude records that do not have meta for the provided `$key`. @return void
[ "Query", "scope", "to", "order", "the", "query", "results", "by", "the", "numeric", "value", "of", "an", "attached", "meta", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L319-L326
32,727
plank/laravel-metable
src/Metable.php
Metable.joinMetaTable
private function joinMetaTable(Builder $q, string $key, $type = 'left') { $relation = $this->meta(); $metaTable = $relation->getRelated()->getTable(); // Create an alias for the join, to allow the same // table to be joined multiple times for different keys. $alias = $metaTa...
php
private function joinMetaTable(Builder $q, string $key, $type = 'left') { $relation = $this->meta(); $metaTable = $relation->getRelated()->getTable(); // Create an alias for the join, to allow the same // table to be joined multiple times for different keys. $alias = $metaTa...
[ "private", "function", "joinMetaTable", "(", "Builder", "$", "q", ",", "string", "$", "key", ",", "$", "type", "=", "'left'", ")", "{", "$", "relation", "=", "$", "this", "->", "meta", "(", ")", ";", "$", "metaTable", "=", "$", "relation", "->", "g...
Join the meta table to the query. @param Builder $q @param string $key @param string $type Join type. @return string
[ "Join", "the", "meta", "table", "to", "the", "query", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L337-L366
32,728
plank/laravel-metable
src/Metable.php
Metable.getMetaCollection
private function getMetaCollection() { if (!$this->relationLoaded('meta')) { $this->setRelation('meta', $this->meta()->get()); } return $this->getRelation('meta'); }
php
private function getMetaCollection() { if (!$this->relationLoaded('meta')) { $this->setRelation('meta', $this->meta()->get()); } return $this->getRelation('meta'); }
[ "private", "function", "getMetaCollection", "(", ")", "{", "if", "(", "!", "$", "this", "->", "relationLoaded", "(", "'meta'", ")", ")", "{", "$", "this", "->", "setRelation", "(", "'meta'", ",", "$", "this", "->", "meta", "(", ")", "->", "get", "(",...
fetch all meta for the model, if necessary. In Laravel versions prior to 5.3, relations that are lazy loaded by the `getRelationFromMethod()` method ( invoked by the `__get()` magic method) are not passed through the `setRelation()` method, so we load the relation manually. @return mixed
[ "fetch", "all", "meta", "for", "the", "model", "if", "necessary", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L378-L385
32,729
plank/laravel-metable
src/Metable.php
Metable.makeMeta
protected function makeMeta(string $key = '', $value = '') : Meta { $className = $this->getMetaClassName(); $meta = new $className([ 'key' => $key, 'value' => $value, ]); return $meta; }
php
protected function makeMeta(string $key = '', $value = '') : Meta { $className = $this->getMetaClassName(); $meta = new $className([ 'key' => $key, 'value' => $value, ]); return $meta; }
[ "protected", "function", "makeMeta", "(", "string", "$", "key", "=", "''", ",", "$", "value", "=", "''", ")", ":", "Meta", "{", "$", "className", "=", "$", "this", "->", "getMetaClassName", "(", ")", ";", "$", "meta", "=", "new", "$", "className", ...
Create a new `Meta` record. @param string $key @param mixed $value @return Meta
[ "Create", "a", "new", "Meta", "record", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Metable.php#L418-L428
32,730
plank/laravel-metable
src/DataType/ModelCollectionHandler.php
ModelCollectionHandler.loadModels
private function loadModels(array $items) { $classes = []; $results = []; // Retrieve a list of keys to load from each class. foreach ($items as $item) { if (!is_null($item['key'])) { $classes[$item['class']][] = $item['key']; } } ...
php
private function loadModels(array $items) { $classes = []; $results = []; // Retrieve a list of keys to load from each class. foreach ($items as $item) { if (!is_null($item['key'])) { $classes[$item['class']][] = $item['key']; } } ...
[ "private", "function", "loadModels", "(", "array", "$", "items", ")", "{", "$", "classes", "=", "[", "]", ";", "$", "results", "=", "[", "]", ";", "// Retrieve a list of keys to load from each class.", "foreach", "(", "$", "items", "as", "$", "item", ")", ...
Load each model instance, grouped by class. @param array $items @return array
[ "Load", "each", "model", "instance", "grouped", "by", "class", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/DataType/ModelCollectionHandler.php#L75-L94
32,731
plank/laravel-metable
src/MetableServiceProvider.php
MetableServiceProvider.registerDataTypeRegistry
protected function registerDataTypeRegistry() { $this->app->singleton(Registry::class, function () { $registry = new Registry(); foreach (config('metable.datatypes') as $handler) { $registry->addHandler(new $handler()); } return $registry; ...
php
protected function registerDataTypeRegistry() { $this->app->singleton(Registry::class, function () { $registry = new Registry(); foreach (config('metable.datatypes') as $handler) { $registry->addHandler(new $handler()); } return $registry; ...
[ "protected", "function", "registerDataTypeRegistry", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "Registry", "::", "class", ",", "function", "(", ")", "{", "$", "registry", "=", "new", "Registry", "(", ")", ";", "foreach", "(", "conf...
Add the DataType Registry to the service container. @return void
[ "Add", "the", "DataType", "Registry", "to", "the", "service", "container", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/MetableServiceProvider.php#L53-L64
32,732
plank/laravel-metable
src/Meta.php
Meta.getValueAttribute
public function getValueAttribute() { if (!isset($this->cachedValue)) { $this->cachedValue = $this->getDataTypeRegistry() ->getHandlerForType($this->type) ->unserializeValue($this->attributes['value']); } return $this->cachedValue; }
php
public function getValueAttribute() { if (!isset($this->cachedValue)) { $this->cachedValue = $this->getDataTypeRegistry() ->getHandlerForType($this->type) ->unserializeValue($this->attributes['value']); } return $this->cachedValue; }
[ "public", "function", "getValueAttribute", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "cachedValue", ")", ")", "{", "$", "this", "->", "cachedValue", "=", "$", "this", "->", "getDataTypeRegistry", "(", ")", "->", "getHandlerForType", ...
Accessor for value. Will unserialize the value before returning it. Successive access will be loaded from cache. @return mixed
[ "Accessor", "for", "value", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Meta.php#L65-L74
32,733
plank/laravel-metable
src/Meta.php
Meta.setValueAttribute
public function setValueAttribute($value) { $registry = $this->getDataTypeRegistry(); $this->attributes['type'] = $registry->getTypeForValue($value); $this->attributes['value'] = $registry->getHandlerForType($this->type) ->serializeValue($value); $this->cachedValue = nu...
php
public function setValueAttribute($value) { $registry = $this->getDataTypeRegistry(); $this->attributes['type'] = $registry->getTypeForValue($value); $this->attributes['value'] = $registry->getHandlerForType($this->type) ->serializeValue($value); $this->cachedValue = nu...
[ "public", "function", "setValueAttribute", "(", "$", "value", ")", "{", "$", "registry", "=", "$", "this", "->", "getDataTypeRegistry", "(", ")", ";", "$", "this", "->", "attributes", "[", "'type'", "]", "=", "$", "registry", "->", "getTypeForValue", "(", ...
Mutator for value. The `type` attribute will be automatically updated to match the datatype of the input. @param mixed $value
[ "Mutator", "for", "value", "." ]
414aa3707d8f91170e505ed7228bb74e31d8e35b
https://github.com/plank/laravel-metable/blob/414aa3707d8f91170e505ed7228bb74e31d8e35b/src/Meta.php#L83-L92
32,734
SimplyCodedSoftware/integration-messaging
src/Messaging/Config/MessagingSystemConfiguration.php
MessagingSystemConfiguration.buildMessagingSystemFromConfiguration
public function buildMessagingSystemFromConfiguration(ReferenceSearchService $referenceSearchService): ConfiguredMessagingSystem { foreach ($this->messageHandlerBuilders as $messageHandlerBuilder) { if (!array_key_exists($messageHandlerBuilder->getInputMessageChannelName(), $this->channelBuilder...
php
public function buildMessagingSystemFromConfiguration(ReferenceSearchService $referenceSearchService): ConfiguredMessagingSystem { foreach ($this->messageHandlerBuilders as $messageHandlerBuilder) { if (!array_key_exists($messageHandlerBuilder->getInputMessageChannelName(), $this->channelBuilder...
[ "public", "function", "buildMessagingSystemFromConfiguration", "(", "ReferenceSearchService", "$", "referenceSearchService", ")", ":", "ConfiguredMessagingSystem", "{", "foreach", "(", "$", "this", "->", "messageHandlerBuilders", "as", "$", "messageHandlerBuilder", ")", "{"...
Initialize messaging system from current configuration @param ReferenceSearchService $referenceSearchService @return ConfiguredMessagingSystem @throws NoConsumerFactoryForBuilderException @throws MessagingException
[ "Initialize", "messaging", "system", "from", "current", "configuration" ]
d2d19c64f115adb554952962853a047d40be08bd
https://github.com/SimplyCodedSoftware/integration-messaging/blob/d2d19c64f115adb554952962853a047d40be08bd/src/Messaging/Config/MessagingSystemConfiguration.php#L430-L475
32,735
opis-colibri/framework
src/ItemCollectors/RouteCollector.php
RouteCollector.all
public function all(string $path, callable $action, string $name = null): HttpRoute { return $this->handle($path, $action, ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], $name); }
php
public function all(string $path, callable $action, string $name = null): HttpRoute { return $this->handle($path, $action, ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], $name); }
[ "public", "function", "all", "(", "string", "$", "path", ",", "callable", "$", "action", ",", "string", "$", "name", "=", "null", ")", ":", "HttpRoute", "{", "return", "$", "this", "->", "handle", "(", "$", "path", ",", "$", "action", ",", "[", "'G...
Defines a new route that will intercept all HTTP requests @param string $path The path to match @param callable $action An action that will be executed @param string $name (optional) Route name @return HttpRoute
[ "Defines", "a", "new", "route", "that", "will", "intercept", "all", "HTTP", "requests" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouteCollector.php#L113-L116
32,736
opis-colibri/framework
src/ItemCollectors/RouteCollector.php
RouteCollector.handle
protected function handle(string $path, callable $action, $method, string $name = null): HttpRoute { if (!is_array($method)) { $method = [$method]; } /** @var HttpRoute $route */ $route = $this->data->createRoute($this->prefix . $path, $action, $name); $route->met...
php
protected function handle(string $path, callable $action, $method, string $name = null): HttpRoute { if (!is_array($method)) { $method = [$method]; } /** @var HttpRoute $route */ $route = $this->data->createRoute($this->prefix . $path, $action, $name); $route->met...
[ "protected", "function", "handle", "(", "string", "$", "path", ",", "callable", "$", "action", ",", "$", "method", ",", "string", "$", "name", "=", "null", ")", ":", "HttpRoute", "{", "if", "(", "!", "is_array", "(", "$", "method", ")", ")", "{", "...
Defines a new route @param string $path The path to match @param callable $action An action that will be executed @param string|array $method Request's method @param string $name (optional) Route name @return HttpRoute
[ "Defines", "a", "new", "route" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouteCollector.php#L198-L207
32,737
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.build
public function build($name, Request $request) { $ret = $this->factory->createItem($name); $menus = $this->loadRoots($request); if (!isset($menus[$name])) { return $ret; } $requestLocale = $request->get('_locale'); if (!isset($this->menus[$requestLocal...
php
public function build($name, Request $request) { $ret = $this->factory->createItem($name); $menus = $this->loadRoots($request); if (!isset($menus[$name])) { return $ret; } $requestLocale = $request->get('_locale'); if (!isset($this->menus[$requestLocal...
[ "public", "function", "build", "(", "$", "name", ",", "Request", "$", "request", ")", "{", "$", "ret", "=", "$", "this", "->", "factory", "->", "createItem", "(", "$", "name", ")", ";", "$", "menus", "=", "$", "this", "->", "loadRoots", "(", "$", ...
Create the menu based on the doctrine model. @param string $name @param \Symfony\Component\HttpFoundation\Request $request @return ItemInterface @throws \InvalidArgumentException
[ "Create", "the", "menu", "based", "on", "the", "doctrine", "model", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L103-L166
32,738
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.getRootItemByName
public function getRootItemByName($name, $request) { $menus = $this->loadRoots($request); if (!isset($menus[$name])) { return null; } return $this->menuItemEntity->find($menus[$name][0]); }
php
public function getRootItemByName($name, $request) { $menus = $this->loadRoots($request); if (!isset($menus[$name])) { return null; } return $this->menuItemEntity->find($menus[$name][0]); }
[ "public", "function", "getRootItemByName", "(", "$", "name", ",", "$", "request", ")", "{", "$", "menus", "=", "$", "this", "->", "loadRoots", "(", "$", "request", ")", ";", "if", "(", "!", "isset", "(", "$", "menus", "[", "$", "name", "]", ")", ...
Get the root item based on the specified name and request. @param string $name @param Request $request @return mixed
[ "Get", "the", "root", "item", "based", "on", "the", "specified", "name", "and", "request", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L175-L184
32,739
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.hasRootItemByName
public function hasRootItemByName($name, $request) { $menus = $this->loadRoots($request); return isset($menus[$name]); }
php
public function hasRootItemByName($name, $request) { $menus = $this->loadRoots($request); return isset($menus[$name]); }
[ "public", "function", "hasRootItemByName", "(", "$", "name", ",", "$", "request", ")", "{", "$", "menus", "=", "$", "this", "->", "loadRoots", "(", "$", "request", ")", ";", "return", "isset", "(", "$", "menus", "[", "$", "name", "]", ")", ";", "}"...
Check if a root item exists. @param string $name @param Request $request @return bool
[ "Check", "if", "a", "root", "item", "exists", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L193-L197
32,740
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.loadRoots
protected function loadRoots(Request $request) { $locale = $request->get('_locale', $this->defaultLocale); if (isset($this->roots[$locale])) { return $this->roots[$locale]; } $connection = $this->em->getConnection(); $where = 'lvl=0'; if ($locale) { ...
php
protected function loadRoots(Request $request) { $locale = $request->get('_locale', $this->defaultLocale); if (isset($this->roots[$locale])) { return $this->roots[$locale]; } $connection = $this->em->getConnection(); $where = 'lvl=0'; if ($locale) { ...
[ "protected", "function", "loadRoots", "(", "Request", "$", "request", ")", "{", "$", "locale", "=", "$", "request", "->", "get", "(", "'_locale'", ",", "$", "this", "->", "defaultLocale", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "roots", ...
Preload all roots for the specified locale. @param Request $request @return array
[ "Preload", "all", "roots", "for", "the", "specified", "locale", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L205-L237
32,741
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.addMenuItemHierarchy
public function addMenuItemHierarchy($request, $children, $parent) { $ret = 0; foreach ($children as $child) { $ret++; $item = $this->addMenuItem($request, $child, $parent); if (!empty($child['__children'])) { $ret += $this->addMenuItemHierarchy($r...
php
public function addMenuItemHierarchy($request, $children, $parent) { $ret = 0; foreach ($children as $child) { $ret++; $item = $this->addMenuItem($request, $child, $parent); if (!empty($child['__children'])) { $ret += $this->addMenuItemHierarchy($r...
[ "public", "function", "addMenuItemHierarchy", "(", "$", "request", ",", "$", "children", ",", "$", "parent", ")", "{", "$", "ret", "=", "0", ";", "foreach", "(", "$", "children", "as", "$", "child", ")", "{", "$", "ret", "++", ";", "$", "item", "="...
Add menu item hierarchy @param Request $request @param mixed $children @param ItemInterface $parent @return int
[ "Add", "menu", "item", "hierarchy" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L271-L282
32,742
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.addMenuItem
public function addMenuItem(Request $request, array $item, MenuItem $menu) { $attributes = array(); // if the menu item has a name, add it as a css class. if ($name = $item['name']) { $attributes['class'] = $name; } if (empty($item['path'])) { $uri = ...
php
public function addMenuItem(Request $request, array $item, MenuItem $menu) { $attributes = array(); // if the menu item has a name, add it as a css class. if ($name = $item['name']) { $attributes['class'] = $name; } if (empty($item['path'])) { $uri = ...
[ "public", "function", "addMenuItem", "(", "Request", "$", "request", ",", "array", "$", "item", ",", "MenuItem", "$", "menu", ")", "{", "$", "attributes", "=", "array", "(", ")", ";", "// if the menu item has a name, add it as a css class.", "if", "(", "$", "n...
Utility method to convert MenuItem's from the doctrine model to Knp MenuItems @param \Symfony\Component\HttpFoundation\Request $request @param array $item @param MenuItem $menu @return ItemInterface
[ "Utility", "method", "to", "convert", "MenuItem", "s", "from", "the", "doctrine", "model", "to", "Knp", "MenuItems" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L293-L325
32,743
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Menu/Builder.php
Builder.addGhostItem
public function addGhostItem(Request $request, $item) { $item->addChild( $this->factory->createItem( $item['id'], array( 'uri' => $request->getRequestUri(), 'display' => false, 'label' => $item['title'] ...
php
public function addGhostItem(Request $request, $item) { $item->addChild( $this->factory->createItem( $item['id'], array( 'uri' => $request->getRequestUri(), 'display' => false, 'label' => $item['title'] ...
[ "public", "function", "addGhostItem", "(", "Request", "$", "request", ",", "$", "item", ")", "{", "$", "item", "->", "addChild", "(", "$", "this", "->", "factory", "->", "createItem", "(", "$", "item", "[", "'id'", "]", ",", "array", "(", "'uri'", "=...
Adds an item on the fly that was not originally in the menu. @param \Symfony\Component\HttpFoundation\Request $request @param ItemInterface $item @return void
[ "Adds", "an", "item", "on", "the", "fly", "that", "was", "not", "originally", "in", "the", "menu", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Menu/Builder.php#L334-L346
32,744
SimplyCodedSoftware/integration-messaging
src/Messaging/Handler/Enricher/Converter/EnrichPayloadWithExpressionBuilder.php
EnrichPayloadWithExpressionBuilder.createWithMapping
public static function createWithMapping(string $propertyPath, string $expression, string $mappingExpression) : self { return new self($propertyPath, $expression, $mappingExpression); }
php
public static function createWithMapping(string $propertyPath, string $expression, string $mappingExpression) : self { return new self($propertyPath, $expression, $mappingExpression); }
[ "public", "static", "function", "createWithMapping", "(", "string", "$", "propertyPath", ",", "string", "$", "expression", ",", "string", "$", "mappingExpression", ")", ":", "self", "{", "return", "new", "self", "(", "$", "propertyPath", ",", "$", "expression"...
Enrich multiple paths @param string $propertyPath path to enriched context e.g. [orders][*][person] @param string $expression should return array, that will be mapped to set in property path e.g. payload @param string $mappingExpression when evaluates to true, then specific element is put in property path e.g. request...
[ "Enrich", "multiple", "paths" ]
d2d19c64f115adb554952962853a047d40be08bd
https://github.com/SimplyCodedSoftware/integration-messaging/blob/d2d19c64f115adb554952962853a047d40be08bd/src/Messaging/Handler/Enricher/Converter/EnrichPayloadWithExpressionBuilder.php#L81-L84
32,745
SimplyCodedSoftware/integration-messaging
src/Messaging/Handler/TypeDescriptor.php
TypeDescriptor.resolveGenericTypes
public function resolveGenericTypes() : array { if (!$this->isCollection()) { throw InvalidArgumentException::create("Can't resolve collection type on non collection"); } preg_match(self::COLLECTION_TYPE_REGEX, $this->type, $match); return [TypeDescriptor::create(trim($...
php
public function resolveGenericTypes() : array { if (!$this->isCollection()) { throw InvalidArgumentException::create("Can't resolve collection type on non collection"); } preg_match(self::COLLECTION_TYPE_REGEX, $this->type, $match); return [TypeDescriptor::create(trim($...
[ "public", "function", "resolveGenericTypes", "(", ")", ":", "array", "{", "if", "(", "!", "$", "this", "->", "isCollection", "(", ")", ")", "{", "throw", "InvalidArgumentException", "::", "create", "(", "\"Can't resolve collection type on non collection\"", ")", "...
Should be called only, if type descriptor is collection @return TypeDescriptor[] @throws InvalidArgumentException @throws \SimplyCodedSoftware\Messaging\MessagingException
[ "Should", "be", "called", "only", "if", "type", "descriptor", "is", "collection" ]
d2d19c64f115adb554952962853a047d40be08bd
https://github.com/SimplyCodedSoftware/integration-messaging/blob/d2d19c64f115adb554952962853a047d40be08bd/src/Messaging/Handler/TypeDescriptor.php#L182-L191
32,746
opis-colibri/framework
src/Application.php
Application.getHttpRouter
public function getHttpRouter(): HttpRouter { if ($this->httpRouter === null) { $this->httpRouter = new HttpRouter($this); } return $this->httpRouter; }
php
public function getHttpRouter(): HttpRouter { if ($this->httpRouter === null) { $this->httpRouter = new HttpRouter($this); } return $this->httpRouter; }
[ "public", "function", "getHttpRouter", "(", ")", ":", "HttpRouter", "{", "if", "(", "$", "this", "->", "httpRouter", "===", "null", ")", "{", "$", "this", "->", "httpRouter", "=", "new", "HttpRouter", "(", "$", "this", ")", ";", "}", "return", "$", "...
Get the HTTP router @return HttpRouter
[ "Get", "the", "HTTP", "router" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L237-L244
32,747
opis-colibri/framework
src/Application.php
Application.getContainer
public function getContainer(): Container { if ($this->containerInstance === null) { $this->containerInstance = $this->getCollector()->getContracts(); } return $this->containerInstance; }
php
public function getContainer(): Container { if ($this->containerInstance === null) { $this->containerInstance = $this->getCollector()->getContracts(); } return $this->containerInstance; }
[ "public", "function", "getContainer", "(", ")", ":", "Container", "{", "if", "(", "$", "this", "->", "containerInstance", "===", "null", ")", "{", "$", "this", "->", "containerInstance", "=", "$", "this", "->", "getCollector", "(", ")", "->", "getContracts...
Return the dependency injection container @return Container
[ "Return", "the", "dependency", "injection", "container" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L287-L294
32,748
opis-colibri/framework
src/Application.php
Application.getPlaceholder
public function getPlaceholder(): Placeholder { if ($this->placeholderInstance === null) { $this->placeholderInstance = new Placeholder(); } return $this->placeholderInstance; }
php
public function getPlaceholder(): Placeholder { if ($this->placeholderInstance === null) { $this->placeholderInstance = new Placeholder(); } return $this->placeholderInstance; }
[ "public", "function", "getPlaceholder", "(", ")", ":", "Placeholder", "{", "if", "(", "$", "this", "->", "placeholderInstance", "===", "null", ")", "{", "$", "this", "->", "placeholderInstance", "=", "new", "Placeholder", "(", ")", ";", "}", "return", "$",...
Get a placeholder object @return Placeholder
[ "Get", "a", "placeholder", "object" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L338-L345
32,749
opis-colibri/framework
src/Application.php
Application.getValidator
public function getValidator(): Validator { if ($this->validator === null) { $this->validator = new Validator(new ValidatorCollection(), $this->getPlaceholder()); } return $this->validator; }
php
public function getValidator(): Validator { if ($this->validator === null) { $this->validator = new Validator(new ValidatorCollection(), $this->getPlaceholder()); } return $this->validator; }
[ "public", "function", "getValidator", "(", ")", ":", "Validator", "{", "if", "(", "$", "this", "->", "validator", "===", "null", ")", "{", "$", "this", "->", "validator", "=", "new", "Validator", "(", "new", "ValidatorCollection", "(", ")", ",", "$", "...
Returns validator instance @return Validator
[ "Returns", "validator", "instance" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L352-L359
32,750
opis-colibri/framework
src/Application.php
Application.getCache
public function getCache(string $storage = 'default'): CacheInterface { if (!isset($this->cache[$storage])) { if ($storage === 'default') { if (!isset($this->implicit['cache'])) { throw new \RuntimeException('The default cache storage was not set'); ...
php
public function getCache(string $storage = 'default'): CacheInterface { if (!isset($this->cache[$storage])) { if ($storage === 'default') { if (!isset($this->implicit['cache'])) { throw new \RuntimeException('The default cache storage was not set'); ...
[ "public", "function", "getCache", "(", "string", "$", "storage", "=", "'default'", ")", ":", "CacheInterface", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "cache", "[", "$", "storage", "]", ")", ")", "{", "if", "(", "$", "storage", "===", ...
Returns a caching storage @param string $storage (optional) Storage name @return CacheInterface
[ "Returns", "a", "caching", "storage" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L368-L382
32,751
opis-colibri/framework
src/Application.php
Application.getSession
public function getSession(): ISession { if ($this->session === null) { if (!isset($this->implicit['session'])) { throw new \RuntimeException('The default session storage was not set'); } $this->session = new Session($this->getCollector()->getSessionHandle...
php
public function getSession(): ISession { if ($this->session === null) { if (!isset($this->implicit['session'])) { throw new \RuntimeException('The default session storage was not set'); } $this->session = new Session($this->getCollector()->getSessionHandle...
[ "public", "function", "getSession", "(", ")", ":", "ISession", "{", "if", "(", "$", "this", "->", "session", "===", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "implicit", "[", "'session'", "]", ")", ")", "{", "throw", "new",...
Returns a session storage @return ISession
[ "Returns", "a", "session", "storage" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L389-L399
32,752
opis-colibri/framework
src/Application.php
Application.getConfig
public function getConfig(string $driver = 'default'): IDataStore { if (!isset($this->config[$driver])) { if ($driver === 'default') { if (!isset($this->implicit['config'])) { throw new \RuntimeException('The default config storage was not set'); ...
php
public function getConfig(string $driver = 'default'): IDataStore { if (!isset($this->config[$driver])) { if ($driver === 'default') { if (!isset($this->implicit['config'])) { throw new \RuntimeException('The default config storage was not set'); ...
[ "public", "function", "getConfig", "(", "string", "$", "driver", "=", "'default'", ")", ":", "IDataStore", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "config", "[", "$", "driver", "]", ")", ")", "{", "if", "(", "$", "driver", "===", "'de...
Returns a config storage @param string $driver (optional) Driver's name @return IDataStore
[ "Returns", "a", "config", "storage" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L408-L422
32,753
opis-colibri/framework
src/Application.php
Application.getDatabase
public function getDatabase(string $connection = 'default'): Database { if (!isset($this->database[$connection])) { $this->database[$connection] = new Database($this->getConnection($connection)); } return $this->database[$connection]; }
php
public function getDatabase(string $connection = 'default'): Database { if (!isset($this->database[$connection])) { $this->database[$connection] = new Database($this->getConnection($connection)); } return $this->database[$connection]; }
[ "public", "function", "getDatabase", "(", "string", "$", "connection", "=", "'default'", ")", ":", "Database", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "database", "[", "$", "connection", "]", ")", ")", "{", "$", "this", "->", "database", ...
Returns a database abstraction layer @param string $connection (optional) Connection name @return Database
[ "Returns", "a", "database", "abstraction", "layer" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L458-L465
32,754
opis-colibri/framework
src/Application.php
Application.getEntityManager
public function getEntityManager(string $connection = 'default'): EntityManager { if (!isset($this->entityManager[$connection])) { $this->entityManager[$connection] = new EntityManager($this->getConnection($connection)); } return $this->entityManager[$connection]; }
php
public function getEntityManager(string $connection = 'default'): EntityManager { if (!isset($this->entityManager[$connection])) { $this->entityManager[$connection] = new EntityManager($this->getConnection($connection)); } return $this->entityManager[$connection]; }
[ "public", "function", "getEntityManager", "(", "string", "$", "connection", "=", "'default'", ")", ":", "EntityManager", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "entityManager", "[", "$", "connection", "]", ")", ")", "{", "$", "this", "->",...
Returns an entity manager @param string|null $connection (optional) Connection name @return EntityManager
[ "Returns", "an", "entity", "manager" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L486-L493
32,755
opis-colibri/framework
src/Application.php
Application.getLog
public function getLog(string $logger = 'default'): LoggerInterface { if (!isset($this->loggers[$logger])) { if ($logger === 'default') { if (!isset($this->implicit['logger'])) { throw new \RuntimeException('The default logger was not set'); } ...
php
public function getLog(string $logger = 'default'): LoggerInterface { if (!isset($this->loggers[$logger])) { if ($logger === 'default') { if (!isset($this->implicit['logger'])) { throw new \RuntimeException('The default logger was not set'); } ...
[ "public", "function", "getLog", "(", "string", "$", "logger", "=", "'default'", ")", ":", "LoggerInterface", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "loggers", "[", "$", "logger", "]", ")", ")", "{", "if", "(", "$", "logger", "===", "...
Returns a logger @param string $logger Logger's name @return LoggerInterface
[ "Returns", "a", "logger" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L502-L516
32,756
opis-colibri/framework
src/Application.php
Application.clearCachedObjects
public function clearCachedObjects() { $this->containerInstance = null; $this->eventDispatcher = null; $this->viewRenderer = null; $this->session = null; $this->httpRouter = null; $this->collectorList = null; $this->cache = []; $this->config = []; ...
php
public function clearCachedObjects() { $this->containerInstance = null; $this->eventDispatcher = null; $this->viewRenderer = null; $this->session = null; $this->httpRouter = null; $this->collectorList = null; $this->cache = []; $this->config = []; ...
[ "public", "function", "clearCachedObjects", "(", ")", "{", "$", "this", "->", "containerInstance", "=", "null", ";", "$", "this", "->", "eventDispatcher", "=", "null", ";", "$", "this", "->", "viewRenderer", "=", "null", ";", "$", "this", "->", "session", ...
Clear cached objects
[ "Clear", "cached", "objects" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L680-L694
32,757
opis-colibri/framework
src/Application.php
Application.enable
public function enable(Module $module, bool $recollect = true, bool $recursive = false): bool { $action = function (Module $module): bool { $installer = $module->installer(); if ($installer === null) { return true; } if (!class_exists($install...
php
public function enable(Module $module, bool $recollect = true, bool $recursive = false): bool { $action = function (Module $module): bool { $installer = $module->installer(); if ($installer === null) { return true; } if (!class_exists($install...
[ "public", "function", "enable", "(", "Module", "$", "module", ",", "bool", "$", "recollect", "=", "true", ",", "bool", "$", "recursive", "=", "false", ")", ":", "bool", "{", "$", "action", "=", "function", "(", "Module", "$", "module", ")", ":", "boo...
Enable a module @param Module $module @param boolean $recollect (optional) @param boolean $recursive (optional) @return boolean
[ "Enable", "a", "module" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L905-L960
32,758
opis-colibri/framework
src/Application.php
Application.disable
public function disable(Module $module, bool $recollect = true, bool $recursive = false): bool { $action = function (Module $module) { $installer = $module->installer(); if ($installer === null) { return true; } if (!class_exists($installer) |...
php
public function disable(Module $module, bool $recollect = true, bool $recursive = false): bool { $action = function (Module $module) { $installer = $module->installer(); if ($installer === null) { return true; } if (!class_exists($installer) |...
[ "public", "function", "disable", "(", "Module", "$", "module", ",", "bool", "$", "recollect", "=", "true", ",", "bool", "$", "recursive", "=", "false", ")", ":", "bool", "{", "$", "action", "=", "function", "(", "Module", "$", "module", ")", "{", "$"...
Disable a module @param Module $module @param boolean $recollect (optional) @param boolean $recursive (optional) @return boolean
[ "Disable", "a", "module" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Application.php#L971-L1022
32,759
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Manager/MenuManager.php
MenuManager.flush
public function flush($flushEntityManager = false) { $this->queue->rewind(); while ($this->queue->valid()) { list($item, $mode) = $this->queue->dequeue(); switch ($mode) { case self::REMOVE: if (($repo = $this->getRepository(get_class($ite...
php
public function flush($flushEntityManager = false) { $this->queue->rewind(); while ($this->queue->valid()) { list($item, $mode) = $this->queue->dequeue(); switch ($mode) { case self::REMOVE: if (($repo = $this->getRepository(get_class($ite...
[ "public", "function", "flush", "(", "$", "flushEntityManager", "=", "false", ")", "{", "$", "this", "->", "queue", "->", "rewind", "(", ")", ";", "while", "(", "$", "this", "->", "queue", "->", "valid", "(", ")", ")", "{", "list", "(", "$", "item",...
Registers a menu item to remove @param bool $flushEntityManager
[ "Registers", "a", "menu", "item", "to", "remove" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Manager/MenuManager.php#L71-L95
32,760
spiral/reactor
src/ClassDeclaration.php
ClassDeclaration.setInterfaces
public function setInterfaces(array $interfaces): ClassDeclaration { $this->interfaces = []; foreach ($interfaces as $interface) { $this->addInterface($interface); } return $this; }
php
public function setInterfaces(array $interfaces): ClassDeclaration { $this->interfaces = []; foreach ($interfaces as $interface) { $this->addInterface($interface); } return $this; }
[ "public", "function", "setInterfaces", "(", "array", "$", "interfaces", ")", ":", "ClassDeclaration", "{", "$", "this", "->", "interfaces", "=", "[", "]", ";", "foreach", "(", "$", "interfaces", "as", "$", "interface", ")", "{", "$", "this", "->", "addIn...
Declare class interfaces. @param array $interfaces @return self
[ "Declare", "class", "interfaces", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/ClassDeclaration.php#L125-L133
32,761
spiral/reactor
src/ClassDeclaration.php
ClassDeclaration.setTraits
public function setTraits(array $traits): ClassDeclaration { $this->traits = []; foreach ($traits as $trait) { $this->addTrait($trait); } return $this; }
php
public function setTraits(array $traits): ClassDeclaration { $this->traits = []; foreach ($traits as $trait) { $this->addTrait($trait); } return $this; }
[ "public", "function", "setTraits", "(", "array", "$", "traits", ")", ":", "ClassDeclaration", "{", "$", "this", "->", "traits", "=", "[", "]", ";", "foreach", "(", "$", "traits", "as", "$", "trait", ")", "{", "$", "this", "->", "addTrait", "(", "$", ...
Declare class traits. @param array $traits @return self
[ "Declare", "class", "traits", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/ClassDeclaration.php#L188-L196
32,762
spiral/reactor
src/Partial/Property.php
Property.mountIndents
private function mountIndents(string $serialized, int $indentLevel): string { $lines = explode("\n", $serialized); foreach ($lines as &$line) { $line = $this->addIndent($line, $indentLevel); unset($line); } return ltrim(join("\n", $lines)); }
php
private function mountIndents(string $serialized, int $indentLevel): string { $lines = explode("\n", $serialized); foreach ($lines as &$line) { $line = $this->addIndent($line, $indentLevel); unset($line); } return ltrim(join("\n", $lines)); }
[ "private", "function", "mountIndents", "(", "string", "$", "serialized", ",", "int", "$", "indentLevel", ")", ":", "string", "{", "$", "lines", "=", "explode", "(", "\"\\n\"", ",", "$", "serialized", ")", ";", "foreach", "(", "$", "lines", "as", "&", "...
Mount indentation to value. Attention, to be applied to arrays only! @param string $serialized @param int $indentLevel @return string
[ "Mount", "indentation", "to", "value", ".", "Attention", "to", "be", "applied", "to", "arrays", "only!" ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Partial/Property.php#L143-L152
32,763
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Twig/Extension.php
Extension.activeTrail
public function activeTrail($item) { if (is_null($item)) { return null; } if (!$item instanceof MenuItem) { throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item))); } $stack = array(); do {...
php
public function activeTrail($item) { if (is_null($item)) { return null; } if (!$item instanceof MenuItem) { throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item))); } $stack = array(); do {...
[ "public", "function", "activeTrail", "(", "$", "item", ")", "{", "if", "(", "is_null", "(", "$", "item", ")", ")", "{", "return", "null", ";", "}", "if", "(", "!", "$", "item", "instanceof", "MenuItem", ")", "{", "throw", "new", "\\", "UnexpectedValu...
Returns the active trail for the given menuItem @param MenuItem|null $item @return array
[ "Returns", "the", "active", "trail", "for", "the", "given", "menuItem" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Twig/Extension.php#L90-L107
32,764
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Twig/Extension.php
Extension.current
public function current($item, $level = null) { if (is_null($item)) { return null; } if (!$item instanceof MenuItem) { throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item))); } /** @var MenuItem $c...
php
public function current($item, $level = null) { if (is_null($item)) { return null; } if (!$item instanceof MenuItem) { throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item))); } /** @var MenuItem $c...
[ "public", "function", "current", "(", "$", "item", ",", "$", "level", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "item", ")", ")", "{", "return", "null", ";", "}", "if", "(", "!", "$", "item", "instanceof", "MenuItem", ")", "{", "thro...
Returns the current menu item given a root menu item @param MenuItem|null $item @param int $level @return MenuItem|null
[ "Returns", "the", "current", "menu", "item", "given", "a", "root", "menu", "item" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Twig/Extension.php#L116-L148
32,765
spiral/reactor
src/Serializer.php
Serializer.serialize
public function serialize($value): string { if (is_array($value)) { return $this->packArray($value); } return $this->packValue($value); }
php
public function serialize($value): string { if (is_array($value)) { return $this->packArray($value); } return $this->packValue($value); }
[ "public", "function", "serialize", "(", "$", "value", ")", ":", "string", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "return", "$", "this", "->", "packArray", "(", "$", "value", ")", ";", "}", "return", "$", "this", "->", "packVa...
Serialize array. @param mixed $value @return string
[ "Serialize", "array", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Serializer.php#L32-L39
32,766
spiral/reactor
src/Serializer.php
Serializer.packValue
protected function packValue($value): string { if ($value instanceof DeclarationInterface) { //No indentation here return $value->render(); } if (is_null($value)) { return "null"; } if (is_bool($value)) { return ($value ? "tru...
php
protected function packValue($value): string { if ($value instanceof DeclarationInterface) { //No indentation here return $value->render(); } if (is_null($value)) { return "null"; } if (is_bool($value)) { return ($value ? "tru...
[ "protected", "function", "packValue", "(", "$", "value", ")", ":", "string", "{", "if", "(", "$", "value", "instanceof", "DeclarationInterface", ")", "{", "//No indentation here", "return", "$", "value", "->", "render", "(", ")", ";", "}", "if", "(", "is_n...
Pack array key value into string. @param mixed $value @return string @throws SerializeException
[ "Pack", "array", "key", "value", "into", "string", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Serializer.php#L101-L132
32,767
opis-colibri/framework
src/ItemCollectors/EventHandlerCollector.php
EventHandlerCollector.handle
public function handle(string $event, callable $callback): Route { $route = $this->data ->createRoute($event, $callback) ->set('priority', $this->crtPriority); $this->data->sort(); return $route; }
php
public function handle(string $event, callable $callback): Route { $route = $this->data ->createRoute($event, $callback) ->set('priority', $this->crtPriority); $this->data->sort(); return $route; }
[ "public", "function", "handle", "(", "string", "$", "event", ",", "callable", "$", "callback", ")", ":", "Route", "{", "$", "route", "=", "$", "this", "->", "data", "->", "createRoute", "(", "$", "event", ",", "$", "callback", ")", "->", "set", "(", ...
Register a new event handler @param string $event Event name @param callable $callback A callback that will be executed @return Route
[ "Register", "a", "new", "event", "handler" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/EventHandlerCollector.php#L45-L54
32,768
opis-colibri/framework
src/ItemCollectors/ViewEngineCollector.php
ViewEngineCollector.register
public function register(callable $factory): self { $this->data->register($factory, $this->crtPriority); return $this; }
php
public function register(callable $factory): self { $this->data->register($factory, $this->crtPriority); return $this; }
[ "public", "function", "register", "(", "callable", "$", "factory", ")", ":", "self", "{", "$", "this", "->", "data", "->", "register", "(", "$", "factory", ",", "$", "this", "->", "crtPriority", ")", ";", "return", "$", "this", ";", "}" ]
Defines a new view engine @param callable $factory @return ViewEngineCollector
[ "Defines", "a", "new", "view", "engine" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/ViewEngineCollector.php#L43-L47
32,769
spiral/reactor
src/Aggregator.php
Aggregator.has
public function has(string $name): bool { foreach ($this->elements as $element) { if ($element instanceof NamedInterface && $element->getName() == $name) { return true; } } return false; }
php
public function has(string $name): bool { foreach ($this->elements as $element) { if ($element instanceof NamedInterface && $element->getName() == $name) { return true; } } return false; }
[ "public", "function", "has", "(", "string", "$", "name", ")", ":", "bool", "{", "foreach", "(", "$", "this", "->", "elements", "as", "$", "element", ")", "{", "if", "(", "$", "element", "instanceof", "NamedInterface", "&&", "$", "element", "->", "getNa...
Check if aggregation has named element with given name. @param string $name @return bool
[ "Check", "if", "aggregation", "has", "named", "element", "with", "given", "name", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Aggregator.php#L67-L76
32,770
spiral/reactor
src/Aggregator.php
Aggregator.add
public function add(DeclarationInterface $element): Aggregator { $reflector = new \ReflectionObject($element); $allowed = false; foreach ($this->allowed as $class) { if ($reflector->isSubclassOf($class) || get_class($element) == $class) { $allowed = true; ...
php
public function add(DeclarationInterface $element): Aggregator { $reflector = new \ReflectionObject($element); $allowed = false; foreach ($this->allowed as $class) { if ($reflector->isSubclassOf($class) || get_class($element) == $class) { $allowed = true; ...
[ "public", "function", "add", "(", "DeclarationInterface", "$", "element", ")", ":", "Aggregator", "{", "$", "reflector", "=", "new", "\\", "ReflectionObject", "(", "$", "element", ")", ";", "$", "allowed", "=", "false", ";", "foreach", "(", "$", "this", ...
Add new element. @param DeclarationInterface $element @return self @throws ReactorException
[ "Add", "new", "element", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Aggregator.php#L86-L106
32,771
spiral/reactor
src/Aggregator.php
Aggregator.remove
public function remove(string $name): Aggregator { foreach ($this->elements as $index => $element) { if ($element instanceof NamedInterface && $element->getName() == $name) { unset($this->elements[$index]); } } return $this; }
php
public function remove(string $name): Aggregator { foreach ($this->elements as $index => $element) { if ($element instanceof NamedInterface && $element->getName() == $name) { unset($this->elements[$index]); } } return $this; }
[ "public", "function", "remove", "(", "string", "$", "name", ")", ":", "Aggregator", "{", "foreach", "(", "$", "this", "->", "elements", "as", "$", "index", "=>", "$", "element", ")", "{", "if", "(", "$", "element", "instanceof", "NamedInterface", "&&", ...
Remove element by it's name. @param string $name @return self
[ "Remove", "element", "by", "it", "s", "name", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Aggregator.php#L129-L138
32,772
opis-colibri/framework
src/Collector/Manager.php
Manager.recollect
public function recollect(bool $fresh = true): bool { if (!$this->app->getCache()->clear()) { return false; } $this->collectorsIncluded = false; $list = $this->app->getCollectorList($fresh); if ($fresh) { $this->cache = []; $this->app->cl...
php
public function recollect(bool $fresh = true): bool { if (!$this->app->getCache()->clear()) { return false; } $this->collectorsIncluded = false; $list = $this->app->getCollectorList($fresh); if ($fresh) { $this->cache = []; $this->app->cl...
[ "public", "function", "recollect", "(", "bool", "$", "fresh", "=", "true", ")", ":", "bool", "{", "if", "(", "!", "$", "this", "->", "app", "->", "getCache", "(", ")", "->", "clear", "(", ")", ")", "{", "return", "false", ";", "}", "$", "this", ...
Recollect all items @param bool $fresh (optional) @return bool
[ "Recollect", "all", "items" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Collector/Manager.php#L331-L358
32,773
opis-colibri/framework
src/Collector/Manager.php
Manager.register
public function register(string $name, string $class, string $description, array $options = []) { $name = strtolower($name); $this->app->getConfig()->write('collectors.' . $name, [ 'class' => $class, 'description' => $description, 'options' => $options, ]...
php
public function register(string $name, string $class, string $description, array $options = []) { $name = strtolower($name); $this->app->getConfig()->write('collectors.' . $name, [ 'class' => $class, 'description' => $description, 'options' => $options, ]...
[ "public", "function", "register", "(", "string", "$", "name", ",", "string", "$", "class", ",", "string", "$", "description", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "name", "=", "strtolower", "(", "$", "name", ")", ";", "$", "t...
Register a new collector @param string $name @param string $class @param string $description @param array $options
[ "Register", "a", "new", "collector" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Collector/Manager.php#L368-L379
32,774
spiral/reactor
src/Traits/CommentTrait.php
CommentTrait.setComment
public function setComment($comment): self { if (!empty($comment)) { if (is_array($comment)) { $this->docComment->setLines($comment); } elseif (is_string($comment)) { $this->docComment->setString($comment); } } return $this...
php
public function setComment($comment): self { if (!empty($comment)) { if (is_array($comment)) { $this->docComment->setLines($comment); } elseif (is_string($comment)) { $this->docComment->setString($comment); } } return $this...
[ "public", "function", "setComment", "(", "$", "comment", ")", ":", "self", "{", "if", "(", "!", "empty", "(", "$", "comment", ")", ")", "{", "if", "(", "is_array", "(", "$", "comment", ")", ")", "{", "$", "this", "->", "docComment", "->", "setLines...
Set comment value. @param string|array $comment @return $this
[ "Set", "comment", "value", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Traits/CommentTrait.php#L41-L52
32,775
spiral/reactor
src/Traits/CommentTrait.php
CommentTrait.initComment
private function initComment($comment) { if (empty($this->docComment)) { $this->docComment = new Comment(); } $this->setComment($comment); }
php
private function initComment($comment) { if (empty($this->docComment)) { $this->docComment = new Comment(); } $this->setComment($comment); }
[ "private", "function", "initComment", "(", "$", "comment", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "docComment", ")", ")", "{", "$", "this", "->", "docComment", "=", "new", "Comment", "(", ")", ";", "}", "$", "this", "->", "setComment",...
Init comment value. @param string|array $comment
[ "Init", "comment", "value", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Traits/CommentTrait.php#L59-L66
32,776
SimplyCodedSoftware/integration-messaging
src/Amqp/AmqpQueue.php
AmqpQueue.withArgument
public function withArgument(string $name, $value) : self { $this->enqueueQueue->setArgument($name, $value); return $this; }
php
public function withArgument(string $name, $value) : self { $this->enqueueQueue->setArgument($name, $value); return $this; }
[ "public", "function", "withArgument", "(", "string", "$", "name", ",", "$", "value", ")", ":", "self", "{", "$", "this", "->", "enqueueQueue", "->", "setArgument", "(", "$", "name", ",", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
optional, used by plugins and broker-specific features such as message TTL, queue length limit, etc @param string $name @param $value @return AmqpQueue
[ "optional", "used", "by", "plugins", "and", "broker", "-", "specific", "features", "such", "as", "message", "TTL", "queue", "length", "limit", "etc" ]
d2d19c64f115adb554952962853a047d40be08bd
https://github.com/SimplyCodedSoftware/integration-messaging/blob/d2d19c64f115adb554952962853a047d40be08bd/src/Amqp/AmqpQueue.php#L110-L115
32,777
SimplyCodedSoftware/integration-messaging
src/DomainModel/Config/AggregateMessagingModule.php
AggregateMessagingModule.create
public static function create(AnnotationRegistrationService $annotationRegistrationService): AnnotationModule { return new self( ParameterConverterAnnotationFactory::create(), $annotationRegistrationService->findRegistrationsFor(Aggregate::class, CommandHandler::class), $...
php
public static function create(AnnotationRegistrationService $annotationRegistrationService): AnnotationModule { return new self( ParameterConverterAnnotationFactory::create(), $annotationRegistrationService->findRegistrationsFor(Aggregate::class, CommandHandler::class), $...
[ "public", "static", "function", "create", "(", "AnnotationRegistrationService", "$", "annotationRegistrationService", ")", ":", "AnnotationModule", "{", "return", "new", "self", "(", "ParameterConverterAnnotationFactory", "::", "create", "(", ")", ",", "$", "annotationR...
In here we should provide messaging component for module @inheritDoc
[ "In", "here", "we", "should", "provide", "messaging", "component", "for", "module" ]
d2d19c64f115adb554952962853a047d40be08bd
https://github.com/SimplyCodedSoftware/integration-messaging/blob/d2d19c64f115adb554952962853a047d40be08bd/src/DomainModel/Config/AggregateMessagingModule.php#L110-L121
32,778
opis-colibri/framework
src/Util/Mutex.php
Mutex.lock
public function lock(bool $wait = true): bool { if ($this->fp === null) { $this->fp = fopen($this->file, 'r'); } return flock($this->fp, $wait ? LOCK_EX : LOCK_EX | LOCK_NB); }
php
public function lock(bool $wait = true): bool { if ($this->fp === null) { $this->fp = fopen($this->file, 'r'); } return flock($this->fp, $wait ? LOCK_EX : LOCK_EX | LOCK_NB); }
[ "public", "function", "lock", "(", "bool", "$", "wait", "=", "true", ")", ":", "bool", "{", "if", "(", "$", "this", "->", "fp", "===", "null", ")", "{", "$", "this", "->", "fp", "=", "fopen", "(", "$", "this", "->", "file", ",", "'r'", ")", "...
Acquire the mutex @param bool $wait @return boolean
[ "Acquire", "the", "mutex" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/Util/Mutex.php#L69-L76
32,779
spiral/reactor
src/Partial/Parameter.php
Parameter.setDefaultValue
public function setDefaultValue($defaultValue): Parameter { $this->isOptional = true; $this->defaultValue = $defaultValue; return $this; }
php
public function setDefaultValue($defaultValue): Parameter { $this->isOptional = true; $this->defaultValue = $defaultValue; return $this; }
[ "public", "function", "setDefaultValue", "(", "$", "defaultValue", ")", ":", "Parameter", "{", "$", "this", "->", "isOptional", "=", "true", ";", "$", "this", "->", "defaultValue", "=", "$", "defaultValue", ";", "return", "$", "this", ";", "}" ]
Set parameter default value. @param mixed $defaultValue @return self
[ "Set", "parameter", "default", "value", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Partial/Parameter.php#L113-L119
32,780
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Security/Authorization/MenuVoter.php
MenuVoter.userIsAllowed
protected function userIsAllowed(TokenInterface $token) { /** @var \Symfony\Component\Security\Core\Role\RoleInterface $role */ foreach ($this->hierarchy->getReachableRoles($token->getRoles()) as $role) { if ($role->getRole() === self::ROLE_ADMIN_MENU_ITEM) { return true;...
php
protected function userIsAllowed(TokenInterface $token) { /** @var \Symfony\Component\Security\Core\Role\RoleInterface $role */ foreach ($this->hierarchy->getReachableRoles($token->getRoles()) as $role) { if ($role->getRole() === self::ROLE_ADMIN_MENU_ITEM) { return true;...
[ "protected", "function", "userIsAllowed", "(", "TokenInterface", "$", "token", ")", "{", "/** @var \\Symfony\\Component\\Security\\Core\\Role\\RoleInterface $role */", "foreach", "(", "$", "this", "->", "hierarchy", "->", "getReachableRoles", "(", "$", "token", "->", "get...
Calculate whether the current token is allowed. @param TokenInterface $token @return bool
[ "Calculate", "whether", "the", "current", "token", "is", "allowed", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Security/Authorization/MenuVoter.php#L95-L104
32,781
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php
MenuItemNameUrlProvider.supports
public function supports($name) { if (!isset($this->loaded[$this->router->getContext()->getParameter('_locale')])) { $this->loadMappings(); $this->loaded[$this->router->getContext()->getParameter('_locale')] = true; } return parent::supports($name); }
php
public function supports($name) { if (!isset($this->loaded[$this->router->getContext()->getParameter('_locale')])) { $this->loadMappings(); $this->loaded[$this->router->getContext()->getParameter('_locale')] = true; } return parent::supports($name); }
[ "public", "function", "supports", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "loaded", "[", "$", "this", "->", "router", "->", "getContext", "(", ")", "->", "getParameter", "(", "'_locale'", ")", "]", ")", ")", "{"...
If it supports the given name @param mixed $name @return bool|mixed
[ "If", "it", "supports", "the", "given", "name" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php#L46-L54
32,782
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php
MenuItemNameUrlProvider.loadMappings
protected function loadMappings() { // using a subquery to allow for FETCH_KEY_PAIR $query = ' SELECT name, path FROM ( SELECT menu_item.name, menu_item.path, COALESCE(menu_item.langua...
php
protected function loadMappings() { // using a subquery to allow for FETCH_KEY_PAIR $query = ' SELECT name, path FROM ( SELECT menu_item.name, menu_item.path, COALESCE(menu_item.langua...
[ "protected", "function", "loadMappings", "(", ")", "{", "// using a subquery to allow for FETCH_KEY_PAIR", "$", "query", "=", "'\n SELECT\n name, path\n FROM (\n SELECT\n menu_item.name,\n menu_item.path,\n...
Loads all mappings from the url, based on the current request locale.
[ "Loads", "all", "mappings", "from", "the", "url", "based", "on", "the", "current", "request", "locale", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php#L59-L84
32,783
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php
MenuItemNameUrlProvider.suggest
public function suggest($pattern) { $menuItems = $this->repository->createQueryBuilder('m') ->andWhere('m.name LIKE :pattern') ->getQuery() ->execute(array('pattern' => '%' . $pattern . '%')); $suggestions = array(); foreach ($menuItems as $item) { ...
php
public function suggest($pattern) { $menuItems = $this->repository->createQueryBuilder('m') ->andWhere('m.name LIKE :pattern') ->getQuery() ->execute(array('pattern' => '%' . $pattern . '%')); $suggestions = array(); foreach ($menuItems as $item) { ...
[ "public", "function", "suggest", "(", "$", "pattern", ")", "{", "$", "menuItems", "=", "$", "this", "->", "repository", "->", "createQueryBuilder", "(", "'m'", ")", "->", "andWhere", "(", "'m.name LIKE :pattern'", ")", "->", "getQuery", "(", ")", "->", "ex...
Suggest url's based on the passed pattern. The return value must be an array containing "label" and "value" keys. @param string $pattern @return mixed
[ "Suggest", "url", "s", "based", "on", "the", "passed", "pattern", ".", "The", "return", "value", "must", "be", "an", "array", "containing", "label", "and", "value", "keys", "." ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php#L92-L108
32,784
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Form/Subscriber/MenuItemPersistenceSubscriber.php
MenuItemPersistenceSubscriber.postSetData
public function postSetData(FormEvent $e) { if ($e->getData() === null) { return; } // Checks if the form has a given property // A property can be removed in a child class but the eventSubscriber still exists if (!$e->getForm()->has($this->property)) { ...
php
public function postSetData(FormEvent $e) { if ($e->getData() === null) { return; } // Checks if the form has a given property // A property can be removed in a child class but the eventSubscriber still exists if (!$e->getForm()->has($this->property)) { ...
[ "public", "function", "postSetData", "(", "FormEvent", "$", "e", ")", "{", "if", "(", "$", "e", "->", "getData", "(", ")", "===", "null", ")", "{", "return", ";", "}", "// Checks if the form has a given property", "// A property can be removed in a child class but t...
POST_SET_DATA event handler @param FormEvent $e @return void
[ "POST_SET_DATA", "event", "handler" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Form/Subscriber/MenuItemPersistenceSubscriber.php#L52-L69
32,785
opis-colibri/framework
src/ItemCollectors/RouterGlobalsCollector.php
RouterGlobalsCollector.mixin
public function mixin(string $name, callable $callback): self { $this->data->mixin($name, $callback); return $this; }
php
public function mixin(string $name, callable $callback): self { $this->data->mixin($name, $callback); return $this; }
[ "public", "function", "mixin", "(", "string", "$", "name", ",", "callable", "$", "callback", ")", ":", "self", "{", "$", "this", "->", "data", "->", "mixin", "(", "$", "name", ",", "$", "callback", ")", ";", "return", "$", "this", ";", "}" ]
Set a global mixin @param string $name @param callable $callback @return $this
[ "Set", "a", "global", "mixin" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouterGlobalsCollector.php#L44-L48
32,786
opis-colibri/framework
src/ItemCollectors/RouterGlobalsCollector.php
RouterGlobalsCollector.bind
public function bind(string $name, callable $callback): self { $this->data->bind($name, $callback); return $this; }
php
public function bind(string $name, callable $callback): self { $this->data->bind($name, $callback); return $this; }
[ "public", "function", "bind", "(", "string", "$", "name", ",", "callable", "$", "callback", ")", ":", "self", "{", "$", "this", "->", "data", "->", "bind", "(", "$", "name", ",", "$", "callback", ")", ";", "return", "$", "this", ";", "}" ]
Defines a global binding @param string $name The name of the binding @param callable $callback A callback that will return the binding's value @return $this
[ "Defines", "a", "global", "binding" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouterGlobalsCollector.php#L58-L62
32,787
opis-colibri/framework
src/ItemCollectors/RouterGlobalsCollector.php
RouterGlobalsCollector.callback
public function callback(string $name, callable $callback): self { $this->data->callback($name, $callback); return $this; }
php
public function callback(string $name, callable $callback): self { $this->data->callback($name, $callback); return $this; }
[ "public", "function", "callback", "(", "string", "$", "name", ",", "callable", "$", "callback", ")", ":", "self", "{", "$", "this", "->", "data", "->", "callback", "(", "$", "name", ",", "$", "callback", ")", ";", "return", "$", "this", ";", "}" ]
Defines a global callback @param string $name The name of the callback @param callable $callback A callback @return $this
[ "Defines", "a", "global", "callback" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouterGlobalsCollector.php#L72-L76
32,788
opis-colibri/framework
src/ItemCollectors/RouterGlobalsCollector.php
RouterGlobalsCollector.implicit
public function implicit(string $name, $value): self { $this->data->implicit($name, $value); return $this; }
php
public function implicit(string $name, $value): self { $this->data->implicit($name, $value); return $this; }
[ "public", "function", "implicit", "(", "string", "$", "name", ",", "$", "value", ")", ":", "self", "{", "$", "this", "->", "data", "->", "implicit", "(", "$", "name", ",", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
Set a global implicit value for a wildcard @param string $name The name of the wildcard @param mixed $value The implicit value @return $this
[ "Set", "a", "global", "implicit", "value", "for", "a", "wildcard" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouterGlobalsCollector.php#L86-L90
32,789
opis-colibri/framework
src/ItemCollectors/RouterGlobalsCollector.php
RouterGlobalsCollector.placeholder
public function placeholder(string $name, string $value): self { $this->data->placeholder($name, $value); return $this; }
php
public function placeholder(string $name, string $value): self { $this->data->placeholder($name, $value); return $this; }
[ "public", "function", "placeholder", "(", "string", "$", "name", ",", "string", "$", "value", ")", ":", "self", "{", "$", "this", "->", "data", "->", "placeholder", "(", "$", "name", ",", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
Set a global placeholder @param string $name The name of the wildcard @param string $value A regex expression @return $this
[ "Set", "a", "global", "placeholder" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/RouterGlobalsCollector.php#L100-L104
32,790
opis-colibri/framework
src/ItemCollectors/ViewCollector.php
ViewCollector.handle
public function handle(string $pattern, callable $resolver): Route { $route = $this->data ->createRoute($pattern, $resolver) ->set('priority', $this->crtPriority); $this->data->sort(); return $route; }
php
public function handle(string $pattern, callable $resolver): Route { $route = $this->data ->createRoute($pattern, $resolver) ->set('priority', $this->crtPriority); $this->data->sort(); return $route; }
[ "public", "function", "handle", "(", "string", "$", "pattern", ",", "callable", "$", "resolver", ")", ":", "Route", "{", "$", "route", "=", "$", "this", "->", "data", "->", "createRoute", "(", "$", "pattern", ",", "$", "resolver", ")", "->", "set", "...
Defines a new view route @param string $pattern View's pattern @param callable $resolver A callback that will resolve a view route into a path @return Route
[ "Defines", "a", "new", "view", "route" ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/ViewCollector.php#L46-L55
32,791
spiral/reactor
src/NamespaceDeclaration.php
NamespaceDeclaration.addElement
public function addElement(DeclarationInterface $element): NamespaceDeclaration { $this->elements->add($element); if ($element instanceof DependedInterface) { $this->addUses($element->getDependencies()); } return $this; }
php
public function addElement(DeclarationInterface $element): NamespaceDeclaration { $this->elements->add($element); if ($element instanceof DependedInterface) { $this->addUses($element->getDependencies()); } return $this; }
[ "public", "function", "addElement", "(", "DeclarationInterface", "$", "element", ")", ":", "NamespaceDeclaration", "{", "$", "this", "->", "elements", "->", "add", "(", "$", "element", ")", ";", "if", "(", "$", "element", "instanceof", "DependedInterface", ")"...
Method will automatically mount requested uses is any. @param DeclarationInterface $element @return self @throws Exception\ReactorException
[ "Method", "will", "automatically", "mount", "requested", "uses", "is", "any", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/NamespaceDeclaration.php#L54-L62
32,792
opis-colibri/framework
src/ItemCollectors/ContractCollector.php
ContractCollector.alias
public function alias(string $alias, string $concrete): self { $this->data->alias($alias, $concrete); return $this; }
php
public function alias(string $alias, string $concrete): self { $this->data->alias($alias, $concrete); return $this; }
[ "public", "function", "alias", "(", "string", "$", "alias", ",", "string", "$", "concrete", ")", ":", "self", "{", "$", "this", "->", "data", "->", "alias", "(", "$", "alias", ",", "$", "concrete", ")", ";", "return", "$", "this", ";", "}" ]
Alias a type. @param string $alias An alias for the specified class or interface @param string $concrete Concrete class or interface name @return self Self reference
[ "Alias", "a", "type", "." ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/ContractCollector.php#L60-L64
32,793
opis-colibri/framework
src/ItemCollectors/ContractCollector.php
ContractCollector.singleton
public function singleton(string $abstract, $concrete = null, array $arguments = []): self { $this->data->singleton($abstract, $concrete, $arguments); return $this; }
php
public function singleton(string $abstract, $concrete = null, array $arguments = []): self { $this->data->singleton($abstract, $concrete, $arguments); return $this; }
[ "public", "function", "singleton", "(", "string", "$", "abstract", ",", "$", "concrete", "=", "null", ",", "array", "$", "arguments", "=", "[", "]", ")", ":", "self", "{", "$", "this", "->", "data", "->", "singleton", "(", "$", "abstract", ",", "$", ...
Register a singleton binding with the container. @param string $abstract Class name or interface name @param string|callable|null $concrete @param array $arguments @return self
[ "Register", "a", "singleton", "binding", "with", "the", "container", "." ]
22b2f0ed31876a05c9a7813c6881d2ba2b5039b8
https://github.com/opis-colibri/framework/blob/22b2f0ed31876a05c9a7813c6881d2ba2b5039b8/src/ItemCollectors/ContractCollector.php#L88-L92
32,794
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Provider/DatabaseMenuProvider.php
DatabaseMenuProvider.get
public function get($name, array $options = array()) { return $this->builder->build($name, $this->container->get('request_stack')->getCurrentRequest()); }
php
public function get($name, array $options = array()) { return $this->builder->build($name, $this->container->get('request_stack')->getCurrentRequest()); }
[ "public", "function", "get", "(", "$", "name", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "return", "$", "this", "->", "builder", "->", "build", "(", "$", "name", ",", "$", "this", "->", "container", "->", "get", "(", "'request...
Retrieves a menu by its name @param string $name @param array $options @return \Knp\Menu\ItemInterface @throws \InvalidArgumentException if the menu does not exists
[ "Retrieves", "a", "menu", "by", "its", "name" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Provider/DatabaseMenuProvider.php#L51-L54
32,795
zicht/menu-bundle
src/Zicht/Bundle/MenuBundle/Provider/DatabaseMenuProvider.php
DatabaseMenuProvider.has
public function has($name, array $options = array()) { $root = $this->builder->hasRootItemByName($name, $this->container->get('request_stack')->getCurrentRequest()); return null !== $root; }
php
public function has($name, array $options = array()) { $root = $this->builder->hasRootItemByName($name, $this->container->get('request_stack')->getCurrentRequest()); return null !== $root; }
[ "public", "function", "has", "(", "$", "name", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "root", "=", "$", "this", "->", "builder", "->", "hasRootItemByName", "(", "$", "name", ",", "$", "this", "->", "container", "->", "...
Checks whether a menu exists in this provider @param string $name @param array $options @return bool
[ "Checks", "whether", "a", "menu", "exists", "in", "this", "provider" ]
b6f22d50025297ad686c8f3afb7b6afe736b7f97
https://github.com/zicht/menu-bundle/blob/b6f22d50025297ad686c8f3afb7b6afe736b7f97/src/Zicht/Bundle/MenuBundle/Provider/DatabaseMenuProvider.php#L63-L68
32,796
SimplyCodedSoftware/integration-messaging
src/Amqp/AmqpExchange.php
AmqpExchange.withArgument
public function withArgument(string $name, $value) : self { $this->enqueueExchange->setArgument($name, $value); return $this; }
php
public function withArgument(string $name, $value) : self { $this->enqueueExchange->setArgument($name, $value); return $this; }
[ "public", "function", "withArgument", "(", "string", "$", "name", ",", "$", "value", ")", ":", "self", "{", "$", "this", "->", "enqueueExchange", "->", "setArgument", "(", "$", "name", ",", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
optional, used by plugins and broker-specific features @param string $name @param $value @return AmqpExchange
[ "optional", "used", "by", "plugins", "and", "broker", "-", "specific", "features" ]
d2d19c64f115adb554952962853a047d40be08bd
https://github.com/SimplyCodedSoftware/integration-messaging/blob/d2d19c64f115adb554952962853a047d40be08bd/src/Amqp/AmqpExchange.php#L72-L77
32,797
spiral/reactor
src/Partial/Method.php
Method.setSource
public function setSource($source): Method { if (!empty($source)) { if (is_array($source)) { $this->source->setLines($source); } elseif (is_string($source)) { $this->source->setString($source); } } return $this; }
php
public function setSource($source): Method { if (!empty($source)) { if (is_array($source)) { $this->source->setLines($source); } elseif (is_string($source)) { $this->source->setString($source); } } return $this; }
[ "public", "function", "setSource", "(", "$", "source", ")", ":", "Method", "{", "if", "(", "!", "empty", "(", "$", "source", ")", ")", "{", "if", "(", "is_array", "(", "$", "source", ")", ")", "{", "$", "this", "->", "source", "->", "setLines", "...
Set method source. @param string|array $source @return self
[ "Set", "method", "source", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Partial/Method.php#L85-L96
32,798
spiral/reactor
src/Partial/Method.php
Method.initSource
private function initSource($source) { if (empty($this->source)) { $this->source = new Source(); } if (!empty($source)) { if (is_array($source)) { $this->source->setLines($source); } elseif (is_string($source)) { $this->sou...
php
private function initSource($source) { if (empty($this->source)) { $this->source = new Source(); } if (!empty($source)) { if (is_array($source)) { $this->source->setLines($source); } elseif (is_string($source)) { $this->sou...
[ "private", "function", "initSource", "(", "$", "source", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "source", ")", ")", "{", "$", "this", "->", "source", "=", "new", "Source", "(", ")", ";", "}", "if", "(", "!", "empty", "(", "$", "s...
Init source value. @param string|array $source
[ "Init", "source", "value", "." ]
222a70249127f1c515238358f2ee0a91d00f9a51
https://github.com/spiral/reactor/blob/222a70249127f1c515238358f2ee0a91d00f9a51/src/Partial/Method.php#L164-L177
32,799
SidRoberts/phalcon-events
src/View/NotFoundListener.php
NotFoundListener.notFoundView
public function notFoundView(Event $event, ViewInterface $view, $enginePath) : bool { if ($enginePath && !is_array($enginePath)) { $enginePath = [$enginePath]; } $message = sprintf( "View was not found in any of the views directory. Active render paths: [%s]", ...
php
public function notFoundView(Event $event, ViewInterface $view, $enginePath) : bool { if ($enginePath && !is_array($enginePath)) { $enginePath = [$enginePath]; } $message = sprintf( "View was not found in any of the views directory. Active render paths: [%s]", ...
[ "public", "function", "notFoundView", "(", "Event", "$", "event", ",", "ViewInterface", "$", "view", ",", "$", "enginePath", ")", ":", "bool", "{", "if", "(", "$", "enginePath", "&&", "!", "is_array", "(", "$", "enginePath", ")", ")", "{", "$", "engine...
Notify about not found views.
[ "Notify", "about", "not", "found", "views", "." ]
3a05bde730cb0fa20aab498746d05e8e11b738cc
https://github.com/SidRoberts/phalcon-events/blob/3a05bde730cb0fa20aab498746d05e8e11b738cc/src/View/NotFoundListener.php#L32-L46