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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
202,700 | vukbgit/PHPCraft.Subject | src/Traits/Authentication.php | Authentication.setUserData | private function setUserData($property, $value)
{
$auth = $this->authFactory->newInstance();
$userData = $auth->getUserData();
if(!$userData) {
return;
}
$userData[$property] = $value;
$auth->setUserData($userData);
} | php | private function setUserData($property, $value)
{
$auth = $this->authFactory->newInstance();
$userData = $auth->getUserData();
if(!$userData) {
return;
}
$userData[$property] = $value;
$auth->setUserData($userData);
} | [
"private",
"function",
"setUserData",
"(",
"$",
"property",
",",
"$",
"value",
")",
"{",
"$",
"auth",
"=",
"$",
"this",
"->",
"authFactory",
"->",
"newInstance",
"(",
")",
";",
"$",
"userData",
"=",
"$",
"auth",
"->",
"getUserData",
"(",
")",
";",
"i... | Sets a property for current user | [
"Sets",
"a",
"property",
"for",
"current",
"user"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Authentication.php#L125-L134 |
202,701 | ekyna/Resource | Doctrine/ORM/Listener/TranslatableListener.php | TranslatableListener.hasUniqueConstraint | private function hasUniqueConstraint(ClassMetadata $metadata, array $columns)
{
if (!isset($metadata->table['uniqueConstraints'])) {
return false;
}
foreach ($metadata->table['uniqueConstraints'] as $constraint) {
if (!array_diff($constraint['columns'], $columns)) {
... | php | private function hasUniqueConstraint(ClassMetadata $metadata, array $columns)
{
if (!isset($metadata->table['uniqueConstraints'])) {
return false;
}
foreach ($metadata->table['uniqueConstraints'] as $constraint) {
if (!array_diff($constraint['columns'], $columns)) {
... | [
"private",
"function",
"hasUniqueConstraint",
"(",
"ClassMetadata",
"$",
"metadata",
",",
"array",
"$",
"columns",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"metadata",
"->",
"table",
"[",
"'uniqueConstraints'",
"]",
")",
")",
"{",
"return",
"false",
";... | Check if an unique constraint has been defined.
@param ClassMetadata $metadata
@param array $columns
@return bool | [
"Check",
"if",
"an",
"unique",
"constraint",
"has",
"been",
"defined",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Listener/TranslatableListener.php#L146-L159 |
202,702 | ekyna/Resource | Doctrine/ORM/Listener/TranslatableListener.php | TranslatableListener.postLoad | public function postLoad(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof TranslatableInterface) {
return;
}
$entity->initializeTranslations();
$entity->setCurrentLocale($this->localeProvider->getCurrentLocale());
$entity... | php | public function postLoad(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
if (!$entity instanceof TranslatableInterface) {
return;
}
$entity->initializeTranslations();
$entity->setCurrentLocale($this->localeProvider->getCurrentLocale());
$entity... | [
"public",
"function",
"postLoad",
"(",
"LifecycleEventArgs",
"$",
"args",
")",
"{",
"$",
"entity",
"=",
"$",
"args",
"->",
"getEntity",
"(",
")",
";",
"if",
"(",
"!",
"$",
"entity",
"instanceof",
"TranslatableInterface",
")",
"{",
"return",
";",
"}",
"$"... | Translatable post load event handler.
Initializes the translations and sets the current and fallback locales.
@param LifecycleEventArgs $args | [
"Translatable",
"post",
"load",
"event",
"handler",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Listener/TranslatableListener.php#L168-L179 |
202,703 | ekyna/Resource | Doctrine/ORM/Listener/TranslatableListener.php | TranslatableListener.onTranslatablePreFlush | public function onTranslatablePreFlush(TranslatableInterface $translatable, PreFlushEventArgs $event)
{
if (null === $config = $this->registry->findConfiguration($translatable, false)) {
return;
}
$accessor = $this->getPropertyAccessor();
foreach ($translatable->getTran... | php | public function onTranslatablePreFlush(TranslatableInterface $translatable, PreFlushEventArgs $event)
{
if (null === $config = $this->registry->findConfiguration($translatable, false)) {
return;
}
$accessor = $this->getPropertyAccessor();
foreach ($translatable->getTran... | [
"public",
"function",
"onTranslatablePreFlush",
"(",
"TranslatableInterface",
"$",
"translatable",
",",
"PreFlushEventArgs",
"$",
"event",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"config",
"=",
"$",
"this",
"->",
"registry",
"->",
"findConfiguration",
"(",
"$",... | Translatable pre flush event handler.
Removes translations when all 'content' fields are set to null.
@param TranslatableInterface $translatable
@param PreFlushEventArgs $event | [
"Translatable",
"pre",
"flush",
"event",
"handler",
"."
] | 96ee3d28e02bd9513705408e3bb7f88a76e52f56 | https://github.com/ekyna/Resource/blob/96ee3d28e02bd9513705408e3bb7f88a76e52f56/Doctrine/ORM/Listener/TranslatableListener.php#L189-L206 |
202,704 | noodle69/EdgarEzUISitesBundle | src/bundle/EventListener/ConfigureMenuListener.php | ConfigureMenuListener.onMenuConfigure | public function onMenuConfigure(ConfigureMenuEvent $event)
{
if ($this->permissionResolver->hasAccess('uisites', 'read')) {
$menu = $event->getMenu();
$menu->addChild(self::ITEM_SITES, []);
}
} | php | public function onMenuConfigure(ConfigureMenuEvent $event)
{
if ($this->permissionResolver->hasAccess('uisites', 'read')) {
$menu = $event->getMenu();
$menu->addChild(self::ITEM_SITES, []);
}
} | [
"public",
"function",
"onMenuConfigure",
"(",
"ConfigureMenuEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"permissionResolver",
"->",
"hasAccess",
"(",
"'uisites'",
",",
"'read'",
")",
")",
"{",
"$",
"menu",
"=",
"$",
"event",
"->",
"getMen... | Add Sites entry menu.
@param ConfigureMenuEvent $event | [
"Add",
"Sites",
"entry",
"menu",
"."
] | 737aaaf3da004c5461bf146ba7df1dff10e3d476 | https://github.com/noodle69/EdgarEzUISitesBundle/blob/737aaaf3da004c5461bf146ba7df1dff10e3d476/src/bundle/EventListener/ConfigureMenuListener.php#L33-L40 |
202,705 | vainproject/vain-user | src/User/Providers/UserServiceProvider.php | UserServiceProvider.composeViews | protected function composeViews()
{
// user menu in app
View::composer('app', function ($view) {
$view->getFactory()->inject('account', view('user::menu', ['guest' => Auth::guest(), 'user' => Auth::user()]));
});
View::composer('admin', function ($view) {
// ... | php | protected function composeViews()
{
// user menu in app
View::composer('app', function ($view) {
$view->getFactory()->inject('account', view('user::menu', ['guest' => Auth::guest(), 'user' => Auth::user()]));
});
View::composer('admin', function ($view) {
// ... | [
"protected",
"function",
"composeViews",
"(",
")",
"{",
"// user menu in app",
"View",
"::",
"composer",
"(",
"'app'",
",",
"function",
"(",
"$",
"view",
")",
"{",
"$",
"view",
"->",
"getFactory",
"(",
")",
"->",
"inject",
"(",
"'account'",
",",
"view",
... | composes admin views. | [
"composes",
"admin",
"views",
"."
] | 1c059faa61ebf289fcaea39a90b4523cfc9d6efc | https://github.com/vainproject/vain-user/blob/1c059faa61ebf289fcaea39a90b4523cfc9d6efc/src/User/Providers/UserServiceProvider.php#L50-L64 |
202,706 | lasallecms/lasallecms-l5-usermanagement-pkg | src/Listeners/Createlasallecrmrecords/CreatePeopleRecord.php | CreatePeopleRecord.splitName | public function splitName($name, $firstOrSurname="surname") {
// The first name is considered to be all the characters to the left of the final space.
// The surname is considered to be all the characters to the right of the final space.
// oh, just in case the name ends with a space
$... | php | public function splitName($name, $firstOrSurname="surname") {
// The first name is considered to be all the characters to the left of the final space.
// The surname is considered to be all the characters to the right of the final space.
// oh, just in case the name ends with a space
$... | [
"public",
"function",
"splitName",
"(",
"$",
"name",
",",
"$",
"firstOrSurname",
"=",
"\"surname\"",
")",
"{",
"// The first name is considered to be all the characters to the left of the final space.",
"// The surname is considered to be all the characters to the right of the final spac... | First name and surnames are combined during registration.
Split 'em and return either the first name or the suranme
@param string $name Name entered during the registration process
@param string $firstOrSurname Return the "firstname"; or, the "surname"
@return string | [
"First",
"name",
"and",
"surnames",
"are",
"combined",
"during",
"registration",
".",
"Split",
"em",
"and",
"return",
"either",
"the",
"first",
"name",
"or",
"the",
"suranme"
] | b5203d596e18e2566e7fdcd3f13868bb44a94c1d | https://github.com/lasallecms/lasallecms-l5-usermanagement-pkg/blob/b5203d596e18e2566e7fdcd3f13868bb44a94c1d/src/Listeners/Createlasallecrmrecords/CreatePeopleRecord.php#L151-L166 |
202,707 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/LocalesManager.php | LocalesManager.setDefaultLocale | private function setDefaultLocale($lang)
{
if ($lang === null) {
$this->defaultLanguage = $this->languages[0];
return;
}
if (!$this->hasLocale($lang)) {
if (!is_string($lang)) {
$lang = is_object($lang) ? get_class($lang) : gettype($lang);... | php | private function setDefaultLocale($lang)
{
if ($lang === null) {
$this->defaultLanguage = $this->languages[0];
return;
}
if (!$this->hasLocale($lang)) {
if (!is_string($lang)) {
$lang = is_object($lang) ? get_class($lang) : gettype($lang);... | [
"private",
"function",
"setDefaultLocale",
"(",
"$",
"lang",
")",
"{",
"if",
"(",
"$",
"lang",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"defaultLanguage",
"=",
"$",
"this",
"->",
"languages",
"[",
"0",
"]",
";",
"return",
";",
"}",
"if",
"(",
"!... | Set the default language.
@param string|null $lang The default language code.
If NULL, the first language is assigned.
@throws InvalidArgumentException If the language is invalid.
@return void | [
"Set",
"the",
"default",
"language",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/LocalesManager.php#L104-L124 |
202,708 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/LocalesManager.php | LocalesManager.setCurrentLocale | public function setCurrentLocale($lang)
{
if ($lang === null) {
$this->currentLanguage = null;
return;
}
if (!$this->hasLocale($lang)) {
if (!is_string($lang)) {
$lang = is_object($lang) ? get_class($lang) : gettype($lang);
}
... | php | public function setCurrentLocale($lang)
{
if ($lang === null) {
$this->currentLanguage = null;
return;
}
if (!$this->hasLocale($lang)) {
if (!is_string($lang)) {
$lang = is_object($lang) ? get_class($lang) : gettype($lang);
}
... | [
"public",
"function",
"setCurrentLocale",
"(",
"$",
"lang",
")",
"{",
"if",
"(",
"$",
"lang",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"currentLanguage",
"=",
"null",
";",
"return",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"hasLocale",
"(",
... | Set the current language.
@param string|null $lang The current language code.
If NULL, the current language is unset.
@throws InvalidArgumentException If the language is invalid.
@return void | [
"Set",
"the",
"current",
"language",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/LocalesManager.php#L144-L164 |
202,709 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/LocalesManager.php | LocalesManager.setLocales | private function setLocales(array $locales)
{
$locales = $this->filterLocales($locales);
uasort($locales, [ $this, 'sortLocalesByPriority' ]);
$this->locales = [];
$this->languages = [];
foreach ($locales as $langCode => $locale) {
$this->locales[$langCode] = $... | php | private function setLocales(array $locales)
{
$locales = $this->filterLocales($locales);
uasort($locales, [ $this, 'sortLocalesByPriority' ]);
$this->locales = [];
$this->languages = [];
foreach ($locales as $langCode => $locale) {
$this->locales[$langCode] = $... | [
"private",
"function",
"setLocales",
"(",
"array",
"$",
"locales",
")",
"{",
"$",
"locales",
"=",
"$",
"this",
"->",
"filterLocales",
"(",
"$",
"locales",
")",
";",
"uasort",
"(",
"$",
"locales",
",",
"[",
"$",
"this",
",",
"'sortLocalesByPriority'",
"]"... | Set the available languages.
Ensure that explicitely inactive locales are excluded and that the required
values are set on the locales configuration structure.
This method is only called from the constructor.
@param array $locales The locales configuration structure.
@throws InvalidArgumentException If there are no... | [
"Set",
"the",
"available",
"languages",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/LocalesManager.php#L202-L219 |
202,710 | locomotivemtl/charcoal-translator | src/Charcoal/Translator/LocalesManager.php | LocalesManager.filterLocales | private function filterLocales(array $locales)
{
$z = self::DEFAULT_SORT_PRIORITY;
$filteredLocales = [];
foreach ($locales as $langCode => $locale) {
if (isset($locale['active']) && !$locale['active']) {
continue;
}
if (!isset($locale['p... | php | private function filterLocales(array $locales)
{
$z = self::DEFAULT_SORT_PRIORITY;
$filteredLocales = [];
foreach ($locales as $langCode => $locale) {
if (isset($locale['active']) && !$locale['active']) {
continue;
}
if (!isset($locale['p... | [
"private",
"function",
"filterLocales",
"(",
"array",
"$",
"locales",
")",
"{",
"$",
"z",
"=",
"self",
"::",
"DEFAULT_SORT_PRIORITY",
";",
"$",
"filteredLocales",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"locales",
"as",
"$",
"langCode",
"=>",
"$",
"loca... | Filter the available languages.
Routine:
1. Removes disabled languages
2. Assigns a priority, if absent
3. Assigns a locale, if absent
@param array $locales The locales configuration structure.
@return array The parsed language structures. | [
"Filter",
"the",
"available",
"languages",
"."
] | 0a64432baef223dcccbfecf057015440dfa76e49 | https://github.com/locomotivemtl/charcoal-translator/blob/0a64432baef223dcccbfecf057015440dfa76e49/src/Charcoal/Translator/LocalesManager.php#L232-L254 |
202,711 | jenskooij/cloudcontrol | src/search/DocumentTokenizer.php | DocumentTokenizer.tokenize | private function tokenize()
{
$this->tokenizeTitle();
$this->tokenizeFields();
$this->tokenizeBricks();
$this->tokenizeDynamicBricks();
$this->tokenVector = array_filter($this->tokenVector);
arsort($this->tokenVector);
} | php | private function tokenize()
{
$this->tokenizeTitle();
$this->tokenizeFields();
$this->tokenizeBricks();
$this->tokenizeDynamicBricks();
$this->tokenVector = array_filter($this->tokenVector);
arsort($this->tokenVector);
} | [
"private",
"function",
"tokenize",
"(",
")",
"{",
"$",
"this",
"->",
"tokenizeTitle",
"(",
")",
";",
"$",
"this",
"->",
"tokenizeFields",
"(",
")",
";",
"$",
"this",
"->",
"tokenizeBricks",
"(",
")",
";",
"$",
"this",
"->",
"tokenizeDynamicBricks",
"(",
... | Execute tokenization of all document fields | [
"Execute",
"tokenization",
"of",
"all",
"document",
"fields"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/DocumentTokenizer.php#L43-L51 |
202,712 | jenskooij/cloudcontrol | src/search/DocumentTokenizer.php | DocumentTokenizer.addTokenToVector | private function addTokenToVector($token, $field, $count = 1)
{
if (!empty($token)) {
if (isset($this->tokenVector[$field][$token])) {
$this->tokenVector[$field][$token] += $count;
} else {
$this->tokenVector[$field][$token] = $count;
}
... | php | private function addTokenToVector($token, $field, $count = 1)
{
if (!empty($token)) {
if (isset($this->tokenVector[$field][$token])) {
$this->tokenVector[$field][$token] += $count;
} else {
$this->tokenVector[$field][$token] = $count;
}
... | [
"private",
"function",
"addTokenToVector",
"(",
"$",
"token",
",",
"$",
"field",
",",
"$",
"count",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"token",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"tokenVector",
"[",
"$"... | Add a token to the existing tokenvector
@param $token
@param string $field
@param int $count | [
"Add",
"a",
"token",
"to",
"the",
"existing",
"tokenvector"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/DocumentTokenizer.php#L125-L134 |
202,713 | jenskooij/cloudcontrol | src/search/DocumentTokenizer.php | DocumentTokenizer.addTokenVectorToVector | private function addTokenVectorToVector($tokenVector, $field)
{
foreach ($tokenVector as $token => $count) {
$this->addTokenToVector($token, $field, $count);
}
} | php | private function addTokenVectorToVector($tokenVector, $field)
{
foreach ($tokenVector as $token => $count) {
$this->addTokenToVector($token, $field, $count);
}
} | [
"private",
"function",
"addTokenVectorToVector",
"(",
"$",
"tokenVector",
",",
"$",
"field",
")",
"{",
"foreach",
"(",
"$",
"tokenVector",
"as",
"$",
"token",
"=>",
"$",
"count",
")",
"{",
"$",
"this",
"->",
"addTokenToVector",
"(",
"$",
"token",
",",
"$... | Add a complete token vector to the existing one.
@param $tokenVector
@param $field | [
"Add",
"a",
"complete",
"token",
"vector",
"to",
"the",
"existing",
"one",
"."
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/DocumentTokenizer.php#L141-L146 |
202,714 | jenskooij/cloudcontrol | src/search/DocumentTokenizer.php | DocumentTokenizer.getFieldType | private function getFieldType($fieldName, $documentDefinition)
{
foreach ($documentDefinition->fields as $fieldTypeDefinition) {
if ($fieldTypeDefinition->slug === $fieldName) {
return $fieldTypeDefinition->type;
}
}
throw new \Exception('Unknown fiel... | php | private function getFieldType($fieldName, $documentDefinition)
{
foreach ($documentDefinition->fields as $fieldTypeDefinition) {
if ($fieldTypeDefinition->slug === $fieldName) {
return $fieldTypeDefinition->type;
}
}
throw new \Exception('Unknown fiel... | [
"private",
"function",
"getFieldType",
"(",
"$",
"fieldName",
",",
"$",
"documentDefinition",
")",
"{",
"foreach",
"(",
"$",
"documentDefinition",
"->",
"fields",
"as",
"$",
"fieldTypeDefinition",
")",
"{",
"if",
"(",
"$",
"fieldTypeDefinition",
"->",
"slug",
... | Get the type for a field
@param $fieldName
@param $documentDefinition
@return mixed
@throws \Exception | [
"Get",
"the",
"type",
"for",
"a",
"field"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/search/DocumentTokenizer.php#L155-L164 |
202,715 | wobblecode/WobbleCodeUserBundle | Document/Invitation.php | Invitation.isDifferentEmail | public function isDifferentEmail(ExecutionContextInterface $context)
{
if ($this->getEmail() == $this->getFrom()->getEmail()) {
$context->buildViolation('You can\'t invite yourself!')
->atPath('email')
->addViolation();
}
} | php | public function isDifferentEmail(ExecutionContextInterface $context)
{
if ($this->getEmail() == $this->getFrom()->getEmail()) {
$context->buildViolation('You can\'t invite yourself!')
->atPath('email')
->addViolation();
}
} | [
"public",
"function",
"isDifferentEmail",
"(",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getEmail",
"(",
")",
"==",
"$",
"this",
"->",
"getFrom",
"(",
")",
"->",
"getEmail",
"(",
")",
")",
"{",
"$",
"context",
... | Callback to check the if is a different email from it self | [
"Callback",
"to",
"check",
"the",
"if",
"is",
"a",
"different",
"email",
"from",
"it",
"self"
] | 7b8206f8b4a50fbc61f7bfe4f83eb466cad96440 | https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/Document/Invitation.php#L120-L127 |
202,716 | shgysk8zer0/core_api | abstracts/error_logger.php | Error_Logger.callErrorLogger | final protected static function callErrorLogger($level, $message)
{
if (is_null(static::$errorLoggerInstance)) {
static::$errorLoggerInstance = new self;
}
static::$errorLoggerInstance->{
static::$errorLoggerInstance->errorToLogLevel($level)
}($message);
} | php | final protected static function callErrorLogger($level, $message)
{
if (is_null(static::$errorLoggerInstance)) {
static::$errorLoggerInstance = new self;
}
static::$errorLoggerInstance->{
static::$errorLoggerInstance->errorToLogLevel($level)
}($message);
} | [
"final",
"protected",
"static",
"function",
"callErrorLogger",
"(",
"$",
"level",
",",
"$",
"message",
")",
"{",
"if",
"(",
"is_null",
"(",
"static",
"::",
"$",
"errorLoggerInstance",
")",
")",
"{",
"static",
"::",
"$",
"errorLoggerInstance",
"=",
"new",
"... | Passes the error to logger as an exception, converting error level
to Logger level.
@param int $level Error level from `E_*` error constants
@param string $message Message given with the error | [
"Passes",
"the",
"error",
"to",
"logger",
"as",
"an",
"exception",
"converting",
"error",
"level",
"to",
"Logger",
"level",
"."
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/abstracts/error_logger.php#L94-L102 |
202,717 | myENA/default-psr-logger | src/DefaultLogger.php | DefaultLogger.setLogLevel | public function setLogLevel($logLevel)
{
if (!is_string($logLevel) || '' === ($level = strtolower($logLevel)) || !isset($this->levelMap[$level]))
{
throw new \InvalidArgumentException(sprintf(
'%s - Log level must be one of the following values: ["%s"]. %s seen.',
... | php | public function setLogLevel($logLevel)
{
if (!is_string($logLevel) || '' === ($level = strtolower($logLevel)) || !isset($this->levelMap[$level]))
{
throw new \InvalidArgumentException(sprintf(
'%s - Log level must be one of the following values: ["%s"]. %s seen.',
... | [
"public",
"function",
"setLogLevel",
"(",
"$",
"logLevel",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"logLevel",
")",
"||",
"''",
"===",
"(",
"$",
"level",
"=",
"strtolower",
"(",
"$",
"logLevel",
")",
")",
"||",
"!",
"isset",
"(",
"$",
"thi... | setLogLevel will limit what is written to a level greater than or equal to value passed in.
@param string $logLevel | [
"setLogLevel",
"will",
"limit",
"what",
"is",
"written",
"to",
"a",
"level",
"greater",
"than",
"or",
"equal",
"to",
"value",
"passed",
"in",
"."
] | a414fc861885ade353a1a0dd3bb09a3d5e532f87 | https://github.com/myENA/default-psr-logger/blob/a414fc861885ade353a1a0dd3bb09a3d5e532f87/src/DefaultLogger.php#L98-L111 |
202,718 | myENA/default-psr-logger | src/DefaultLogger.php | DefaultLogger.tryLog | protected function tryLog($msg, $tries = 0)
{
if ((bool)@fwrite($this->stream, $msg))
return;
if (0 < $tries)
{
trigger_error(sprintf('%s - Unable to log message: "%s"', get_called_class(), $tries, $msg));
return;
}
$this->attemptStreamRe... | php | protected function tryLog($msg, $tries = 0)
{
if ((bool)@fwrite($this->stream, $msg))
return;
if (0 < $tries)
{
trigger_error(sprintf('%s - Unable to log message: "%s"', get_called_class(), $tries, $msg));
return;
}
$this->attemptStreamRe... | [
"protected",
"function",
"tryLog",
"(",
"$",
"msg",
",",
"$",
"tries",
"=",
"0",
")",
"{",
"if",
"(",
"(",
"bool",
")",
"@",
"fwrite",
"(",
"$",
"this",
"->",
"stream",
",",
"$",
"msg",
")",
")",
"return",
";",
"if",
"(",
"0",
"<",
"$",
"trie... | tryLog will attempt to write output to local stream. If unable, will kick-off re-open attempt
@param string $msg
@param int $tries | [
"tryLog",
"will",
"attempt",
"to",
"write",
"output",
"to",
"local",
"stream",
".",
"If",
"unable",
"will",
"kick",
"-",
"off",
"re",
"-",
"open",
"attempt"
] | a414fc861885ade353a1a0dd3bb09a3d5e532f87 | https://github.com/myENA/default-psr-logger/blob/a414fc861885ade353a1a0dd3bb09a3d5e532f87/src/DefaultLogger.php#L156-L170 |
202,719 | myENA/default-psr-logger | src/DefaultLogger.php | DefaultLogger.attemptStreamRecovery | protected function attemptStreamRecovery()
{
if ('resource' === gettype($this->stream))
{
@fflush($this->stream);
@fclose($this->stream);
}
$this->stream = fopen($this->streamURI, $this->streamMode);
if (false === $this->stream)
{
... | php | protected function attemptStreamRecovery()
{
if ('resource' === gettype($this->stream))
{
@fflush($this->stream);
@fclose($this->stream);
}
$this->stream = fopen($this->streamURI, $this->streamMode);
if (false === $this->stream)
{
... | [
"protected",
"function",
"attemptStreamRecovery",
"(",
")",
"{",
"if",
"(",
"'resource'",
"===",
"gettype",
"(",
"$",
"this",
"->",
"stream",
")",
")",
"{",
"@",
"fflush",
"(",
"$",
"this",
"->",
"stream",
")",
";",
"@",
"fclose",
"(",
"$",
"this",
"... | Will attempt to re-open stream in the event that it was closed unexpectedly. Will use default if unable to
re-open custom
@see DefaultLogger::defaultStream() | [
"Will",
"attempt",
"to",
"re",
"-",
"open",
"stream",
"in",
"the",
"event",
"that",
"it",
"was",
"closed",
"unexpectedly",
".",
"Will",
"use",
"default",
"if",
"unable",
"to",
"re",
"-",
"open",
"custom"
] | a414fc861885ade353a1a0dd3bb09a3d5e532f87 | https://github.com/myENA/default-psr-logger/blob/a414fc861885ade353a1a0dd3bb09a3d5e532f87/src/DefaultLogger.php#L178-L196 |
202,720 | Vectrex/vxPHP | src/Webpage/Menu/Menu.php | Menu.insertEntry | protected function insertEntry(MenuEntry $entry, $ndx = NULL) {
if($entry instanceof DynamicMenuEntry) {
$this->dynamicEntries[] = $entry;
}
if(!isset($ndx) || $ndx >= count($this->entries)) {
$this->entries[] = $entry;
}
else {
array_splice($this->entries, $ndx, 0, [$entry]);
}
$entry->setMen... | php | protected function insertEntry(MenuEntry $entry, $ndx = NULL) {
if($entry instanceof DynamicMenuEntry) {
$this->dynamicEntries[] = $entry;
}
if(!isset($ndx) || $ndx >= count($this->entries)) {
$this->entries[] = $entry;
}
else {
array_splice($this->entries, $ndx, 0, [$entry]);
}
$entry->setMen... | [
"protected",
"function",
"insertEntry",
"(",
"MenuEntry",
"$",
"entry",
",",
"$",
"ndx",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"entry",
"instanceof",
"DynamicMenuEntry",
")",
"{",
"$",
"this",
"->",
"dynamicEntries",
"[",
"]",
"=",
"$",
"entry",
";",
... | insert or append menu entry
@param MenuEntry $entry
@param int $ndx
@return Menu | [
"insert",
"or",
"append",
"menu",
"entry"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Webpage/Menu/Menu.php#L129-L146 |
202,721 | Vectrex/vxPHP | src/Webpage/Menu/Menu.php | Menu.insertEntries | public function insertEntries(array $entries, $ndx) {
foreach($entries as $e) {
$this->insertEntry($e, $ndx++);
}
return $this;
} | php | public function insertEntries(array $entries, $ndx) {
foreach($entries as $e) {
$this->insertEntry($e, $ndx++);
}
return $this;
} | [
"public",
"function",
"insertEntries",
"(",
"array",
"$",
"entries",
",",
"$",
"ndx",
")",
"{",
"foreach",
"(",
"$",
"entries",
"as",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"insertEntry",
"(",
"$",
"e",
",",
"$",
"ndx",
"++",
")",
";",
"}",
"retu... | insert or append several MenuEntry objects
@param array $entries
@param insert $ndx
@return Menu | [
"insert",
"or",
"append",
"several",
"MenuEntry",
"objects"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Webpage/Menu/Menu.php#L155-L163 |
202,722 | Vectrex/vxPHP | src/Webpage/Menu/Menu.php | Menu.insertBeforeEntry | public function insertBeforeEntry(MenuEntry $new, MenuEntry $pos) {
foreach($this->entries as $k => $e) {
if($e === $pos) {
$this->insertEntry($new, $k);
break;
}
}
return $this;
} | php | public function insertBeforeEntry(MenuEntry $new, MenuEntry $pos) {
foreach($this->entries as $k => $e) {
if($e === $pos) {
$this->insertEntry($new, $k);
break;
}
}
return $this;
} | [
"public",
"function",
"insertBeforeEntry",
"(",
"MenuEntry",
"$",
"new",
",",
"MenuEntry",
"$",
"pos",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"k",
"=>",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"===",
"$",
"pos",
")",
... | insert a MenuEntry before an existing MenuEntry
@param MenuEntry $new
@param MenuEntry $pos
@return Menu | [
"insert",
"a",
"MenuEntry",
"before",
"an",
"existing",
"MenuEntry"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Webpage/Menu/Menu.php#L202-L213 |
202,723 | Vectrex/vxPHP | src/Webpage/Menu/Menu.php | Menu.replaceEntry | public function replaceEntry(MenuEntry $new, MenuEntry $toReplace) {
foreach($this->entries as $k => $e) {
if($e === $toReplace) {
$this->insertEntry($new, $k);
$this->removeEntry($toReplace);
break;
}
}
return $this;
} | php | public function replaceEntry(MenuEntry $new, MenuEntry $toReplace) {
foreach($this->entries as $k => $e) {
if($e === $toReplace) {
$this->insertEntry($new, $k);
$this->removeEntry($toReplace);
break;
}
}
return $this;
} | [
"public",
"function",
"replaceEntry",
"(",
"MenuEntry",
"$",
"new",
",",
"MenuEntry",
"$",
"toReplace",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"k",
"=>",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"===",
"$",
"toReplace",
... | replace a MenuEntry by another one
@param MenuEntry $new
@param MenuEntry $toReplace
@return Menu | [
"replace",
"a",
"MenuEntry",
"by",
"another",
"one"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Webpage/Menu/Menu.php#L234-L246 |
202,724 | Vectrex/vxPHP | src/Webpage/Menu/Menu.php | Menu.removeEntry | public function removeEntry(MenuEntry $toRemove) {
foreach($this->entries as $k => $e) {
if($e === $toRemove) {
array_splice($this->entries, $k, 1);
if($toRemove instanceof DynamicMenuEntry) {
$ndx = array_search($toRemove, $this->dynamicEntries, TRUE);
if($ndx !== FALSE) {
array_spli... | php | public function removeEntry(MenuEntry $toRemove) {
foreach($this->entries as $k => $e) {
if($e === $toRemove) {
array_splice($this->entries, $k, 1);
if($toRemove instanceof DynamicMenuEntry) {
$ndx = array_search($toRemove, $this->dynamicEntries, TRUE);
if($ndx !== FALSE) {
array_spli... | [
"public",
"function",
"removeEntry",
"(",
"MenuEntry",
"$",
"toRemove",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"k",
"=>",
"$",
"e",
")",
"{",
"if",
"(",
"$",
"e",
"===",
"$",
"toRemove",
")",
"{",
"array_splice",
"(",
"$... | remove a MenuEntry
@param MenuEntry $toRemove
@return Menu | [
"remove",
"a",
"MenuEntry"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Webpage/Menu/Menu.php#L254-L279 |
202,725 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Schema/Index/CompositeIndex.php | CompositeIndex.isSecondaryLocal | public function isSecondaryLocal()
{
if (!$this->isSecondary()) {
return false;
}
$hashKey = $this->getHashKey()->getPropertyMetadata()->name;
$hashKeyPrimary = $this->class->getIndex()->getHashKey()->getPropertyMetadata()->name;
return $hashKey === $hash... | php | public function isSecondaryLocal()
{
if (!$this->isSecondary()) {
return false;
}
$hashKey = $this->getHashKey()->getPropertyMetadata()->name;
$hashKeyPrimary = $this->class->getIndex()->getHashKey()->getPropertyMetadata()->name;
return $hashKey === $hash... | [
"public",
"function",
"isSecondaryLocal",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isSecondary",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"hashKey",
"=",
"$",
"this",
"->",
"getHashKey",
"(",
")",
"->",
"getPropertyMetadata",
"("... | Is this a local secondary index?
@return bool | [
"Is",
"this",
"a",
"local",
"secondary",
"index?"
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Schema/Index/CompositeIndex.php#L115-L125 |
202,726 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastPageModLog | static function LastPageModLog(Page $page, Interfaces\IContainerReferenceResolver $resolver)
{
$lastLog = self::LastPageLog($page);
$pageContents = PageContent::Schema()->FetchByPage(false, $page);
foreach ($pageContents as $pageContent)
{
$content = $pageContent->GetCont... | php | static function LastPageModLog(Page $page, Interfaces\IContainerReferenceResolver $resolver)
{
$lastLog = self::LastPageLog($page);
$pageContents = PageContent::Schema()->FetchByPage(false, $page);
foreach ($pageContents as $pageContent)
{
$content = $pageContent->GetCont... | [
"static",
"function",
"LastPageModLog",
"(",
"Page",
"$",
"page",
",",
"Interfaces",
"\\",
"IContainerReferenceResolver",
"$",
"resolver",
")",
"{",
"$",
"lastLog",
"=",
"self",
"::",
"LastPageLog",
"(",
"$",
"page",
")",
";",
"$",
"pageContents",
"=",
"Page... | Gets the last page modification log item
@param Page $page The page
@param Interfaces\IContainerReferenceResolver $resolver
@return LogItem Returns the last log item that changed anything related to the page | [
"Gets",
"the",
"last",
"page",
"modification",
"log",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L34-L53 |
202,727 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastContainerModLog | static function LastContainerModLog(Container $container)
{
$lastLog = self::LastContainerLog($container);
$containerContents = ContainerContent::Schema()->FetchByContainer(false, $container);
foreach ($containerContents as $containerContent)
{
$content = $containerConten... | php | static function LastContainerModLog(Container $container)
{
$lastLog = self::LastContainerLog($container);
$containerContents = ContainerContent::Schema()->FetchByContainer(false, $container);
foreach ($containerContents as $containerContent)
{
$content = $containerConten... | [
"static",
"function",
"LastContainerModLog",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"lastLog",
"=",
"self",
"::",
"LastContainerLog",
"(",
"$",
"container",
")",
";",
"$",
"containerContents",
"=",
"ContainerContent",
"::",
"Schema",
"(",
")",
"->"... | Gets the last container modification log item
@param Container $container The container
@return LogItem Returns the last log item that changed anything related to the container | [
"Gets",
"the",
"last",
"container",
"modification",
"log",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L60-L74 |
202,728 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastLayoutModLog | static function LastLayoutModLog(Layout $layout)
{
$lastLog = $this->LastLayoutLog($layout);
$areas = Area::Schema()->FetchByLayout(false, $layout);
foreach ($areas as $area)
{
$areaLog = self::LastAreaModLog($area);
if (self::IsAfter($areaLog, $lastLog))
... | php | static function LastLayoutModLog(Layout $layout)
{
$lastLog = $this->LastLayoutLog($layout);
$areas = Area::Schema()->FetchByLayout(false, $layout);
foreach ($areas as $area)
{
$areaLog = self::LastAreaModLog($area);
if (self::IsAfter($areaLog, $lastLog))
... | [
"static",
"function",
"LastLayoutModLog",
"(",
"Layout",
"$",
"layout",
")",
"{",
"$",
"lastLog",
"=",
"$",
"this",
"->",
"LastLayoutLog",
"(",
"$",
"layout",
")",
";",
"$",
"areas",
"=",
"Area",
"::",
"Schema",
"(",
")",
"->",
"FetchByLayout",
"(",
"f... | Gets the last layout modification log item
@param Layout $layout The layout
@return LogItem Returns the last log item that changed anything related to the layout | [
"Gets",
"the",
"last",
"layout",
"modification",
"log",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L81-L94 |
202,729 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastAreaModLog | static function LastAreaModLog(Area $area, Interfaces\IContainerReferenceResolver $resolver)
{
$lastLog = $this->LastAreaLog($area);
$areaContents = LayoutContent::Schema()->FetchByArea(false, $area);
foreach ($areaContents as $areaContent)
{
$content = $areaContent->GetC... | php | static function LastAreaModLog(Area $area, Interfaces\IContainerReferenceResolver $resolver)
{
$lastLog = $this->LastAreaLog($area);
$areaContents = LayoutContent::Schema()->FetchByArea(false, $area);
foreach ($areaContents as $areaContent)
{
$content = $areaContent->GetC... | [
"static",
"function",
"LastAreaModLog",
"(",
"Area",
"$",
"area",
",",
"Interfaces",
"\\",
"IContainerReferenceResolver",
"$",
"resolver",
")",
"{",
"$",
"lastLog",
"=",
"$",
"this",
"->",
"LastAreaLog",
"(",
"$",
"area",
")",
";",
"$",
"areaContents",
"=",
... | Gets the last area modification log item
@param Area $area The area
@return LogItem Returns the last log item that changed anything related to the area | [
"Gets",
"the",
"last",
"area",
"modification",
"log",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L101-L115 |
202,730 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastContentModLog | function LastContentModLog(Content $content, Interfaces\IContainerReferenceResolver $resolver = null)
{
$lastLog = self::LastContentLog($content);
$container = $resolver ? $resolver->GetReferencedContainer($content) : null;
if ($container)
{
$containerLog = self::LastCont... | php | function LastContentModLog(Content $content, Interfaces\IContainerReferenceResolver $resolver = null)
{
$lastLog = self::LastContentLog($content);
$container = $resolver ? $resolver->GetReferencedContainer($content) : null;
if ($container)
{
$containerLog = self::LastCont... | [
"function",
"LastContentModLog",
"(",
"Content",
"$",
"content",
",",
"Interfaces",
"\\",
"IContainerReferenceResolver",
"$",
"resolver",
"=",
"null",
")",
"{",
"$",
"lastLog",
"=",
"self",
"::",
"LastContentLog",
"(",
"$",
"content",
")",
";",
"$",
"container... | Gets the last content modification log item
@param Content $content The content
@return LogItem Returns the last log item that changed anything related to the content | [
"Gets",
"the",
"last",
"content",
"modification",
"log",
"item"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L122-L143 |
202,731 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.IsAfter | static function IsAfter(LogItem $lhs = null, LogItem $rhs = null)
{
if (!$lhs)
{
return false;
}
if (!$rhs)
{
return true;
}
return $lhs->GetChanged()->IsAfter($rhs->GetChanged());
} | php | static function IsAfter(LogItem $lhs = null, LogItem $rhs = null)
{
if (!$lhs)
{
return false;
}
if (!$rhs)
{
return true;
}
return $lhs->GetChanged()->IsAfter($rhs->GetChanged());
} | [
"static",
"function",
"IsAfter",
"(",
"LogItem",
"$",
"lhs",
"=",
"null",
",",
"LogItem",
"$",
"rhs",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"lhs",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"$",
"rhs",
")",
"{",
"return",
"tru... | Compares two log item by date
@param LogItem $lhs The left hand side
@param LogItem $rhs The right hand side
@return boolean Returns trie if right hand side is null and lhs is not, or change date of lhs is after change date of rhs | [
"Compares",
"two",
"log",
"item",
"by",
"date"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L151-L162 |
202,732 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastPageLog | static function LastPageLog(Page $page)
{
$tblLogPage = LogPage::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblLogPage->Field('... | php | static function LastPageLog(Page $page)
{
$tblLogPage = LogPage::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblLogPage->Field('... | [
"static",
"function",
"LastPageLog",
"(",
"Page",
"$",
"page",
")",
"{",
"$",
"tblLogPage",
"=",
"LogPage",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"tblLogItem",
"=",
"LogItem",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
... | The last log item that is directly related to the page
@param Page $page The page
@return LogItem Returns the log item | [
"The",
"last",
"log",
"item",
"that",
"is",
"directly",
"related",
"to",
"the",
"page"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L169-L178 |
202,733 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastContentLog | static function LastContentLog(Content $content)
{
$tblLogContent = LogContent::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblL... | php | static function LastContentLog(Content $content)
{
$tblLogContent = LogContent::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblL... | [
"static",
"function",
"LastContentLog",
"(",
"Content",
"$",
"content",
")",
"{",
"$",
"tblLogContent",
"=",
"LogContent",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"tblLogItem",
"=",
"LogItem",
"::",
"Schema",
"(",
")",
"->",
"Table",... | The last log item that is directly related to the content
@param Content $content The content
@return LogItem Returns the log item | [
"The",
"last",
"log",
"item",
"that",
"is",
"directly",
"related",
"to",
"the",
"content"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L185-L194 |
202,734 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastLayoutLog | static function LastLayoutLog(Layout $layout)
{
$tblLogLayout = LogLayout::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblLogLay... | php | static function LastLayoutLog(Layout $layout)
{
$tblLogLayout = LogLayout::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblLogLay... | [
"static",
"function",
"LastLayoutLog",
"(",
"Layout",
"$",
"layout",
")",
"{",
"$",
"tblLogLayout",
"=",
"LogLayout",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"tblLogItem",
"=",
"LogItem",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(... | The last log item that is directly related to the layout
@param Layout $layout The layout
@return LogItem Returns the log item | [
"The",
"last",
"log",
"item",
"that",
"is",
"directly",
"related",
"to",
"the",
"layout"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L201-L210 |
202,735 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastAreaLog | static function LastAreaLog(Area $area)
{
$tblLogArea = LogArea::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblLogArea->Field('... | php | static function LastAreaLog(Area $area)
{
$tblLogArea = LogArea::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Equals($tblLogArea->Field('... | [
"static",
"function",
"LastAreaLog",
"(",
"Area",
"$",
"area",
")",
"{",
"$",
"tblLogArea",
"=",
"LogArea",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"tblLogItem",
"=",
"LogItem",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
... | The last log item that is directly related to the area
@param Area $area The area
@return LogItem Returns the log item | [
"The",
"last",
"log",
"item",
"that",
"is",
"directly",
"related",
"to",
"the",
"area"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L217-L226 |
202,736 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastContainerLog | static function LastContainerLog(Container $container)
{
$tblLogContainer = LogContainer::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Eq... | php | static function LastContainerLog(Container $container)
{
$tblLogContainer = LogContainer::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
$joinCond = $sql->Eq... | [
"static",
"function",
"LastContainerLog",
"(",
"Container",
"$",
"container",
")",
"{",
"$",
"tblLogContainer",
"=",
"LogContainer",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$",
"tblLogItem",
"=",
"LogItem",
"::",
"Schema",
"(",
")",
"->",
... | The last log item that is directly related to the container
@param Container $container The container
@return LogItem Returns the log item | [
"The",
"last",
"log",
"item",
"that",
"is",
"directly",
"related",
"to",
"the",
"container"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L233-L242 |
202,737 | agentmedia/phine-core | src/Core/Logic/Logging/LogEvaluator.php | LogEvaluator.LastTemplateLog | static function LastTemplateLog($moduleType, $template)
{
$tblLogTemplate = \App\Phine\Database\Core\LogTemplate::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
... | php | static function LastTemplateLog($moduleType, $template)
{
$tblLogTemplate = \App\Phine\Database\Core\LogTemplate::Schema()->Table();
$tblLogItem = LogItem::Schema()->Table();
$sql = Access::SqlBuilder();
$orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
... | [
"static",
"function",
"LastTemplateLog",
"(",
"$",
"moduleType",
",",
"$",
"template",
")",
"{",
"$",
"tblLogTemplate",
"=",
"\\",
"App",
"\\",
"Phine",
"\\",
"Database",
"\\",
"Core",
"\\",
"LogTemplate",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")... | The last log item that is directly related to the template
@param Content $content The content
@return LogItem Returns the log item | [
"The",
"last",
"log",
"item",
"that",
"is",
"directly",
"related",
"to",
"the",
"template"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L249-L259 |
202,738 | makinacorpus/drupal-ulink | src/EntityLinkGenerator.php | EntityLinkGenerator.getDrupalEntityPath | private function getDrupalEntityPath($type, $entity)
{
$uri = entity_uri($type, $entity);
if (!$uri) {
throw new \InvalidArgumentException(sprintf("%s: entity type is not supported yet"));
}
return $uri['path'];
} | php | private function getDrupalEntityPath($type, $entity)
{
$uri = entity_uri($type, $entity);
if (!$uri) {
throw new \InvalidArgumentException(sprintf("%s: entity type is not supported yet"));
}
return $uri['path'];
} | [
"private",
"function",
"getDrupalEntityPath",
"(",
"$",
"type",
",",
"$",
"entity",
")",
"{",
"$",
"uri",
"=",
"entity_uri",
"(",
"$",
"type",
",",
"$",
"entity",
")",
";",
"if",
"(",
"!",
"$",
"uri",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentE... | Uses drupal 7 API to generate the entity URL
@param string $type
@param mixed $entity
@return string | [
"Uses",
"drupal",
"7",
"API",
"to",
"generate",
"the",
"entity",
"URL"
] | 4e1e54b979d72934a6fc0242aae3f12abebf41d0 | https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L84-L93 |
202,739 | makinacorpus/drupal-ulink | src/EntityLinkGenerator.php | EntityLinkGenerator.getEntityPath | public function getEntityPath($type, $id)
{
// Allow other modules to interact
$event = new EntityGetPathEvent($type, $id);
$this->eventDispatcher->dispatch(EntityGetPathEvent::EVENT_GET_PATH, $event);
if ($path = $event->getPath()) {
return $path;
}
// I... | php | public function getEntityPath($type, $id)
{
// Allow other modules to interact
$event = new EntityGetPathEvent($type, $id);
$this->eventDispatcher->dispatch(EntityGetPathEvent::EVENT_GET_PATH, $event);
if ($path = $event->getPath()) {
return $path;
}
// I... | [
"public",
"function",
"getEntityPath",
"(",
"$",
"type",
",",
"$",
"id",
")",
"{",
"// Allow other modules to interact",
"$",
"event",
"=",
"new",
"EntityGetPathEvent",
"(",
"$",
"type",
",",
"$",
"id",
")",
";",
"$",
"this",
"->",
"eventDispatcher",
"->",
... | Get entity internal path
@param string $type
Entity type
@param int|string $id
Entity identifier
@return string
The Drupal internal path | [
"Get",
"entity",
"internal",
"path"
] | 4e1e54b979d72934a6fc0242aae3f12abebf41d0 | https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L106-L136 |
202,740 | makinacorpus/drupal-ulink | src/EntityLinkGenerator.php | EntityLinkGenerator.getEntityPathFromURI | public function getEntityPathFromURI($uri)
{
if ($parts = $this->decomposeURI($uri)) {
return $this->getEntityPath($parts['type'], $parts['id']);
}
throw new \InvalidArgumentException(sprintf("%s: invalid entity URI scheme or malformed URI", $uri));
} | php | public function getEntityPathFromURI($uri)
{
if ($parts = $this->decomposeURI($uri)) {
return $this->getEntityPath($parts['type'], $parts['id']);
}
throw new \InvalidArgumentException(sprintf("%s: invalid entity URI scheme or malformed URI", $uri));
} | [
"public",
"function",
"getEntityPathFromURI",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"$",
"parts",
"=",
"$",
"this",
"->",
"decomposeURI",
"(",
"$",
"uri",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getEntityPath",
"(",
"$",
"parts",
"[",
"'type'",
... | Get entity internal path from internal URI
@param string $uri
Must match one of the supported schemes
@throws \InvalidArgumentException | [
"Get",
"entity",
"internal",
"path",
"from",
"internal",
"URI"
] | 4e1e54b979d72934a6fc0242aae3f12abebf41d0 | https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L146-L153 |
202,741 | makinacorpus/drupal-ulink | src/EntityLinkGenerator.php | EntityLinkGenerator.decomposeURI | public function decomposeURI($uri, &$type = null)
{
$elements = [];
if (!self::URIIsCandidate($uri)) {
return $elements;
}
foreach ($this->getURIPatterns() as $name => $pattern) {
if (preg_match($pattern, $uri, $matches)) {
$type = $name;
... | php | public function decomposeURI($uri, &$type = null)
{
$elements = [];
if (!self::URIIsCandidate($uri)) {
return $elements;
}
foreach ($this->getURIPatterns() as $name => $pattern) {
if (preg_match($pattern, $uri, $matches)) {
$type = $name;
... | [
"public",
"function",
"decomposeURI",
"(",
"$",
"uri",
",",
"&",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"elements",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"self",
"::",
"URIIsCandidate",
"(",
"$",
"uri",
")",
")",
"{",
"return",
"$",
"elements",
"... | Extract entity type and id from the given URI.
@param string $uri
@param string $type
The type of the URI will be passed on to you through this argument.
@return string[] | [
"Extract",
"entity",
"type",
"and",
"id",
"from",
"the",
"given",
"URI",
"."
] | 4e1e54b979d72934a6fc0242aae3f12abebf41d0 | https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L164-L184 |
202,742 | makinacorpus/drupal-ulink | src/EntityLinkGenerator.php | EntityLinkGenerator.formatURI | public function formatURI($type, $id, $uriType = self::SCHEME_TYPE)
{
switch ($uriType) {
case self::SCHEME_TYPE:
return 'entity://' . $type . '/' . $id;
case self::STACHE_TYPE:
return '{{' . $type . '/' . $id . '}}';
}
throw new \Inval... | php | public function formatURI($type, $id, $uriType = self::SCHEME_TYPE)
{
switch ($uriType) {
case self::SCHEME_TYPE:
return 'entity://' . $type . '/' . $id;
case self::STACHE_TYPE:
return '{{' . $type . '/' . $id . '}}';
}
throw new \Inval... | [
"public",
"function",
"formatURI",
"(",
"$",
"type",
",",
"$",
"id",
",",
"$",
"uriType",
"=",
"self",
"::",
"SCHEME_TYPE",
")",
"{",
"switch",
"(",
"$",
"uriType",
")",
"{",
"case",
"self",
"::",
"SCHEME_TYPE",
":",
"return",
"'entity://'",
".",
"$",
... | Format an URI.
@param string Entity type
@param integer Entity identifier
@param string Type of the URI
@return string | [
"Format",
"an",
"URI",
"."
] | 4e1e54b979d72934a6fc0242aae3f12abebf41d0 | https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L195-L204 |
202,743 | makinacorpus/drupal-ulink | src/EntityLinkGenerator.php | EntityLinkGenerator.replaceAllInText | public function replaceAllInText($text)
{
$uriInfo = [];
// Collects all µlink URIs present in the text and stores them
// in an array keyed by their offset.
foreach ($this->getURIPatterns() as $pattern) {
$matches = [];
if (preg_match_all($pattern, $text, $... | php | public function replaceAllInText($text)
{
$uriInfo = [];
// Collects all µlink URIs present in the text and stores them
// in an array keyed by their offset.
foreach ($this->getURIPatterns() as $pattern) {
$matches = [];
if (preg_match_all($pattern, $text, $... | [
"public",
"function",
"replaceAllInText",
"(",
"$",
"text",
")",
"{",
"$",
"uriInfo",
"=",
"[",
"]",
";",
"// Collects all µlink URIs present in the text and stores them",
"// in an array keyed by their offset.",
"foreach",
"(",
"$",
"this",
"->",
"getURIPatterns",
"(",
... | Replace all occurences of entity URIs in text by the generated URLs.
@param string $text
@return string | [
"Replace",
"all",
"occurences",
"of",
"entity",
"URIs",
"in",
"text",
"by",
"the",
"generated",
"URLs",
"."
] | 4e1e54b979d72934a6fc0242aae3f12abebf41d0 | https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L213-L268 |
202,744 | PenoaksDev/Milky-Framework | src/Milky/Annotations/FileCacheReader.php | FileCacheReader.saveCacheFile | private function saveCacheFile($path, $data)
{
if (!is_writable($this->dir)) {
throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support ... | php | private function saveCacheFile($path, $data)
{
if (!is_writable($this->dir)) {
throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support ... | [
"private",
"function",
"saveCacheFile",
"(",
"$",
"path",
",",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"is_writable",
"(",
"$",
"this",
"->",
"dir",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'The directory \"%s\"... | Saves the cache file.
@param string $path
@param mixed $data
@return void | [
"Saves",
"the",
"cache",
"file",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/FileCacheReader.php#L186-L210 |
202,745 | Revys/revy | src/App/RevyBase.php | RevyBase.getLanguage | public static function getLanguage()
{
if (! self::$language) {
self::$language = Language::findByCode(App::getLocale());
}
if (! self::$language) {
abort(404, 'Language could not be found');
}
return self::$language;
} | php | public static function getLanguage()
{
if (! self::$language) {
self::$language = Language::findByCode(App::getLocale());
}
if (! self::$language) {
abort(404, 'Language could not be found');
}
return self::$language;
} | [
"public",
"static",
"function",
"getLanguage",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"language",
")",
"{",
"self",
"::",
"$",
"language",
"=",
"Language",
"::",
"findByCode",
"(",
"App",
"::",
"getLocale",
"(",
")",
")",
";",
"}",
"if",
... | Get application Language instance
@return Language | [
"Get",
"application",
"Language",
"instance"
] | b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1 | https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/RevyBase.php#L28-L39 |
202,746 | Revys/revy | src/App/RevyBase.php | RevyBase.setLanguage | public static function setLanguage($language)
{
if (! ($language instanceof Language)) {
$language = Language::findByCode($language);
}
if (! $language) {
return false;
}
App::setLocale($language->code);
request()->setDefaultLocale... | php | public static function setLanguage($language)
{
if (! ($language instanceof Language)) {
$language = Language::findByCode($language);
}
if (! $language) {
return false;
}
App::setLocale($language->code);
request()->setDefaultLocale... | [
"public",
"static",
"function",
"setLanguage",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"language",
"instanceof",
"Language",
")",
")",
"{",
"$",
"language",
"=",
"Language",
"::",
"findByCode",
"(",
"$",
"language",
")",
";",
"}",
"if... | Set application Language instance
@return Language | [
"Set",
"application",
"Language",
"instance"
] | b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1 | https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/RevyBase.php#L45-L60 |
202,747 | ciims/ciims-modules-dashboard | controllers/SettingsController.php | SettingsController.actionTheme | public function actionTheme()
{
$theme = Cii::getConfig('theme', 'default');
if (!file_exists(Yii::getPathOfAlias('base.themes.' . $theme) . DS . 'Theme.php'))
throw new CHttpException(400, Yii::t('Dashboard.main', 'The requested theme type is not set. Please set a theme before attempting to change theme sett... | php | public function actionTheme()
{
$theme = Cii::getConfig('theme', 'default');
if (!file_exists(Yii::getPathOfAlias('base.themes.' . $theme) . DS . 'Theme.php'))
throw new CHttpException(400, Yii::t('Dashboard.main', 'The requested theme type is not set. Please set a theme before attempting to change theme sett... | [
"public",
"function",
"actionTheme",
"(",
")",
"{",
"$",
"theme",
"=",
"Cii",
"::",
"getConfig",
"(",
"'theme'",
",",
"'default'",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"Yii",
"::",
"getPathOfAlias",
"(",
"'base.themes.'",
".",
"$",
"theme",
")",... | Provides control for Theme management
@param string $type The type we want to display | [
"Provides",
"control",
"for",
"Theme",
"management"
] | 94b89239e9ee34ac3b9c398e8d1ba67a08c68c11 | https://github.com/ciims/ciims-modules-dashboard/blob/94b89239e9ee34ac3b9c398e8d1ba67a08c68c11/controllers/SettingsController.php#L86-L104 |
202,748 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.get | function get($action,$params = array(),$options = array()){
$options["method"] = "GET";
return $this->_doRequest($action,$params,$options);
} | php | function get($action,$params = array(),$options = array()){
$options["method"] = "GET";
return $this->_doRequest($action,$params,$options);
} | [
"function",
"get",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"\"method\"",
"]",
"=",
"\"GET\"",
";",
"return",
"$",
"this",
"->",
"_doRequest",
"(",
... | Performs HTTP GET call
$api_data_fetcher->get("articles/detail",array("id" => 123));
$api_data_fetcher->get("articles/index",array("offset" => 10));
$api_data_fetcher->get("articles",array("offset" => 10)); // stejne jako "articles/index"
$api_data_fetcher->get("articles/index",array("offset" => 10),array("cache" =>... | [
"Performs",
"HTTP",
"GET",
"call"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L141-L144 |
202,749 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.post | function post($action,$params = array(),$options = array()){
$options["method"] = "POST";
return $this->_doRequest($action,$params,$options);
} | php | function post($action,$params = array(),$options = array()){
$options["method"] = "POST";
return $this->_doRequest($action,$params,$options);
} | [
"function",
"post",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"\"method\"",
"]",
"=",
"\"POST\"",
";",
"return",
"$",
"this",
"->",
"_doRequest",
"(",... | Performs HTTP POST call
$api_data_fetcher->post("articles/create_new",array(
"title" => "Very Nice Article"
)); | [
"Performs",
"HTTP",
"POST",
"call"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L153-L156 |
202,750 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.put | function put($action,$params = array(),$options = array()){
$options["method"] = "PUT";
return $this->_doRequest($action,$params,$options);
} | php | function put($action,$params = array(),$options = array()){
$options["method"] = "PUT";
return $this->_doRequest($action,$params,$options);
} | [
"function",
"put",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"\"method\"",
"]",
"=",
"\"PUT\"",
";",
"return",
"$",
"this",
"->",
"_doRequest",
"(",
... | Performs HTTP PUT call | [
"Performs",
"HTTP",
"PUT",
"call"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L161-L164 |
202,751 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.delete | function delete($action,$params = array(),$options = array()){
$options["method"] = "DELETE";
return $this->_doRequest($action,$params,$options);
} | php | function delete($action,$params = array(),$options = array()){
$options["method"] = "DELETE";
return $this->_doRequest($action,$params,$options);
} | [
"function",
"delete",
"(",
"$",
"action",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"[",
"\"method\"",
"]",
"=",
"\"DELETE\"",
";",
"return",
"$",
"this",
"->",
"_doRequest",
... | Performs HTTP DELETE call | [
"Performs",
"HTTP",
"DELETE",
"call"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L169-L172 |
202,752 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.postFile | function postFile($action,$file,$params = array(),$options = array()){
if(is_string($file)){
$file = array("path" => $file);
}
$file += array(
"path" => "", // "/path/to/file/photo.jpg"
"postname" => null, // "image"
"name" => null, // "photo.jpg"
"mime_type" => null, // "image/jpeg"
);
if(!$... | php | function postFile($action,$file,$params = array(),$options = array()){
if(is_string($file)){
$file = array("path" => $file);
}
$file += array(
"path" => "", // "/path/to/file/photo.jpg"
"postname" => null, // "image"
"name" => null, // "photo.jpg"
"mime_type" => null, // "image/jpeg"
);
if(!$... | [
"function",
"postFile",
"(",
"$",
"action",
",",
"$",
"file",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"file",
")",
")",
"{",
"$",
"file",
"=",
"array",... | Sends a single file into the specific action
$api_data_fetcher->postFile("images/create_new","/path/to/file.jpg");
$api_data_fetcher->postFile(
"images/create_new", // action name
array("path" => "/path/to/file.jpg", "name" => "earth.jpg", "mime_type" => "image/jpeg"), // file defi... | [
"Sends",
"a",
"single",
"file",
"into",
"the",
"specific",
"action"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L187-L211 |
202,753 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.postRawData | function postRawData($action,$content,$params = array(),$options = array()){
$options += array(
"mime_type" => "application/data"
);
$options["method"] = "POST";
$options["raw_post_data"] = $content;
return $this->_doRequest($action,$params,$options);
} | php | function postRawData($action,$content,$params = array(),$options = array()){
$options += array(
"mime_type" => "application/data"
);
$options["method"] = "POST";
$options["raw_post_data"] = $content;
return $this->_doRequest($action,$params,$options);
} | [
"function",
"postRawData",
"(",
"$",
"action",
",",
"$",
"content",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"+=",
"array",
"(",
"\"mime_type\"",
"=>",
"\"application/data\"",
")... | Sends raw data to the specific action
$raw_data = json_encode($data);
$api_data_fetcher->postRawData("articles/edit",$raw_data,array("id" => 123),array("mime_type" => "application/json")); | [
"Sends",
"raw",
"data",
"to",
"the",
"specific",
"action"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L219-L228 |
202,754 | atk14/ApiDataFetcher | src/api_data_fetcher.php | ApiDataFetcher.postJson | function postJson($action,$json,$options = array()){
if(!is_string($json)){
$json = json_encode($json);
}
$options += array(
"mime_type" => "application/json",
"params" => array(),
);
$params = $options["params"];
unset($options["params"]);
return $this->postRawData($action,$json,$params,$options... | php | function postJson($action,$json,$options = array()){
if(!is_string($json)){
$json = json_encode($json);
}
$options += array(
"mime_type" => "application/json",
"params" => array(),
);
$params = $options["params"];
unset($options["params"]);
return $this->postRawData($action,$json,$params,$options... | [
"function",
"postJson",
"(",
"$",
"action",
",",
"$",
"json",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"json",
")",
")",
"{",
"$",
"json",
"=",
"json_encode",
"(",
"$",
"json",
")",
";",
"}",... | Sends JSON to the specific action
$api_data_fetcher->postJson('action','{"a":"b","c":"d"}');
// array will be automatically encoded into a JSON
$api_data_fetcher->postJson('action',["a" => "b", "c" => "d"]);
// URL params can be a part of the action
$api_data_fetcher->postJson('action/?url_param=value',["a" => "b", ... | [
"Sends",
"JSON",
"to",
"the",
"specific",
"action"
] | 6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde | https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L243-L254 |
202,755 | ScaraMVC/Framework | src/Scara/Config/Configuration.php | Configuration.get | public function get($key, $configFile = '')
{
$config = $this->load((empty($configFile)) ? $this->_configFile : $configFile);
return $this->sift($config, explode('.', $key));
} | php | public function get($key, $configFile = '')
{
$config = $this->load((empty($configFile)) ? $this->_configFile : $configFile);
return $this->sift($config, explode('.', $key));
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"configFile",
"=",
"''",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"load",
"(",
"(",
"empty",
"(",
"$",
"configFile",
")",
")",
"?",
"$",
"this",
"->",
"_configFile",
":",
"$",
"confi... | Gets the config value.
@param string $key - The config item's key
@param string $configFile - Optional if you want to load a specific config file
@return mixed | [
"Gets",
"the",
"config",
"value",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Config/Configuration.php#L39-L44 |
202,756 | ScaraMVC/Framework | src/Scara/Config/Configuration.php | Configuration.load | private function load($file, $dir = '')
{
$path = config_path().'/'.$dir;
$handle = opendir($path);
$ignore = ['.', '..'];
while ($f = readdir($handle)) {
if (!in_array($f, $ignore)) {
if (is_dir($path.$f)) {
if (file_exists($path.$f.'/... | php | private function load($file, $dir = '')
{
$path = config_path().'/'.$dir;
$handle = opendir($path);
$ignore = ['.', '..'];
while ($f = readdir($handle)) {
if (!in_array($f, $ignore)) {
if (is_dir($path.$f)) {
if (file_exists($path.$f.'/... | [
"private",
"function",
"load",
"(",
"$",
"file",
",",
"$",
"dir",
"=",
"''",
")",
"{",
"$",
"path",
"=",
"config_path",
"(",
")",
".",
"'/'",
".",
"$",
"dir",
";",
"$",
"handle",
"=",
"opendir",
"(",
"$",
"path",
")",
";",
"$",
"ignore",
"=",
... | Loads a configuration script.
@param string $file - The name of the config file to load
@param string $dir - The sub directory to load into
@return mixed | [
"Loads",
"a",
"configuration",
"script",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Config/Configuration.php#L54-L76 |
202,757 | Polosa/shade-framework-core | app/ControllerDispatcher.php | ControllerDispatcher.bindService | public function bindService($controllerName, $methodName, $argumentName, $serviceName)
{
$this->bindings[$controllerName][$methodName][$argumentName] = $serviceName;
return $this;
} | php | public function bindService($controllerName, $methodName, $argumentName, $serviceName)
{
$this->bindings[$controllerName][$methodName][$argumentName] = $serviceName;
return $this;
} | [
"public",
"function",
"bindService",
"(",
"$",
"controllerName",
",",
"$",
"methodName",
",",
"$",
"argumentName",
",",
"$",
"serviceName",
")",
"{",
"$",
"this",
"->",
"bindings",
"[",
"$",
"controllerName",
"]",
"[",
"$",
"methodName",
"]",
"[",
"$",
"... | Bind Service to method argument
@param string $controllerName Controller class name
@param string $methodName Method name
@param string $argumentName Argument name
@param string $serviceName Registered Service name
@return ControllerDispatcher | [
"Bind",
"Service",
"to",
"method",
"argument"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/ControllerDispatcher.php#L172-L176 |
202,758 | Polosa/shade-framework-core | app/ControllerDispatcher.php | ControllerDispatcher.setArgumentValue | public function setArgumentValue($controllerName, $methodName, $argumentName, $value)
{
$this->argumentBindings[$controllerName][$methodName][$argumentName] = $value;
return $this;
} | php | public function setArgumentValue($controllerName, $methodName, $argumentName, $value)
{
$this->argumentBindings[$controllerName][$methodName][$argumentName] = $value;
return $this;
} | [
"public",
"function",
"setArgumentValue",
"(",
"$",
"controllerName",
",",
"$",
"methodName",
",",
"$",
"argumentName",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"argumentBindings",
"[",
"$",
"controllerName",
"]",
"[",
"$",
"methodName",
"]",
"[",
"... | Set value of method argument
@param string $controllerName Controller class name
@param string $methodName Method name
@param string $argumentName Argument name
@param string $value Value
@return ControllerDispatcher | [
"Set",
"value",
"of",
"method",
"argument"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/ControllerDispatcher.php#L188-L192 |
202,759 | Polosa/shade-framework-core | app/ControllerDispatcher.php | ControllerDispatcher.getMethodArguments | protected function getMethodArguments($controllerClass, $methodName)
{
$actionArguments = array();
$reflectionAction = new \ReflectionMethod($controllerClass, $methodName);
$actionParametersReflections = $reflectionAction->getParameters();
foreach ($actionParametersReflections as $a... | php | protected function getMethodArguments($controllerClass, $methodName)
{
$actionArguments = array();
$reflectionAction = new \ReflectionMethod($controllerClass, $methodName);
$actionParametersReflections = $reflectionAction->getParameters();
foreach ($actionParametersReflections as $a... | [
"protected",
"function",
"getMethodArguments",
"(",
"$",
"controllerClass",
",",
"$",
"methodName",
")",
"{",
"$",
"actionArguments",
"=",
"array",
"(",
")",
";",
"$",
"reflectionAction",
"=",
"new",
"\\",
"ReflectionMethod",
"(",
"$",
"controllerClass",
",",
... | Get arguments of Controller's Action or constructor
@param string $controllerClass Controller class name
@param string $methodName Method name
@throws Exception
@return array | [
"Get",
"arguments",
"of",
"Controller",
"s",
"Action",
"or",
"constructor"
] | d735d3e8e0616fb9cf4ffc25b8425762ed07940f | https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/ControllerDispatcher.php#L222-L248 |
202,760 | eltrino/PHPUnit_MockAnnotations | src/Eltrino/PHPUnit/MockAnnotations/MockPropertyAnnotationProcessor.php | MockPropertyAnnotationProcessor.process | public function process(\ReflectionProperty $property, TestCase $test)
{
/** @var \ReflectionProperty $property */
$propertyDocComment = $property->getDocComment();
if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) {
$isPrivate = $property->isPrivate();
... | php | public function process(\ReflectionProperty $property, TestCase $test)
{
/** @var \ReflectionProperty $property */
$propertyDocComment = $property->getDocComment();
if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) {
$isPrivate = $property->isPrivate();
... | [
"public",
"function",
"process",
"(",
"\\",
"ReflectionProperty",
"$",
"property",
",",
"TestCase",
"$",
"test",
")",
"{",
"/** @var \\ReflectionProperty $property */",
"$",
"propertyDocComment",
"=",
"$",
"property",
"->",
"getDocComment",
"(",
")",
";",
"if",
"(... | Property processing
Generate and assign mock object to property if it has @Mock annoitation
@param \ReflectionProperty $property
@param TestCase $test
@return void | [
"Property",
"processing",
"Generate",
"and",
"assign",
"mock",
"object",
"to",
"property",
"if",
"it",
"has"
] | 1a06ed59ea0702359848fc01e958f4f92abb503a | https://github.com/eltrino/PHPUnit_MockAnnotations/blob/1a06ed59ea0702359848fc01e958f4f92abb503a/src/Eltrino/PHPUnit/MockAnnotations/MockPropertyAnnotationProcessor.php#L28-L43 |
202,761 | ARCANESOFT/Media | src/Seeds/PermissionsTableSeeder.php | PermissionsTableSeeder.getMediasPermissions | private function getMediasPermissions()
{
return [
[
'name' => 'Medias - List all medias',
'description' => 'Allow to list all the medias.',
'slug' => MediasPolicy::PERMISSION_LIST,
],
[
'name' ... | php | private function getMediasPermissions()
{
return [
[
'name' => 'Medias - List all medias',
'description' => 'Allow to list all the medias.',
'slug' => MediasPolicy::PERMISSION_LIST,
],
[
'name' ... | [
"private",
"function",
"getMediasPermissions",
"(",
")",
"{",
"return",
"[",
"[",
"'name'",
"=>",
"'Medias - List all medias'",
",",
"'description'",
"=>",
"'Allow to list all the medias.'",
",",
"'slug'",
"=>",
"MediasPolicy",
"::",
"PERMISSION_LIST",
",",
"]",
",",
... | Get the Medias permissions.
@return array | [
"Get",
"the",
"Medias",
"permissions",
"."
] | e98aad52f94e6587fcbf79c56f7bf7072929bfc9 | https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Seeds/PermissionsTableSeeder.php#L48-L77 |
202,762 | donatj/mddom | src/AbstractElement.php | AbstractElement.exportMarkdown | public function exportMarkdown( $fragmentLevel = 0 ) {
$output = "";
if( $this instanceof BlockElementInterface || $this->getPreviousSibling() instanceof BlockElementInterface ) {
$output .= "\n\n";
}
$output .= ltrim($this->generateMarkdown($fragmentLevel), "\n");
return $output;
} | php | public function exportMarkdown( $fragmentLevel = 0 ) {
$output = "";
if( $this instanceof BlockElementInterface || $this->getPreviousSibling() instanceof BlockElementInterface ) {
$output .= "\n\n";
}
$output .= ltrim($this->generateMarkdown($fragmentLevel), "\n");
return $output;
} | [
"public",
"function",
"exportMarkdown",
"(",
"$",
"fragmentLevel",
"=",
"0",
")",
"{",
"$",
"output",
"=",
"\"\"",
";",
"if",
"(",
"$",
"this",
"instanceof",
"BlockElementInterface",
"||",
"$",
"this",
"->",
"getPreviousSibling",
"(",
")",
"instanceof",
"Blo... | Convert the DOM to Markdown
@param int $fragmentLevel Private use - recursion depth counter
@return string Markdown | [
"Convert",
"the",
"DOM",
"to",
"Markdown"
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractElement.php#L17-L26 |
202,763 | hiqdev/minii-console | src/Application.php | Application.handleRequest | public function handleRequest($request)
{
list ($route, $params) = $request->resolve();
$this->requestedRoute = $route;
$result = $this->runAction($route, $params);
if ($result instanceof Response) {
return $result;
} else {
$response = $this->getRespo... | php | public function handleRequest($request)
{
list ($route, $params) = $request->resolve();
$this->requestedRoute = $route;
$result = $this->runAction($route, $params);
if ($result instanceof Response) {
return $result;
} else {
$response = $this->getRespo... | [
"public",
"function",
"handleRequest",
"(",
"$",
"request",
")",
"{",
"list",
"(",
"$",
"route",
",",
"$",
"params",
")",
"=",
"$",
"request",
"->",
"resolve",
"(",
")",
";",
"$",
"this",
"->",
"requestedRoute",
"=",
"$",
"route",
";",
"$",
"result",... | Handles the specified request.
@param Request $request the request to be handled
@return Response the resulting response | [
"Handles",
"the",
"specified",
"request",
"."
] | 1da3c1a3b53588265c35330fc161b07665ab14d9 | https://github.com/hiqdev/minii-console/blob/1da3c1a3b53588265c35330fc161b07665ab14d9/src/Application.php#L139-L152 |
202,764 | kambalabs/KmbPuppet | src/KmbPuppet/Service/Group.php | Group.getAllByNode | public function getAllByNode(PuppetDbModel\NodeInterface $node)
{
$environment = $this->environmentService->getByNode($node);
$revision = $environment->getCurrentRevision();
$groups[$environment->getNormalizedName()] = $revision->getGroupsMatchingHostname($node->getName());
while ($e... | php | public function getAllByNode(PuppetDbModel\NodeInterface $node)
{
$environment = $this->environmentService->getByNode($node);
$revision = $environment->getCurrentRevision();
$groups[$environment->getNormalizedName()] = $revision->getGroupsMatchingHostname($node->getName());
while ($e... | [
"public",
"function",
"getAllByNode",
"(",
"PuppetDbModel",
"\\",
"NodeInterface",
"$",
"node",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"environmentService",
"->",
"getByNode",
"(",
"$",
"node",
")",
";",
"$",
"revision",
"=",
"$",
"environment... | Get all groups assigned to specified node group by environment name.
@param PuppetDbModel\NodeInterface $node
@return \KmbDomain\Model\GroupInterface[] | [
"Get",
"all",
"groups",
"assigned",
"to",
"specified",
"node",
"group",
"by",
"environment",
"name",
"."
] | b97a0d2077085df4933c6b3cda9e41468bf7ffca | https://github.com/kambalabs/KmbPuppet/blob/b97a0d2077085df4933c6b3cda9e41468bf7ffca/src/KmbPuppet/Service/Group.php#L36-L47 |
202,765 | squareproton/Bond | src/Bond/Di/ContainerFromAnnotations.php | ContainerFromAnnotations.getResources | private function getResources()
{
$resources = [];
foreach( $this->getClassAnnotations() as $annotation ) {
// is this a resource
if( 0 === strpos($annotation, "resource") ) {
$resources[] = explode(' ', $annotation)[1];
}
}
ret... | php | private function getResources()
{
$resources = [];
foreach( $this->getClassAnnotations() as $annotation ) {
// is this a resource
if( 0 === strpos($annotation, "resource") ) {
$resources[] = explode(' ', $annotation)[1];
}
}
ret... | [
"private",
"function",
"getResources",
"(",
")",
"{",
"$",
"resources",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getClassAnnotations",
"(",
")",
"as",
"$",
"annotation",
")",
"{",
"// is this a resource",
"if",
"(",
"0",
"===",
"strpos",
"... | list of files to load as configuration.
should be set to empty list if none needed | [
"list",
"of",
"files",
"to",
"load",
"as",
"configuration",
".",
"should",
"be",
"set",
"to",
"empty",
"list",
"if",
"none",
"needed"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Di/ContainerFromAnnotations.php#L57-L72 |
202,766 | jenskooij/cloudcontrol | src/storage/storage/ImagesStorage.php | ImagesStorage.deleteImageByName | public function deleteImageByName($filename)
{
$destinationPath = $this->getDestinationPath();
$images = $this->getImages();
foreach ($images as $key => $image) {
if ($image->file == $filename) {
foreach ($image->set as $imageSetFilename) {
$... | php | public function deleteImageByName($filename)
{
$destinationPath = $this->getDestinationPath();
$images = $this->getImages();
foreach ($images as $key => $image) {
if ($image->file == $filename) {
foreach ($image->set as $imageSetFilename) {
$... | [
"public",
"function",
"deleteImageByName",
"(",
"$",
"filename",
")",
"{",
"$",
"destinationPath",
"=",
"$",
"this",
"->",
"getDestinationPath",
"(",
")",
";",
"$",
"images",
"=",
"$",
"this",
"->",
"getImages",
"(",
")",
";",
"foreach",
"(",
"$",
"image... | Delete image by name
@param $filename | [
"Delete",
"image",
"by",
"name"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImagesStorage.php#L81-L101 |
202,767 | miknatr/grace-dbal | lib/Grace/DBAL/ConnectionAbstract/ConnectionAbstract.php | ConnectionAbstract.generateNewId | public function generateNewId($table)
{
if (!isset($this->idCounterByTable[$table])) {
$this->idCounterByTable[$table] = $this->getSQLBuilder()->select($table)->field('id')->orderDesc('id')->limit(0, 1)->fetchResult();
}
for ($i = 0; $i < 50; $i++) {
$this->idCounter... | php | public function generateNewId($table)
{
if (!isset($this->idCounterByTable[$table])) {
$this->idCounterByTable[$table] = $this->getSQLBuilder()->select($table)->field('id')->orderDesc('id')->limit(0, 1)->fetchResult();
}
for ($i = 0; $i < 50; $i++) {
$this->idCounter... | [
"public",
"function",
"generateNewId",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"idCounterByTable",
"[",
"$",
"table",
"]",
")",
")",
"{",
"$",
"this",
"->",
"idCounterByTable",
"[",
"$",
"table",
"]",
"=",
"$",
... | Generate new id for insert
@param string $table
@throws \OutOfBoundsException
@return mixed | [
"Generate",
"new",
"id",
"for",
"insert"
] | b05e03040568631dc6c77477c0eaed6e60db4ba2 | https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/ConnectionAbstract/ConnectionAbstract.php#L338-L361 |
202,768 | itcreator/custom-cmf | Module/User/src/Cmf/User/Controller/UserController.php | UserController.readAction | public function readAction()
{
$result = parent::readAction();
if (!is_array($result)) {
return $result;
}
$em = $this->getEntityManager();
$status = $this->getFieldsConfig()->getConfigItem('status');
$statuses = $status['dataSource']->getData();
... | php | public function readAction()
{
$result = parent::readAction();
if (!is_array($result)) {
return $result;
}
$em = $this->getEntityManager();
$status = $this->getFieldsConfig()->getConfigItem('status');
$statuses = $status['dataSource']->getData();
... | [
"public",
"function",
"readAction",
"(",
")",
"{",
"$",
"result",
"=",
"parent",
"::",
"readAction",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"result",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
"$",
"em",
"=",
"$",
"this",
"->... | View user page
@return array|Forward | [
"View",
"user",
"page"
] | 42fc0535dfa0f641856f06673f6ab596b2020c40 | https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/User/src/Cmf/User/Controller/UserController.php#L61-L76 |
202,769 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.usePreviewTables | public function usePreviewTables($bEnabled)
{
if (!empty($bEnabled)) {
$this->isPreviewMode = true;
$this->table = NAILS_DB_PREFIX . 'blog_post_preview';
$this->tableAlias = 'bp';
$this->tableCat = NAILS_DB_PREFIX . 'blog_post_preview_category';
... | php | public function usePreviewTables($bEnabled)
{
if (!empty($bEnabled)) {
$this->isPreviewMode = true;
$this->table = NAILS_DB_PREFIX . 'blog_post_preview';
$this->tableAlias = 'bp';
$this->tableCat = NAILS_DB_PREFIX . 'blog_post_preview_category';
... | [
"public",
"function",
"usePreviewTables",
"(",
"$",
"bEnabled",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"bEnabled",
")",
")",
"{",
"$",
"this",
"->",
"isPreviewMode",
"=",
"true",
";",
"$",
"this",
"->",
"table",
"=",
"NAILS_DB_PREFIX",
".",
"'blo... | Sets the table names to use, either the normal tables, or the preview tables.
@param boolean $bEnabled Whether to use the preview tables or not
@return void | [
"Sets",
"the",
"table",
"names",
"to",
"use",
"either",
"the",
"normal",
"tables",
"or",
"the",
"preview",
"tables",
"."
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L57-L91 |
202,770 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.validateSlug | private function validateSlug($sSlug, $sTitle, $iId = null)
{
/**
* Slugs don't matter in preview mode
*/
if ($this->isPreviewMode) {
return 'slug';
}
// --------------------------------------------------------------------------
/**
* ... | php | private function validateSlug($sSlug, $sTitle, $iId = null)
{
/**
* Slugs don't matter in preview mode
*/
if ($this->isPreviewMode) {
return 'slug';
}
// --------------------------------------------------------------------------
/**
* ... | [
"private",
"function",
"validateSlug",
"(",
"$",
"sSlug",
",",
"$",
"sTitle",
",",
"$",
"iId",
"=",
"null",
")",
"{",
"/**\n * Slugs don't matter in preview mode\n */",
"if",
"(",
"$",
"this",
"->",
"isPreviewMode",
")",
"{",
"return",
"'slug'",
... | Validates a slug, if supplied, generates one from the title, if not
@param string $sSlug The slug to test
@param string $sTitle The title to generate a slug from if no slug available
@param integer $siId The ID of the post to ignore from a comparison, if any
@return string | [
"Validates",
"a",
"slug",
"if",
"supplied",
"generates",
"one",
"from",
"the",
"title",
"if",
"not"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L568-L611 |
202,771 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getById | public function getById($id, $data = null)
{
$data = $this->includeEverything($data);
return parent::getById($id, $data);
} | php | public function getById($id, $data = null)
{
$data = $this->includeEverything($data);
return parent::getById($id, $data);
} | [
"public",
"function",
"getById",
"(",
"$",
"id",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"includeEverything",
"(",
"$",
"data",
")",
";",
"return",
"parent",
"::",
"getById",
"(",
"$",
"id",
",",
"$",
"data",
... | Fetch a pst by it's ID
@param int $id The ID of the object to fetch
@param mixed $data Any data to pass to getCountCommon()
@return stdClass | [
"Fetch",
"a",
"pst",
"by",
"it",
"s",
"ID"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L775-L779 |
202,772 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getBySlug | public function getBySlug($id, $data = null)
{
$data = $this->includeEverything($data);
return parent::getBySlug($id, $data);
} | php | public function getBySlug($id, $data = null)
{
$data = $this->includeEverything($data);
return parent::getBySlug($id, $data);
} | [
"public",
"function",
"getBySlug",
"(",
"$",
"id",
",",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"includeEverything",
"(",
"$",
"data",
")",
";",
"return",
"parent",
"::",
"getBySlug",
"(",
"$",
"id",
",",
"$",
"data... | Fetch a post by it's slug
@param int $slug The slug of the object to fetch
@param mixed $data Any data to pass to getCountCommon()
@return stdClass | [
"Fetch",
"a",
"post",
"by",
"it",
"s",
"slug"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L791-L795 |
202,773 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getCountCommon | protected function getCountCommon($data = [])
{
$oDb = Factory::service('Database');
$oDb->select(
[
$this->tableAlias . '.id',
$this->tableAlias . '.blog_id',
'b.label blog_label',
$this->tableAlias . '.slug',
... | php | protected function getCountCommon($data = [])
{
$oDb = Factory::service('Database');
$oDb->select(
[
$this->tableAlias . '.id',
$this->tableAlias . '.blog_id',
'b.label blog_label',
$this->tableAlias . '.slug',
... | [
"protected",
"function",
"getCountCommon",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"$",
"oDb",
"->",
"select",
"(",
"[",
"$",
"this",
"->",
"tableAlias",
".",
"'.id'",
",",
... | Applies common conditionals
This method applies the conditionals which are common across the get_*()
methods and the count() method.
@param array $data Data passed from the calling method
@return void | [
"Applies",
"common",
"conditionals"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L830-L909 |
202,774 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.includeEverything | protected function includeEverything($data)
{
if (is_null($data)) {
$data = [];
}
if (!isset($data['include_body'])) {
$data['include_body'] = true;
}
if (!isset($data['include_categories'])) {
$data['include_categories'] = true;
... | php | protected function includeEverything($data)
{
if (is_null($data)) {
$data = [];
}
if (!isset($data['include_body'])) {
$data['include_body'] = true;
}
if (!isset($data['include_categories'])) {
$data['include_categories'] = true;
... | [
"protected",
"function",
"includeEverything",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'include_body'",
"]",
")",
")"... | Sets the data array to include everything
This method is called by the getBy*() methods and, if not already set,
will alter the $data array so that all the include_* parameters are set.
@param string $data Data passed from the calling method
@return void | [
"Sets",
"the",
"data",
"array",
"to",
"include",
"everything"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L923-L963 |
202,775 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getWithCategory | public function getWithCategory($categoryIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableCat table so we can WHERE on it.
$oDb->join(
$this->tableCat . ' ' . $this->tableCatPrefix,
... | php | public function getWithCategory($categoryIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableCat table so we can WHERE on it.
$oDb->join(
$this->tableCat . ' ' . $this->tableCatPrefix,
... | [
"public",
"function",
"getWithCategory",
"(",
"$",
"categoryIdSlug",
",",
"$",
"page",
"=",
"null",
",",
"$",
"perPage",
"=",
"null",
",",
"$",
"data",
"=",
"null",
",",
"$",
"includeDeleted",
"=",
"false",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
... | Gets posts which are in a particular category
@param mixed $categoryIdSlug The category's ID or slug
@param int $page The page to render
@param int $perPage The number of posts per page
@param array $data Data to pass to getCountCommon()
@param boolean $includeDeleted Whethe... | [
"Gets",
"posts",
"which",
"are",
"in",
"a",
"particular",
"category"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1028-L1060 |
202,776 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.countWithCategory | public function countWithCategory($categoryIdSlug, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableCat table so we can WHERE on it.
$oDb->join(
$this->tableCat . ' ' . $this->tableCatPrefix,
$this->tableCatPrefix... | php | public function countWithCategory($categoryIdSlug, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableCat table so we can WHERE on it.
$oDb->join(
$this->tableCat . ' ' . $this->tableCatPrefix,
$this->tableCatPrefix... | [
"public",
"function",
"countWithCategory",
"(",
"$",
"categoryIdSlug",
",",
"$",
"data",
"=",
"null",
",",
"$",
"includeDeleted",
"=",
"false",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"// Join the $this->tableCat ta... | Count the number of posts in a particular category
@param mixed $categoryIdSlug The category's ID or slug
@param array $data Data to pass to getCountCommon()
@param boolean $includeDeleted Whether to include deleted posts in the result
@return int | [
"Count",
"the",
"number",
"of",
"posts",
"in",
"a",
"particular",
"category"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1073-L1099 |
202,777 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getWithTag | public function getWithTag($tagIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableTag table so we can WHERE on it.
$oDb->join(
$this->tableTag . ' ' . $this->tableTagPrefix,
$t... | php | public function getWithTag($tagIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableTag table so we can WHERE on it.
$oDb->join(
$this->tableTag . ' ' . $this->tableTagPrefix,
$t... | [
"public",
"function",
"getWithTag",
"(",
"$",
"tagIdSlug",
",",
"$",
"page",
"=",
"null",
",",
"$",
"perPage",
"=",
"null",
",",
"$",
"data",
"=",
"null",
",",
"$",
"includeDeleted",
"=",
"false",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service"... | Gets posts which are in a particular tag
@param mixed $tagIdSlug The tag's ID or slug
@param int $page The page to render
@param int $perPage The number of posts per page
@param array $data Data to pass to getCountCommon()
@param boolean $includeDeleted Whether to inclu... | [
"Gets",
"posts",
"which",
"are",
"in",
"a",
"particular",
"tag"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1114-L1142 |
202,778 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.countWithTag | public function countWithTag($tagIdSlug, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableTag table so we can WHERE on it.
$oDb->join(
$this->tableTag . ' ' . $this->tableTagPrefix,
$this->tableTagPrefix . '.post_... | php | public function countWithTag($tagIdSlug, $data = null, $includeDeleted = false)
{
$oDb = Factory::service('Database');
// Join the $this->tableTag table so we can WHERE on it.
$oDb->join(
$this->tableTag . ' ' . $this->tableTagPrefix,
$this->tableTagPrefix . '.post_... | [
"public",
"function",
"countWithTag",
"(",
"$",
"tagIdSlug",
",",
"$",
"data",
"=",
"null",
",",
"$",
"includeDeleted",
"=",
"false",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"// Join the $this->tableTag table so we ... | Count the number of posts in a particular tag
@param mixed $tagIdSlug The tag's ID or slug
@param array $data Data to pass to getCountCommon()
@param boolean $includeDeleted Whether to include deleted posts in the result
@return int | [
"Count",
"the",
"number",
"of",
"posts",
"in",
"a",
"particular",
"tag"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1155-L1185 |
202,779 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getWithAssociation | public function getWithAssociation($associationIndex, $associatedId)
{
$oConfig = Factory::service('Config');
$oConfig->load('blog/blog');
$associations = $oConfig->item('blog_post_associations');
if (!isset($associations[$associationIndex])) {
return [];
}
... | php | public function getWithAssociation($associationIndex, $associatedId)
{
$oConfig = Factory::service('Config');
$oConfig->load('blog/blog');
$associations = $oConfig->item('blog_post_associations');
if (!isset($associations[$associationIndex])) {
return [];
}
... | [
"public",
"function",
"getWithAssociation",
"(",
"$",
"associationIndex",
",",
"$",
"associatedId",
")",
"{",
"$",
"oConfig",
"=",
"Factory",
"::",
"service",
"(",
"'Config'",
")",
";",
"$",
"oConfig",
"->",
"load",
"(",
"'blog/blog'",
")",
";",
"$",
"asso... | Get posts with a particular association
@param int $associationIndex The association's index
@param int $associatedId The Id of the item to be associated with
@return array | [
"Get",
"posts",
"with",
"a",
"particular",
"association"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1209-L1238 |
202,780 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.addHit | public function addHit($id, $data = [])
{
if (!$id) {
$this->setError('Post ID is required.');
return false;
}
// --------------------------------------------------------------------------
$oDate = Factory::factory('DateTime');
$hitDa... | php | public function addHit($id, $data = [])
{
if (!$id) {
$this->setError('Post ID is required.');
return false;
}
// --------------------------------------------------------------------------
$oDate = Factory::factory('DateTime');
$hitDa... | [
"public",
"function",
"addHit",
"(",
"$",
"id",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"setError",
"(",
"'Post ID is required.'",
")",
";",
"return",
"false",
";",
"}",
"// -----------------... | Add a hit to a post
@param int $id The post's ID
@param array $data Details about the hit | [
"Add",
"a",
"hit",
"to",
"a",
"post"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1248-L1298 |
202,781 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.getTypes | public function getTypes()
{
$oDb = Factory::service('Database');
$oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE "type"')->row();
$sTypes = $oResult->Type;
$sTypes = preg_replace('/enum\((.*)\)/', '$1', $sTypes);
$sTypes = str_replace("'", '', $s... | php | public function getTypes()
{
$oDb = Factory::service('Database');
$oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE "type"')->row();
$sTypes = $oResult->Type;
$sTypes = preg_replace('/enum\((.*)\)/', '$1', $sTypes);
$sTypes = str_replace("'", '', $s... | [
"public",
"function",
"getTypes",
"(",
")",
"{",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"$",
"oResult",
"=",
"$",
"oDb",
"->",
"query",
"(",
"'SHOW COLUMNS FROM `'",
".",
"$",
"this",
"->",
"table",
".",
"'` LIKE \"type... | Parses the `type` column and returns an array of potential post types
@return array | [
"Parses",
"the",
"type",
"column",
"and",
"returns",
"an",
"array",
"of",
"potential",
"post",
"types"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1306-L1322 |
202,782 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.formatUrl | public function formatUrl($slug, $blogId)
{
$this->load->model('blog/blog_model');
return $this->blog_model->getBlogUrl($blogId) . '/' . $slug;
} | php | public function formatUrl($slug, $blogId)
{
$this->load->model('blog/blog_model');
return $this->blog_model->getBlogUrl($blogId) . '/' . $slug;
} | [
"public",
"function",
"formatUrl",
"(",
"$",
"slug",
",",
"$",
"blogId",
")",
"{",
"$",
"this",
"->",
"load",
"->",
"model",
"(",
"'blog/blog_model'",
")",
";",
"return",
"$",
"this",
"->",
"blog_model",
"->",
"getBlogUrl",
"(",
"$",
"blogId",
")",
"."... | Format a posts's URL
@param string $slug The post's slug
@param int $blogId The blog's ID
@return string | [
"Format",
"a",
"posts",
"s",
"URL"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1334-L1338 |
202,783 | nails/module-blog | blog/models/blog_post_model.php | NAILS_Blog_post_model.extractYoutubeId | public function extractYoutubeId($sUrl)
{
preg_match('/^https?\:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_\-]+)$/', $sUrl, $aMatches);
if (!empty($aMatches[1])) {
return $aMatches[1];
} else {
preg_match('/^https?\:\/\/youtu\.be\/([a-zA-Z0-9_\-]+)$/', $sUrl, $aM... | php | public function extractYoutubeId($sUrl)
{
preg_match('/^https?\:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_\-]+)$/', $sUrl, $aMatches);
if (!empty($aMatches[1])) {
return $aMatches[1];
} else {
preg_match('/^https?\:\/\/youtu\.be\/([a-zA-Z0-9_\-]+)$/', $sUrl, $aM... | [
"public",
"function",
"extractYoutubeId",
"(",
"$",
"sUrl",
")",
"{",
"preg_match",
"(",
"'/^https?\\:\\/\\/www\\.youtube\\.com\\/watch\\?v=([a-zA-Z0-9_\\-]+)$/'",
",",
"$",
"sUrl",
",",
"$",
"aMatches",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"aMatches",
"["... | Extracts the ID from a YouTube URL
@param string $sUrl The YouTube URL
@return string | [
"Extracts",
"the",
"ID",
"from",
"a",
"YouTube",
"URL"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1447-L1466 |
202,784 | erenmustafaozdal/laravel-modules-base | src/Services/MailService.php | MailService.queue | public function queue()
{
$from = $this->fromEmail;
$to = $this->toEmail;
$name = $this->toName;
$subject = $this->subject;
$this->beauty->queue($this->view, $this->datas, function($message) use($from,$to,$name,$subject)
{
$message->from($from)
... | php | public function queue()
{
$from = $this->fromEmail;
$to = $this->toEmail;
$name = $this->toName;
$subject = $this->subject;
$this->beauty->queue($this->view, $this->datas, function($message) use($from,$to,$name,$subject)
{
$message->from($from)
... | [
"public",
"function",
"queue",
"(",
")",
"{",
"$",
"from",
"=",
"$",
"this",
"->",
"fromEmail",
";",
"$",
"to",
"=",
"$",
"this",
"->",
"toEmail",
";",
"$",
"name",
"=",
"$",
"this",
"->",
"toName",
";",
"$",
"subject",
"=",
"$",
"this",
"->",
... | send queue mail | [
"send",
"queue",
"mail"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Services/MailService.php#L73-L85 |
202,785 | erenmustafaozdal/laravel-modules-base | src/Services/MailService.php | MailService.handlerOptions | public function handlerOptions()
{
$this->fromEmail = config('mail.from.address');
$this->toEmail = config('laravel-modules-base.developer_mail');
$this->toName = config('laravel-modules-base.developer_name');
$this->subject = trans('laravel-modules-base::admin.email.error.subject');... | php | public function handlerOptions()
{
$this->fromEmail = config('mail.from.address');
$this->toEmail = config('laravel-modules-base.developer_mail');
$this->toName = config('laravel-modules-base.developer_name');
$this->subject = trans('laravel-modules-base::admin.email.error.subject');... | [
"public",
"function",
"handlerOptions",
"(",
")",
"{",
"$",
"this",
"->",
"fromEmail",
"=",
"config",
"(",
"'mail.from.address'",
")",
";",
"$",
"this",
"->",
"toEmail",
"=",
"config",
"(",
"'laravel-modules-base.developer_mail'",
")",
";",
"$",
"this",
"->",
... | exception handler set options | [
"exception",
"handler",
"set",
"options"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Services/MailService.php#L107-L114 |
202,786 | Vectrex/vxPHP | src/File/UploadedFile.php | UploadedFile.move | public function move(FilesystemFolder $destination) {
if($this->alreadyUploaded) {
return parent::move($destination);
}
$oldpath = $this->folder->getPath() . $this->filename;
$filename = self::sanitizeFilename($this->originalName, $destination);
$newpath = $destination->getPath() . $filename;
// ensur... | php | public function move(FilesystemFolder $destination) {
if($this->alreadyUploaded) {
return parent::move($destination);
}
$oldpath = $this->folder->getPath() . $this->filename;
$filename = self::sanitizeFilename($this->originalName, $destination);
$newpath = $destination->getPath() . $filename;
// ensur... | [
"public",
"function",
"move",
"(",
"FilesystemFolder",
"$",
"destination",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"alreadyUploaded",
")",
"{",
"return",
"parent",
"::",
"move",
"(",
"$",
"destination",
")",
";",
"}",
"$",
"oldpath",
"=",
"$",
"this",
... | performs an initial move of an uploaded file
from its temporary folder to a destination folder
and renames it to the original filename
once completed a flag is set and subsequent
moves are redirected to the parent method
(non-PHPdoc)
@see \vxPHP\File\FilesystemFile::move() | [
"performs",
"an",
"initial",
"move",
"of",
"an",
"uploaded",
"file",
"from",
"its",
"temporary",
"folder",
"to",
"a",
"destination",
"folder",
"and",
"renames",
"it",
"to",
"the",
"original",
"filename",
"once",
"completed",
"a",
"flag",
"is",
"set",
"and",
... | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/UploadedFile.php#L87-L143 |
202,787 | danielgp/common-lib | source/MySQLiByDanielGPstructures.php | MySQLiByDanielGPstructures.getFieldNameForDisplay | protected function getFieldNameForDisplay($details)
{
$tableUniqueId = $details['TABLE_SCHEMA'] . '.' . $details['TABLE_NAME'];
if ($details['COLUMN_COMMENT'] != '') {
return $details['COLUMN_COMMENT'];
} elseif (isset($this->advCache['tableStructureLocales'][$tableUniqueId][$det... | php | protected function getFieldNameForDisplay($details)
{
$tableUniqueId = $details['TABLE_SCHEMA'] . '.' . $details['TABLE_NAME'];
if ($details['COLUMN_COMMENT'] != '') {
return $details['COLUMN_COMMENT'];
} elseif (isset($this->advCache['tableStructureLocales'][$tableUniqueId][$det... | [
"protected",
"function",
"getFieldNameForDisplay",
"(",
"$",
"details",
")",
"{",
"$",
"tableUniqueId",
"=",
"$",
"details",
"[",
"'TABLE_SCHEMA'",
"]",
".",
"'.'",
".",
"$",
"details",
"[",
"'TABLE_NAME'",
"]",
";",
"if",
"(",
"$",
"details",
"[",
"'COLUM... | Returns the name of a field for displaying
@param array $details
@return string | [
"Returns",
"the",
"name",
"of",
"a",
"field",
"for",
"displaying"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L67-L76 |
202,788 | danielgp/common-lib | source/MySQLiByDanielGPstructures.php | MySQLiByDanielGPstructures.getFieldOutputTextFK | protected function getFieldOutputTextFK($foreignKeysArray, $value, $iar)
{
$query = $this->sQueryGenericSelectKeyValue([
'`' . $value['COLUMN_NAME'] . '`',
$foreignKeysArray[$value['COLUMN_NAME']][2],
$foreignKeysArray[$value['COLUMN_NAME']][0]
]);
$inAd... | php | protected function getFieldOutputTextFK($foreignKeysArray, $value, $iar)
{
$query = $this->sQueryGenericSelectKeyValue([
'`' . $value['COLUMN_NAME'] . '`',
$foreignKeysArray[$value['COLUMN_NAME']][2],
$foreignKeysArray[$value['COLUMN_NAME']][0]
]);
$inAd... | [
"protected",
"function",
"getFieldOutputTextFK",
"(",
"$",
"foreignKeysArray",
",",
"$",
"value",
",",
"$",
"iar",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"sQueryGenericSelectKeyValue",
"(",
"[",
"'`'",
".",
"$",
"value",
"[",
"'COLUMN_NAME'",
"]",
... | Prepares the output of text fields defined w. FKs
@param array $foreignKeysArray
@param array $value
@param array $iar
@return string | [
"Prepares",
"the",
"output",
"of",
"text",
"fields",
"defined",
"w",
".",
"FKs"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L86-L105 |
202,789 | danielgp/common-lib | source/MySQLiByDanielGPstructures.php | MySQLiByDanielGPstructures.getRowDataFromTable | protected function getRowDataFromTable($tableName, $filtersArray)
{
$query = $this->sQueryRowsFromTable([$tableName, $this->setArrayToFilterValues($filtersArray)]);
$rawData = $this->setMySQLquery2Server($query, 'array_pairs_key_value')['result'];
if (!is_null($rawData)) {
$thi... | php | protected function getRowDataFromTable($tableName, $filtersArray)
{
$query = $this->sQueryRowsFromTable([$tableName, $this->setArrayToFilterValues($filtersArray)]);
$rawData = $this->setMySQLquery2Server($query, 'array_pairs_key_value')['result'];
if (!is_null($rawData)) {
$thi... | [
"protected",
"function",
"getRowDataFromTable",
"(",
"$",
"tableName",
",",
"$",
"filtersArray",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"sQueryRowsFromTable",
"(",
"[",
"$",
"tableName",
",",
"$",
"this",
"->",
"setArrayToFilterValues",
"(",
"$",
"f... | Reads data from table into REQUEST super global
@param string $tableName
@param array $filtersArray | [
"Reads",
"data",
"from",
"table",
"into",
"REQUEST",
"super",
"global"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L279-L290 |
202,790 | danielgp/common-lib | source/MySQLiByDanielGPstructures.php | MySQLiByDanielGPstructures.setArrayToFilterValues | private function setArrayToFilterValues($entryArray, $referenceTable = '')
{
$filters = [];
$refTable = $this->correctTableWithQuotesAsFieldPrefix($referenceTable);
foreach ($entryArray as $key => $value) {
if (is_array($value)) {
$filters[] = $this->setArrayLine... | php | private function setArrayToFilterValues($entryArray, $referenceTable = '')
{
$filters = [];
$refTable = $this->correctTableWithQuotesAsFieldPrefix($referenceTable);
foreach ($entryArray as $key => $value) {
if (is_array($value)) {
$filters[] = $this->setArrayLine... | [
"private",
"function",
"setArrayToFilterValues",
"(",
"$",
"entryArray",
",",
"$",
"referenceTable",
"=",
"''",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"$",
"refTable",
"=",
"$",
"this",
"->",
"correctTableWithQuotesAsFieldPrefix",
"(",
"$",
"referenceTa... | Transforms an array into usable filters
@param array $entryArray
@param string $referenceTable
@return string | [
"Transforms",
"an",
"array",
"into",
"usable",
"filters"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L299-L311 |
202,791 | t3v/t3v_core | Classes/Utility/StringUtility.php | StringUtility.asciify | public static function asciify(string $input, string $language = 'en', bool $removeUnsupported = true): string {
$output = S::toAscii($input, $language, $removeUnsupported);
return $output;
} | php | public static function asciify(string $input, string $language = 'en', bool $removeUnsupported = true): string {
$output = S::toAscii($input, $language, $removeUnsupported);
return $output;
} | [
"public",
"static",
"function",
"asciify",
"(",
"string",
"$",
"input",
",",
"string",
"$",
"language",
"=",
"'en'",
",",
"bool",
"$",
"removeUnsupported",
"=",
"true",
")",
":",
"string",
"{",
"$",
"output",
"=",
"S",
"::",
"toAscii",
"(",
"$",
"input... | Returns an ASCII version of the input.
@param string $input The input
@param string $language The optional language, defaults to `en`
@param bool $removeUnsupported Remove unsupported characters , defaults to `true`
@return string The asciified input | [
"Returns",
"an",
"ASCII",
"version",
"of",
"the",
"input",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/StringUtility.php#L20-L24 |
202,792 | t3v/t3v_core | Classes/Utility/StringUtility.php | StringUtility.camelize | public static function camelize(string $input, string $separator = '_', bool $capitalizeFirstCharacter = false): string {
$output = $input;
if (ctype_upper($output)) {
$output = mb_strtolower($output);
}
if (strpos($output, $separator) || strpos($output, ' ')) {
$output = mb_strtolower($in... | php | public static function camelize(string $input, string $separator = '_', bool $capitalizeFirstCharacter = false): string {
$output = $input;
if (ctype_upper($output)) {
$output = mb_strtolower($output);
}
if (strpos($output, $separator) || strpos($output, ' ')) {
$output = mb_strtolower($in... | [
"public",
"static",
"function",
"camelize",
"(",
"string",
"$",
"input",
",",
"string",
"$",
"separator",
"=",
"'_'",
",",
"bool",
"$",
"capitalizeFirstCharacter",
"=",
"false",
")",
":",
"string",
"{",
"$",
"output",
"=",
"$",
"input",
";",
"if",
"(",
... | Camelizes an input.
@param string $input The input
@param string $separator The optional separator, defaults to `_`
@param bool $capitalizeFirstCharacter If the first character should be capitalized, defaults to `false`
@return string The camelized input | [
"Camelizes",
"an",
"input",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/StringUtility.php#L34-L51 |
202,793 | phpffcms/ffcms-core | src/Helper/Security.php | Security.secureHtml | public function secureHtml($data): ?string
{
return (Any::isArray($data) ? $this->purifier->purifyArray($data) : $this->purifier->purify($data));
} | php | public function secureHtml($data): ?string
{
return (Any::isArray($data) ? $this->purifier->purifyArray($data) : $this->purifier->purify($data));
} | [
"public",
"function",
"secureHtml",
"(",
"$",
"data",
")",
":",
"?",
"string",
"{",
"return",
"(",
"Any",
"::",
"isArray",
"(",
"$",
"data",
")",
"?",
"$",
"this",
"->",
"purifier",
"->",
"purifyArray",
"(",
"$",
"data",
")",
":",
"$",
"this",
"->"... | Secure html code
@param string|array $data
@return string | [
"Secure",
"html",
"code"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Security.php#L40-L43 |
202,794 | phpffcms/ffcms-core | src/Helper/Security.php | Security.strip_tags | public function strip_tags($html, $escapeQuotes = true)
{
// recursive usage
if (Any::isArray($html)) {
foreach ($html as $key=>$value) {
$html[$key] = $this->strip_tags($value, $escapeQuotes);
}
return $html;
}
$text = strip_tags(... | php | public function strip_tags($html, $escapeQuotes = true)
{
// recursive usage
if (Any::isArray($html)) {
foreach ($html as $key=>$value) {
$html[$key] = $this->strip_tags($value, $escapeQuotes);
}
return $html;
}
$text = strip_tags(... | [
"public",
"function",
"strip_tags",
"(",
"$",
"html",
",",
"$",
"escapeQuotes",
"=",
"true",
")",
"{",
"// recursive usage",
"if",
"(",
"Any",
"::",
"isArray",
"(",
"$",
"html",
")",
")",
"{",
"foreach",
"(",
"$",
"html",
"as",
"$",
"key",
"=>",
"$",... | String html tags and escape quotes
@param string|array $html
@param boolean $escapeQuotes
@return string|array|null | [
"String",
"html",
"tags",
"and",
"escape",
"quotes"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Security.php#L51-L67 |
202,795 | phpffcms/ffcms-core | src/Helper/Security.php | Security.strip_php_tags | public function strip_php_tags($data)
{
if (is_array($data)) {
foreach ($data as $key=>$value) {
$data[$key] = $this->strip_php_tags($value);
}
return $data;
}
return addslashes(htmlspecialchars(strip_tags($data)));
} | php | public function strip_php_tags($data)
{
if (is_array($data)) {
foreach ($data as $key=>$value) {
$data[$key] = $this->strip_php_tags($value);
}
return $data;
}
return addslashes(htmlspecialchars(strip_tags($data)));
} | [
"public",
"function",
"strip_php_tags",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"data",
"[",
"$",
"key",
"]",
"=",
"$"... | Strip php tags and notations in string.
@param array|string $data
@return array|null|string | [
"Strip",
"php",
"tags",
"and",
"notations",
"in",
"string",
"."
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Security.php#L74-L83 |
202,796 | sil-project/VarietyBundle | src/Entity/Genus.php | Genus.setFamily | public function setFamily(\Librinfo\VarietiesBundle\Entity\Family $family = null)
{
$this->family = $family;
return $this;
} | php | public function setFamily(\Librinfo\VarietiesBundle\Entity\Family $family = null)
{
$this->family = $family;
return $this;
} | [
"public",
"function",
"setFamily",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"Family",
"$",
"family",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"family",
"=",
"$",
"family",
";",
"return",
"$",
"this",
";",
"}"
] | Set family.
@param \Librinfo\VarietiesBundle\Entity\Family $family
@return Genus | [
"Set",
"family",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Genus.php#L129-L134 |
202,797 | sil-project/VarietyBundle | src/Entity/Genus.php | Genus.addSpeciese | public function addSpeciese(\Librinfo\VarietiesBundle\Entity\Species $species)
{
$species->setGenus($this);
$this->specieses->add($species);
return $this;
} | php | public function addSpeciese(\Librinfo\VarietiesBundle\Entity\Species $species)
{
$species->setGenus($this);
$this->specieses->add($species);
return $this;
} | [
"public",
"function",
"addSpeciese",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"Species",
"$",
"species",
")",
"{",
"$",
"species",
"->",
"setGenus",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"specieses",
"->",
"add",
"("... | Alias for addSpecies.
@param \Librinfo\VarietiesBundle\Entity\Species $species
@return \Librinfo\VarietiesBundle\Entity\Genus | [
"Alias",
"for",
"addSpecies",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Genus.php#L153-L159 |
202,798 | sil-project/VarietyBundle | src/Entity/Genus.php | Genus.removeSpecies | public function removeSpecies(\Librinfo\VarietiesBundle\Entity\Species $species)
{
return $this->specieses->removeElement($species);
} | php | public function removeSpecies(\Librinfo\VarietiesBundle\Entity\Species $species)
{
return $this->specieses->removeElement($species);
} | [
"public",
"function",
"removeSpecies",
"(",
"\\",
"Librinfo",
"\\",
"VarietiesBundle",
"\\",
"Entity",
"\\",
"Species",
"$",
"species",
")",
"{",
"return",
"$",
"this",
"->",
"specieses",
"->",
"removeElement",
"(",
"$",
"species",
")",
";",
"}"
] | Remove speciese.
@param \Librinfo\VarietiesBundle\Entity\Species $species
@return bool tRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"speciese",
"."
] | e9508ce13a4bb277d10bdcd925fdb84bc01f453f | https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Genus.php#L183-L186 |
202,799 | PenoaksDev/Milky-Framework | src/Milky/Http/Routing/RouteDependencyResolverTrait.php | RouteDependencyResolverTrait.resolveClassMethodDependencies | protected function resolveClassMethodDependencies( array $parameters, $instance, $method )
{
if ( !method_exists( $instance, $method ) )
return $parameters;
return $this->resolveMethodDependencies( $parameters, new ReflectionMethod( $instance, $method ) );
} | php | protected function resolveClassMethodDependencies( array $parameters, $instance, $method )
{
if ( !method_exists( $instance, $method ) )
return $parameters;
return $this->resolveMethodDependencies( $parameters, new ReflectionMethod( $instance, $method ) );
} | [
"protected",
"function",
"resolveClassMethodDependencies",
"(",
"array",
"$",
"parameters",
",",
"$",
"instance",
",",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"instance",
",",
"$",
"method",
")",
")",
"return",
"$",
"parameters",
... | Resolve the object method's type-hinted dependencies.
@param array $parameters
@param object $instance
@param string $method
@return array | [
"Resolve",
"the",
"object",
"method",
"s",
"type",
"-",
"hinted",
"dependencies",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/RouteDependencyResolverTrait.php#L34-L40 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.