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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
239,600 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.auth | public function auth(Request $request, $action)
{
$provider = strtolower($request->attributes->get('provider'));
if (! $this->providerExists($provider)) {
return $this->createNotFoundResponse();
}
$service = $this->getServiceByProvider($provider);
$redirectUri ... | php | public function auth(Request $request, $action)
{
$provider = strtolower($request->attributes->get('provider'));
if (! $this->providerExists($provider)) {
return $this->createNotFoundResponse();
}
$service = $this->getServiceByProvider($provider);
$redirectUri ... | [
"public",
"function",
"auth",
"(",
"Request",
"$",
"request",
",",
"$",
"action",
")",
"{",
"$",
"provider",
"=",
"strtolower",
"(",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'provider'",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",... | Authenticate via a separate OAuth provider
@param Request $request
@param int $action Constant representing either Login or Link account
@return Response | [
"Authenticate",
"via",
"a",
"separate",
"OAuth",
"provider"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L162-L178 |
239,601 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.callback | public function callback(Request $request)
{
// Check to see if this provider exists and has a callback implemented
$provider = strtolower($request->attributes->get('provider'));
if (! $this->providerExists($provider)) {
return $this->createNotFoundResponse();
}
... | php | public function callback(Request $request)
{
// Check to see if this provider exists and has a callback implemented
$provider = strtolower($request->attributes->get('provider'));
if (! $this->providerExists($provider)) {
return $this->createNotFoundResponse();
}
... | [
"public",
"function",
"callback",
"(",
"Request",
"$",
"request",
")",
"{",
"// Check to see if this provider exists and has a callback implemented",
"$",
"provider",
"=",
"strtolower",
"(",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'provider'",
")",
")",... | Callback for OAuth authentication requests
@param Request $request
@return Response | [
"Callback",
"for",
"OAuth",
"authentication",
"requests"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L186-L248 |
239,602 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.providerExists | protected function providerExists($provider)
{
return (
array_key_exists($provider, $this->serviceMap) ||
array_key_exists($provider, $this->config)
);
} | php | protected function providerExists($provider)
{
return (
array_key_exists($provider, $this->serviceMap) ||
array_key_exists($provider, $this->config)
);
} | [
"protected",
"function",
"providerExists",
"(",
"$",
"provider",
")",
"{",
"return",
"(",
"array_key_exists",
"(",
"$",
"provider",
",",
"$",
"this",
"->",
"serviceMap",
")",
"||",
"array_key_exists",
"(",
"$",
"provider",
",",
"$",
"this",
"->",
"config",
... | Determine whether the provider exists in the service map as well as the social login config
@param string $provider
@return bool | [
"Determine",
"whether",
"the",
"provider",
"exists",
"in",
"the",
"service",
"map",
"as",
"well",
"as",
"the",
"social",
"login",
"config"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L256-L262 |
239,603 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.github | protected function github(Oauth2Service\GitHub $github, TokenInterface $token)
{
$emails = json_decode($github->request('user/emails'), true);
$user = json_decode($github->request('user'), true);
$loginRequest = new LoginRequest(
'github',
$user['id'],
... | php | protected function github(Oauth2Service\GitHub $github, TokenInterface $token)
{
$emails = json_decode($github->request('user/emails'), true);
$user = json_decode($github->request('user'), true);
$loginRequest = new LoginRequest(
'github',
$user['id'],
... | [
"protected",
"function",
"github",
"(",
"Oauth2Service",
"\\",
"GitHub",
"$",
"github",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"emails",
"=",
"json_decode",
"(",
"$",
"github",
"->",
"request",
"(",
"'user/emails'",
")",
",",
"true",
")",
";",... | Request access token from GitHub and return a LoginRequest object for logging into our app
@param Oauth2Service\GitHub $github
@param TokenInterface $token
@return LoginRequest | [
"Request",
"access",
"token",
"from",
"GitHub",
"and",
"return",
"a",
"LoginRequest",
"object",
"for",
"logging",
"into",
"our",
"app"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L271-L286 |
239,604 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.google | protected function google(Oauth2Service\Google $google, TokenInterface $token)
{
$user = json_decode($google->request('https://www.googleapis.com/oauth2/v1/userinfo'), true);
$loginRequest = new LoginRequest(
'google',
$user['id'],
$token->getAccessToken(),
... | php | protected function google(Oauth2Service\Google $google, TokenInterface $token)
{
$user = json_decode($google->request('https://www.googleapis.com/oauth2/v1/userinfo'), true);
$loginRequest = new LoginRequest(
'google',
$user['id'],
$token->getAccessToken(),
... | [
"protected",
"function",
"google",
"(",
"Oauth2Service",
"\\",
"Google",
"$",
"google",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"user",
"=",
"json_decode",
"(",
"$",
"google",
"->",
"request",
"(",
"'https://www.googleapis.com/oauth2/v1/userinfo'",
")"... | Request access token from Google and return a LoginRequest object for logging into our app
@param Oauth2Service\Google $google
@param TokenInterface $token
@return LoginRequest | [
"Request",
"access",
"token",
"from",
"Google",
"and",
"return",
"a",
"LoginRequest",
"object",
"for",
"logging",
"into",
"our",
"app"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L295-L309 |
239,605 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.facebook | protected function facebook(Oauth2Service\Facebook $facebook, TokenInterface $token)
{
$user = json_decode($facebook->request('/me'), true);
$loginRequest = new LoginRequest(
'facebook',
$user['id'],
$token->getAccessToken(),
$token->getEndOfLife() > ... | php | protected function facebook(Oauth2Service\Facebook $facebook, TokenInterface $token)
{
$user = json_decode($facebook->request('/me'), true);
$loginRequest = new LoginRequest(
'facebook',
$user['id'],
$token->getAccessToken(),
$token->getEndOfLife() > ... | [
"protected",
"function",
"facebook",
"(",
"Oauth2Service",
"\\",
"Facebook",
"$",
"facebook",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"user",
"=",
"json_decode",
"(",
"$",
"facebook",
"->",
"request",
"(",
"'/me'",
")",
",",
"true",
")",
";",
... | Request access token from Facebook and return a LoginRequest object for logging into our app
@param Oauth2Service\Facebook $facebook
@param TokenInterface $token
@return LoginRequest | [
"Request",
"access",
"token",
"from",
"Facebook",
"and",
"return",
"a",
"LoginRequest",
"object",
"for",
"logging",
"into",
"our",
"app"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L318-L332 |
239,606 | synapsestudios/synapse-base | src/Synapse/SocialLogin/SocialLoginController.php | SocialLoginController.getServiceByProvider | public function getServiceByProvider($provider)
{
$redirect = $this->url($this->config[$provider]['callback_route'], array(
'provider' => $provider,
));
$serviceName = $this->serviceMap[$provider];
$storage = new SessionStorage(false);
$credentials = new Cons... | php | public function getServiceByProvider($provider)
{
$redirect = $this->url($this->config[$provider]['callback_route'], array(
'provider' => $provider,
));
$serviceName = $this->serviceMap[$provider];
$storage = new SessionStorage(false);
$credentials = new Cons... | [
"public",
"function",
"getServiceByProvider",
"(",
"$",
"provider",
")",
"{",
"$",
"redirect",
"=",
"$",
"this",
"->",
"url",
"(",
"$",
"this",
"->",
"config",
"[",
"$",
"provider",
"]",
"[",
"'callback_route'",
"]",
",",
"array",
"(",
"'provider'",
"=>"... | Get a provider service given a provider name
@param string $provider
@return OAuth\Common\Service\ServiceInterface | [
"Get",
"a",
"provider",
"service",
"given",
"a",
"provider",
"name"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/SocialLogin/SocialLoginController.php#L340-L362 |
239,607 | gibboncms/gibbon | src/Support/Yaml.php | Yaml.dumpToSimpleYaml | protected function dumpToSimpleYaml($array)
{
$parts = [];
foreach ($array as $key => $value) {
$parts[] = "$key: $value";
}
$yaml = implode("\n", $parts);
return $yaml;
} | php | protected function dumpToSimpleYaml($array)
{
$parts = [];
foreach ($array as $key => $value) {
$parts[] = "$key: $value";
}
$yaml = implode("\n", $parts);
return $yaml;
} | [
"protected",
"function",
"dumpToSimpleYaml",
"(",
"$",
"array",
")",
"{",
"$",
"parts",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"parts",
"[",
"]",
"=",
"\"$key: $value\"",
";",
"}",
"$"... | Transform an associative array to yaml.
Not using symfony's yaml dumper for full control over the format.
@param array $array
@return string | [
"Transform",
"an",
"associative",
"array",
"to",
"yaml",
".",
"Not",
"using",
"symfony",
"s",
"yaml",
"dumper",
"for",
"full",
"control",
"over",
"the",
"format",
"."
] | 2905e90b2902149b3358b385264e98b97cf4fc00 | https://github.com/gibboncms/gibbon/blob/2905e90b2902149b3358b385264e98b97cf4fc00/src/Support/Yaml.php#L21-L32 |
239,608 | gibboncms/gibbon | src/Support/Yaml.php | Yaml.parseYaml | public static function parseYaml($yaml)
{
if (self::$yamlParser == null) {
self::$yamlParser = new YamlParser;
}
return self::$yamlParser->parse($yaml);
} | php | public static function parseYaml($yaml)
{
if (self::$yamlParser == null) {
self::$yamlParser = new YamlParser;
}
return self::$yamlParser->parse($yaml);
} | [
"public",
"static",
"function",
"parseYaml",
"(",
"$",
"yaml",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"yamlParser",
"==",
"null",
")",
"{",
"self",
"::",
"$",
"yamlParser",
"=",
"new",
"YamlParser",
";",
"}",
"return",
"self",
"::",
"$",
"yamlParser",... | Parse yaml to an array
@param string $yaml
@return array | [
"Parse",
"yaml",
"to",
"an",
"array"
] | 2905e90b2902149b3358b385264e98b97cf4fc00 | https://github.com/gibboncms/gibbon/blob/2905e90b2902149b3358b385264e98b97cf4fc00/src/Support/Yaml.php#L40-L47 |
239,609 | loopsframework/base | src/Loops/Form/Element/File.php | File.deleteAction | public function deleteAction($parameter) {
try {
if(!$this->request->isPost()) {
return $this->jsonResult(400, 'Please access via POST method.', 'error_access_post');
}
if(!$this->getFile()) {
return $this->jsonResult(400, 'No file was uploade... | php | public function deleteAction($parameter) {
try {
if(!$this->request->isPost()) {
return $this->jsonResult(400, 'Please access via POST method.', 'error_access_post');
}
if(!$this->getFile()) {
return $this->jsonResult(400, 'No file was uploade... | [
"public",
"function",
"deleteAction",
"(",
"$",
"parameter",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"request",
"->",
"isPost",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"jsonResult",
"(",
"400",
",",
"'Please access via POST meth... | Deletes a previously uploaded file. Must be accessed with the POST method.
An json response will be generated and send back to the client.
{ 'success': TRUE|FALSE, [ 'error': errorstring ] } | [
"Deletes",
"a",
"previously",
"uploaded",
"file",
".",
"Must",
"be",
"accessed",
"with",
"the",
"POST",
"method",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Form/Element/File.php#L118-L147 |
239,610 | loopsframework/base | src/Loops/Form/Element/File.php | File.downloadAction | public function downloadAction($parameter) {
if(!$this->getFile()) {
return 404;
}
if(count($parameter) > 1) {
return 404;
}
if($parameter && $parameter[0] != $this->filename) {
return 404;
}
return Misc::servefile($this->fil... | php | public function downloadAction($parameter) {
if(!$this->getFile()) {
return 404;
}
if(count($parameter) > 1) {
return 404;
}
if($parameter && $parameter[0] != $this->filename) {
return 404;
}
return Misc::servefile($this->fil... | [
"public",
"function",
"downloadAction",
"(",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getFile",
"(",
")",
")",
"{",
"return",
"404",
";",
"}",
"if",
"(",
"count",
"(",
"$",
"parameter",
")",
">",
"1",
")",
"{",
"return",
"4... | Sends a previously uploaded file if it exists.
The first parameter can be set to the uploaded filename to force correct behaviour from the
browser regarding the filename. Otherwise the filename will be defined in the header and
becomes a little bit more unstable since cross-browser checks have to be made. | [
"Sends",
"a",
"previously",
"uploaded",
"file",
"if",
"it",
"exists",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Form/Element/File.php#L156-L170 |
239,611 | loopsframework/base | src/Loops/Form/Element/File.php | File.uploadAction | public function uploadAction($parameter) {
try {
if(!$files = $this->request->files()) {
return $this->jsonResult(400, 'Failed to upload file.', 'error_upload_failed');
}
foreach($files as $file) {
if($error = $file->getError()) {
... | php | public function uploadAction($parameter) {
try {
if(!$files = $this->request->files()) {
return $this->jsonResult(400, 'Failed to upload file.', 'error_upload_failed');
}
foreach($files as $file) {
if($error = $file->getError()) {
... | [
"public",
"function",
"uploadAction",
"(",
"$",
"parameter",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"$",
"files",
"=",
"$",
"this",
"->",
"request",
"->",
"files",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"jsonResult",
"(",
"400",
",",
"'Fai... | Stores a received file. The request must be encoded as formdata.
The first file in the formdata will be used, every other file is ignored.
An json response will be generated and send back to the client.
{ 'success': TRUE|FALSE, [ 'error': errorstring ] } | [
"Stores",
"a",
"received",
"file",
".",
"The",
"request",
"must",
"be",
"encoded",
"as",
"formdata",
"."
] | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Form/Element/File.php#L180-L225 |
239,612 | bookability/bookability-php | src/Bookability/Availability.php | Bookability_Availability.find | public function find($token, $_params = array())
{
return $this->transform($this->master->get('availability/' . $token, $_params));
} | php | public function find($token, $_params = array())
{
return $this->transform($this->master->get('availability/' . $token, $_params));
} | [
"public",
"function",
"find",
"(",
"$",
"token",
",",
"$",
"_params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"transform",
"(",
"$",
"this",
"->",
"master",
"->",
"get",
"(",
"'availability/'",
".",
"$",
"token",
",",
"$",
"_... | Retrieve a list of availability for an event date range
@return array | [
"Retrieve",
"a",
"list",
"of",
"availability",
"for",
"an",
"event",
"date",
"range"
] | be455327f2a965877d2b2a59edfe9ed71aed58aa | https://github.com/bookability/bookability-php/blob/be455327f2a965877d2b2a59edfe9ed71aed58aa/src/Bookability/Availability.php#L15-L18 |
239,613 | bookability/bookability-php | src/Bookability/Availability.php | Bookability_Availability.month | public function month($token, $_params = array())
{
return $this->transform($this->master->get('availability/' . $token . '/month', $_params), true);
} | php | public function month($token, $_params = array())
{
return $this->transform($this->master->get('availability/' . $token . '/month', $_params), true);
} | [
"public",
"function",
"month",
"(",
"$",
"token",
",",
"$",
"_params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"transform",
"(",
"$",
"this",
"->",
"master",
"->",
"get",
"(",
"'availability/'",
".",
"$",
"token",
".",
"'/month... | Retrieve a list of availability for an event month
@return array | [
"Retrieve",
"a",
"list",
"of",
"availability",
"for",
"an",
"event",
"month"
] | be455327f2a965877d2b2a59edfe9ed71aed58aa | https://github.com/bookability/bookability-php/blob/be455327f2a965877d2b2a59edfe9ed71aed58aa/src/Bookability/Availability.php#L25-L28 |
239,614 | bookability/bookability-php | src/Bookability/Availability.php | Bookability_Availability.date | public function date($token, $_params = array())
{
return $this->transform($this->master->get('availability/' . $token . '/date', $_params), true);
} | php | public function date($token, $_params = array())
{
return $this->transform($this->master->get('availability/' . $token . '/date', $_params), true);
} | [
"public",
"function",
"date",
"(",
"$",
"token",
",",
"$",
"_params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"transform",
"(",
"$",
"this",
"->",
"master",
"->",
"get",
"(",
"'availability/'",
".",
"$",
"token",
".",
"'/date'"... | Retrieve a list of availability for a single event date
@return array | [
"Retrieve",
"a",
"list",
"of",
"availability",
"for",
"a",
"single",
"event",
"date"
] | be455327f2a965877d2b2a59edfe9ed71aed58aa | https://github.com/bookability/bookability-php/blob/be455327f2a965877d2b2a59edfe9ed71aed58aa/src/Bookability/Availability.php#L35-L38 |
239,615 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.fullQueryString | protected function fullQueryString()
{
$queryParts = [];
// Main search can be default search or full text search.
if ($this->queryString) {
if (!$this->querySwitchFulltext) {
$queryParts[] = $this->queryString;
} else {
$queryParts[] ... | php | protected function fullQueryString()
{
$queryParts = [];
// Main search can be default search or full text search.
if ($this->queryString) {
if (!$this->querySwitchFulltext) {
$queryParts[] = $this->queryString;
} else {
$queryParts[] ... | [
"protected",
"function",
"fullQueryString",
"(",
")",
"{",
"$",
"queryParts",
"=",
"[",
"]",
";",
"// Main search can be default search or full text search.",
"if",
"(",
"$",
"this",
"->",
"queryString",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"querySwitchF... | Returns the full query string to send to pazpar2.
@return string | [
"Returns",
"the",
"full",
"query",
"string",
"to",
"send",
"to",
"pazpar2",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L304-L340 |
239,616 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.getPazpar2BaseURL | public function getPazpar2BaseURL()
{
$URL = 'http://' . GeneralUtility::getIndpEnv('HTTP_HOST') . $this->getPazpar2Path();
if ($this->pazpar2BaseURL) {
$URL = $this->pazpar2BaseURL;
}
return $URL;
} | php | public function getPazpar2BaseURL()
{
$URL = 'http://' . GeneralUtility::getIndpEnv('HTTP_HOST') . $this->getPazpar2Path();
if ($this->pazpar2BaseURL) {
$URL = $this->pazpar2BaseURL;
}
return $URL;
} | [
"public",
"function",
"getPazpar2BaseURL",
"(",
")",
"{",
"$",
"URL",
"=",
"'http://'",
".",
"GeneralUtility",
"::",
"getIndpEnv",
"(",
"'HTTP_HOST'",
")",
".",
"$",
"this",
"->",
"getPazpar2Path",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"pazpar2BaseU... | Return URL of pazpar2 service.
If it is not set, return default URL on localhost.
@return string | [
"Return",
"URL",
"of",
"pazpar2",
"service",
".",
"If",
"it",
"is",
"not",
"set",
"return",
"default",
"URL",
"on",
"localhost",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L426-L433 |
239,617 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.queryIsDone | protected function queryIsDone()
{
$result = false;
$statReplyString = $this->fetchURL($this->pazpar2StatURL());
$statReply = GeneralUtility::xml2array($statReplyString);
if ($statReply) {
// The progress variable is a string representing a number between
//... | php | protected function queryIsDone()
{
$result = false;
$statReplyString = $this->fetchURL($this->pazpar2StatURL());
$statReply = GeneralUtility::xml2array($statReplyString);
if ($statReply) {
// The progress variable is a string representing a number between
//... | [
"protected",
"function",
"queryIsDone",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"statReplyString",
"=",
"$",
"this",
"->",
"fetchURL",
"(",
"$",
"this",
"->",
"pazpar2StatURL",
"(",
")",
")",
";",
"$",
"statReply",
"=",
"GeneralUtility",
":... | Checks whether the query is done.
Requires a session to be established.
@param int $count return by reference the current number of results
@return bool True when query has finished, False otherwise | [
"Checks",
"whether",
"the",
"query",
"is",
"done",
".",
"Requires",
"a",
"session",
"to",
"be",
"established",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L470-L493 |
239,618 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.fetchResults | protected function fetchResults()
{
$maxResults = 1000; // limit results
if (count($this->conf['exportFormats']) > 0) {
// limit results even more if we are creating export data
$maxResults = $maxResults / (count($this->conf['exportFormats']) + 1);
}
$recordsT... | php | protected function fetchResults()
{
$maxResults = 1000; // limit results
if (count($this->conf['exportFormats']) > 0) {
// limit results even more if we are creating export data
$maxResults = $maxResults / (count($this->conf['exportFormats']) + 1);
}
$recordsT... | [
"protected",
"function",
"fetchResults",
"(",
")",
"{",
"$",
"maxResults",
"=",
"1000",
";",
"// limit results",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"conf",
"[",
"'exportFormats'",
"]",
")",
">",
"0",
")",
"{",
"// limit results even more if we are cre... | Fetches results from pazpar2.
Requires an established session.
Stores the results in $results and the total result count in $totalResultCount. | [
"Fetches",
"results",
"from",
"pazpar2",
".",
"Requires",
"an",
"established",
"session",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L511-L569 |
239,619 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.pazpar2ShowURL | protected function pazpar2ShowURL($start = 0, $num = 500)
{
$URL = $this->getPazpar2BaseURL() . '?command=show';
$URL .= '&query=' . urlencode($this->fullQueryString());
$URL .= '&start=' . $start . '&num=' . $num;
$URL .= '&sort=' . urlencode($this->sortOrderString());
$URL ... | php | protected function pazpar2ShowURL($start = 0, $num = 500)
{
$URL = $this->getPazpar2BaseURL() . '?command=show';
$URL .= '&query=' . urlencode($this->fullQueryString());
$URL .= '&start=' . $start . '&num=' . $num;
$URL .= '&sort=' . urlencode($this->sortOrderString());
$URL ... | [
"protected",
"function",
"pazpar2ShowURL",
"(",
"$",
"start",
"=",
"0",
",",
"$",
"num",
"=",
"500",
")",
"{",
"$",
"URL",
"=",
"$",
"this",
"->",
"getPazpar2BaseURL",
"(",
")",
".",
"'?command=show'",
";",
"$",
"URL",
".=",
"'&query='",
".",
"urlencod... | Returns URL for downloading pazpar2 results.
The parameters can be used to give the the start record
as well as the number of records required.
TYPO3 typically starts running into out of memory errors when fetching
around 1000 records in one go with a 128MB memory limit for PHP.
@param int $start index of first recor... | [
"Returns",
"URL",
"for",
"downloading",
"pazpar2",
"results",
".",
"The",
"parameters",
"can",
"be",
"used",
"to",
"give",
"the",
"the",
"start",
"record",
"as",
"well",
"as",
"the",
"number",
"of",
"records",
"required",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L583-L591 |
239,620 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.sortOrderString | protected function sortOrderString()
{
$sortOrderComponents = [];
foreach ($this->getSortOrder() as $sortCriterion) {
$sortOrderComponents[] = $sortCriterion['fieldName'] . ':'
. (($sortCriterion['direction'] === 'descending') ? '0' : '1');
}
$sortOrde... | php | protected function sortOrderString()
{
$sortOrderComponents = [];
foreach ($this->getSortOrder() as $sortCriterion) {
$sortOrderComponents[] = $sortCriterion['fieldName'] . ':'
. (($sortCriterion['direction'] === 'descending') ? '0' : '1');
}
$sortOrde... | [
"protected",
"function",
"sortOrderString",
"(",
")",
"{",
"$",
"sortOrderComponents",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getSortOrder",
"(",
")",
"as",
"$",
"sortCriterion",
")",
"{",
"$",
"sortOrderComponents",
"[",
"]",
"=",
"$",
... | Returns a string encoding the sort order formatted for use by pazpar2.
@return string | [
"Returns",
"a",
"string",
"encoding",
"the",
"sort",
"order",
"formatted",
"for",
"use",
"by",
"pazpar2",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L598-L608 |
239,621 | subugoe/typo3-pazpar2 | Classes/Domain/Model/Query.php | Query.yearSort | protected function yearSort($a, $b)
{
$aDates = $this->extractNewestDates($a);
$bDates = $this->extractNewestDates($b);
if (count($aDates) > 0 && count($bDates) > 0) {
return $bDates[0] - $aDates[0];
} elseif (count($aDates) > 0 && count($bDates) === 0) {
ret... | php | protected function yearSort($a, $b)
{
$aDates = $this->extractNewestDates($a);
$bDates = $this->extractNewestDates($b);
if (count($aDates) > 0 && count($bDates) > 0) {
return $bDates[0] - $aDates[0];
} elseif (count($aDates) > 0 && count($bDates) === 0) {
ret... | [
"protected",
"function",
"yearSort",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"$",
"aDates",
"=",
"$",
"this",
"->",
"extractNewestDates",
"(",
"$",
"a",
")",
";",
"$",
"bDates",
"=",
"$",
"this",
"->",
"extractNewestDates",
"(",
"$",
"b",
")",
";",... | Auxiliary sort function for sorting records and locations based
on their 'date' field with the newest item being first and undefined
dates last.
@param array $a location or full pazpar2 record
@param array $b location or full pazpar2 record
@return int | [
"Auxiliary",
"sort",
"function",
"for",
"sorting",
"records",
"and",
"locations",
"based",
"on",
"their",
"date",
"field",
"with",
"the",
"newest",
"item",
"being",
"first",
"and",
"undefined",
"dates",
"last",
"."
] | 3da8c483e24228d92dbb9fff034f0ff50ac937ef | https://github.com/subugoe/typo3-pazpar2/blob/3da8c483e24228d92dbb9fff034f0ff50ac937ef/Classes/Domain/Model/Query.php#L669-L683 |
239,622 | IVAgafonov/DataProvider | src/System/DataProvider.php | DataProvider.getObjects | public function getObjects($query, $object)
{
$this->statement = $this->db->query($query);
if ($this->statement) {
$this->statement->setFetchMode(\PDO::FETCH_CLASS, $object);
$objects = $this->statement->fetchAll();
if ($objects) {
return $objects... | php | public function getObjects($query, $object)
{
$this->statement = $this->db->query($query);
if ($this->statement) {
$this->statement->setFetchMode(\PDO::FETCH_CLASS, $object);
$objects = $this->statement->fetchAll();
if ($objects) {
return $objects... | [
"public",
"function",
"getObjects",
"(",
"$",
"query",
",",
"$",
"object",
")",
"{",
"$",
"this",
"->",
"statement",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"$",
"query",
")",
";",
"if",
"(",
"$",
"this",
"->",
"statement",
")",
"{",
"$... | Get objects by sql query
@param string $query Sql query
@param string $object Object name
@return array|bool | [
"Get",
"objects",
"by",
"sql",
"query"
] | 9d61b7adfb8ff794f37298daabf0e511d22bf049 | https://github.com/IVAgafonov/DataProvider/blob/9d61b7adfb8ff794f37298daabf0e511d22bf049/src/System/DataProvider.php#L54-L65 |
239,623 | IVAgafonov/DataProvider | src/System/DataProvider.php | DataProvider.getObject | public function getObject($query, $object)
{
$this->statement = $this->db->query($query);
if ($this->statement) {
$this->statement->setFetchMode(\PDO::FETCH_CLASS, $object);
return $this->statement->fetch();
}
return false;
} | php | public function getObject($query, $object)
{
$this->statement = $this->db->query($query);
if ($this->statement) {
$this->statement->setFetchMode(\PDO::FETCH_CLASS, $object);
return $this->statement->fetch();
}
return false;
} | [
"public",
"function",
"getObject",
"(",
"$",
"query",
",",
"$",
"object",
")",
"{",
"$",
"this",
"->",
"statement",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"$",
"query",
")",
";",
"if",
"(",
"$",
"this",
"->",
"statement",
")",
"{",
"$"... | Get object by sql query
@param string $query Sql query
@param string $object Object name
@return array|bool | [
"Get",
"object",
"by",
"sql",
"query"
] | 9d61b7adfb8ff794f37298daabf0e511d22bf049 | https://github.com/IVAgafonov/DataProvider/blob/9d61b7adfb8ff794f37298daabf0e511d22bf049/src/System/DataProvider.php#L75-L83 |
239,624 | IVAgafonov/DataProvider | src/System/DataProvider.php | DataProvider.getArrays | public function getArrays($query)
{
$this->statement = $this->db->query($query);
if ($this->statement) {
$result = $this->statement->fetchAll(\PDO::FETCH_ASSOC);
if ($result) {
return $result;
}
}
return false;
} | php | public function getArrays($query)
{
$this->statement = $this->db->query($query);
if ($this->statement) {
$result = $this->statement->fetchAll(\PDO::FETCH_ASSOC);
if ($result) {
return $result;
}
}
return false;
} | [
"public",
"function",
"getArrays",
"(",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"statement",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"$",
"query",
")",
";",
"if",
"(",
"$",
"this",
"->",
"statement",
")",
"{",
"$",
"result",
"=",
"$"... | Get arrays by sql query
@param string $query Sql query
@return array|bool | [
"Get",
"arrays",
"by",
"sql",
"query"
] | 9d61b7adfb8ff794f37298daabf0e511d22bf049 | https://github.com/IVAgafonov/DataProvider/blob/9d61b7adfb8ff794f37298daabf0e511d22bf049/src/System/DataProvider.php#L92-L102 |
239,625 | oschildt/SmartFactory | src/SmartFactory/DatabaseWorkers/ShardManager.php | ShardManager.registerShard | public function registerShard($shard_name, $parameters)
{
if (empty($shard_name)) {
throw new \Exception("The shard name is not specified!");
}
if (!empty($this->shard_table[$shard_name])) {
throw new \Exception("The shard '$shard_name' has been already regis... | php | public function registerShard($shard_name, $parameters)
{
if (empty($shard_name)) {
throw new \Exception("The shard name is not specified!");
}
if (!empty($this->shard_table[$shard_name])) {
throw new \Exception("The shard '$shard_name' has been already regis... | [
"public",
"function",
"registerShard",
"(",
"$",
"shard_name",
",",
"$",
"parameters",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"shard_name",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"The shard name is not specified!\"",
")",
";",
"}",
"if",
... | Registers a new shard.
@param string $shard_name
Unique shard name.
@param array $parameters
The connection parameters to the shard as an associative array in the form key => value:
- $parameters["db_type"] - type of the database (MySQL or MSSQL)
- $parameters["db_server"] - server address
- $parameters["db_name"]... | [
"Registers",
"a",
"new",
"shard",
"."
] | efd289961a720d5f3103a3c696e2beee16e9644d | https://github.com/oschildt/SmartFactory/blob/efd289961a720d5f3103a3c696e2beee16e9644d/src/SmartFactory/DatabaseWorkers/ShardManager.php#L71-L84 |
239,626 | oschildt/SmartFactory | src/SmartFactory/DatabaseWorkers/ShardManager.php | ShardManager.dbshard | public function dbshard($shard_name)
{
if (empty($shard_name) || empty($this->shard_table[$shard_name])) {
throw new \Exception("The shard '$shard_name' was not found!");
return null;
}
if (empty($this->shard_table[$shard_name]["dbworker"])) {
$th... | php | public function dbshard($shard_name)
{
if (empty($shard_name) || empty($this->shard_table[$shard_name])) {
throw new \Exception("The shard '$shard_name' was not found!");
return null;
}
if (empty($this->shard_table[$shard_name]["dbworker"])) {
$th... | [
"public",
"function",
"dbshard",
"(",
"$",
"shard_name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"shard_name",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"shard_table",
"[",
"$",
"shard_name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"... | The method dbshard provides the DBWorker object for working with the shard.
If the parameters are omitted, the system takes the parameters from the configuration
settings and reuses the single instance of the DBWorker for all requests.
If the user passes the parameters explicitly, a new instance of the DBWorker is cre... | [
"The",
"method",
"dbshard",
"provides",
"the",
"DBWorker",
"object",
"for",
"working",
"with",
"the",
"shard",
"."
] | efd289961a720d5f3103a3c696e2beee16e9644d | https://github.com/oschildt/SmartFactory/blob/efd289961a720d5f3103a3c696e2beee16e9644d/src/SmartFactory/DatabaseWorkers/ShardManager.php#L115-L127 |
239,627 | phlexible/phlexible | src/Phlexible/Component/Volume/VolumeManager.php | VolumeManager.findByFileId | public function findByFileId($fileId)
{
foreach ($this->volumes as $volume) {
try {
$file = $volume->findFile($fileId);
if ($file) {
return $volume;
}
} catch (\Exception $e) {
}
}
return... | php | public function findByFileId($fileId)
{
foreach ($this->volumes as $volume) {
try {
$file = $volume->findFile($fileId);
if ($file) {
return $volume;
}
} catch (\Exception $e) {
}
}
return... | [
"public",
"function",
"findByFileId",
"(",
"$",
"fileId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"volumes",
"as",
"$",
"volume",
")",
"{",
"try",
"{",
"$",
"file",
"=",
"$",
"volume",
"->",
"findFile",
"(",
"$",
"fileId",
")",
";",
"if",
"(",... | Return volume by file ID.
@param string $fileId
@return Volume | [
"Return",
"volume",
"by",
"file",
"ID",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Component/Volume/VolumeManager.php#L90-L103 |
239,628 | phlexible/phlexible | src/Phlexible/Component/Volume/VolumeManager.php | VolumeManager.findByFolderId | public function findByFolderId($folderId)
{
foreach ($this->volumes as $volume) {
if ($volume->findFolder($folderId)) {
return $volume;
}
}
return null;
} | php | public function findByFolderId($folderId)
{
foreach ($this->volumes as $volume) {
if ($volume->findFolder($folderId)) {
return $volume;
}
}
return null;
} | [
"public",
"function",
"findByFolderId",
"(",
"$",
"folderId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"volumes",
"as",
"$",
"volume",
")",
"{",
"if",
"(",
"$",
"volume",
"->",
"findFolder",
"(",
"$",
"folderId",
")",
")",
"{",
"return",
"$",
"vo... | Return volume by folder ID.
@param string $folderId
@return Volume | [
"Return",
"volume",
"by",
"folder",
"ID",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Component/Volume/VolumeManager.php#L130-L139 |
239,629 | nubs/sensible | src/Strategy/EnvironmentVariableStrategy.php | EnvironmentVariableStrategy.get | public function get()
{
$result = $this->_environment ? $this->_environment->getenv($this->_name) : getenv($this->_name);
return $result !== false ? $result : null;
} | php | public function get()
{
$result = $this->_environment ? $this->_environment->getenv($this->_name) : getenv($this->_name);
return $result !== false ? $result : null;
} | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"_environment",
"?",
"$",
"this",
"->",
"_environment",
"->",
"getenv",
"(",
"$",
"this",
"->",
"_name",
")",
":",
"getenv",
"(",
"$",
"this",
"->",
"_name",
")",
";... | Returns the command as found in the environment variable.
@return string|null The command, or null if the environment variable
wasn't set. | [
"Returns",
"the",
"command",
"as",
"found",
"in",
"the",
"environment",
"variable",
"."
] | d0ba8d66a93d42ac0a9fb813093e8c0c3559bac7 | https://github.com/nubs/sensible/blob/d0ba8d66a93d42ac0a9fb813093e8c0c3559bac7/src/Strategy/EnvironmentVariableStrategy.php#L38-L43 |
239,630 | ciims/cii | components/CiiPHPMessageSource.php | CiiPHPMessageSource.getMessageFile | protected function getMessageFile($category,$language)
{
if(!isset($this->_files[$category][$language]))
{
if(($pos=strpos($category,'.'))!==false && strpos($category,'ciims') === false)
{
$extensionClass=substr($category,0,$pos);
$extensionCategory=substr($categor... | php | protected function getMessageFile($category,$language)
{
if(!isset($this->_files[$category][$language]))
{
if(($pos=strpos($category,'.'))!==false && strpos($category,'ciims') === false)
{
$extensionClass=substr($category,0,$pos);
$extensionCategory=substr($categor... | [
"protected",
"function",
"getMessageFile",
"(",
"$",
"category",
",",
"$",
"language",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_files",
"[",
"$",
"category",
"]",
"[",
"$",
"language",
"]",
")",
")",
"{",
"if",
"(",
"(",
"$",
... | Direct overload of getMessageFile
This method is overloaded to allow modules, themes, and CiiMS Core to have their own unique message sources
instead of having everything grouped together in protected/messages
Modules and Themes now should have their own /messages folder to store translations
@param string $category... | [
"Direct",
"overload",
"of",
"getMessageFile"
] | cc8550b9a3a6a0bf0214554679de8743d50dc9ef | https://github.com/ciims/cii/blob/cc8550b9a3a6a0bf0214554679de8743d50dc9ef/components/CiiPHPMessageSource.php#L45-L91 |
239,631 | ncuesta/pinocchio | src/Pinocchio/Parser/Php.php | Php.parse | public function parse(\Pinocchio\Pinocchio $pinocchio, \Pinocchio\Highlighter\HighlighterInterface $highlighter = null) {
if (null === $highlighter) {
$highlighter = new Pygments();
}
$code = '';
// $docBlocks is initialized with an empty element for the '<?php' start o... | php | public function parse(\Pinocchio\Pinocchio $pinocchio, \Pinocchio\Highlighter\HighlighterInterface $highlighter = null) {
if (null === $highlighter) {
$highlighter = new Pygments();
}
$code = '';
// $docBlocks is initialized with an empty element for the '<?php' start o... | [
"public",
"function",
"parse",
"(",
"\\",
"Pinocchio",
"\\",
"Pinocchio",
"$",
"pinocchio",
",",
"\\",
"Pinocchio",
"\\",
"Highlighter",
"\\",
"HighlighterInterface",
"$",
"highlighter",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"highlighter",
")... | Parse a Pinocchio instance.
@param \Pinocchio\Pinocchio $pinocchio The Pinocchio instance to parse.
@param \Pinocchio\Highlighter\HighlighterInterface $highlighter The highlighter to use (optional)
@return \Pinocchio\Pinocchio | [
"Parse",
"a",
"Pinocchio",
"instance",
"."
] | 01b119a003362fd3a50e843341c62c95374d87cf | https://github.com/ncuesta/pinocchio/blob/01b119a003362fd3a50e843341c62c95374d87cf/src/Pinocchio/Parser/Php.php#L54-L106 |
239,632 | ncuesta/pinocchio | src/Pinocchio/Parser/Php.php | Php.getCommentRegexSet | public function getCommentRegexSet()
{
return array(
self::REGEX_COMMENT_SINGLE_LINE,
self::REGEX_COMMENT_MULTILINE_START,
self::REGEX_COMMENT_MULTILINE_CONT,
self::REGEX_COMMENT_MULTILINE_END,
self::REGEX_COMMENT_MULTILINE_ONE_LINER,
);
... | php | public function getCommentRegexSet()
{
return array(
self::REGEX_COMMENT_SINGLE_LINE,
self::REGEX_COMMENT_MULTILINE_START,
self::REGEX_COMMENT_MULTILINE_CONT,
self::REGEX_COMMENT_MULTILINE_END,
self::REGEX_COMMENT_MULTILINE_ONE_LINER,
);
... | [
"public",
"function",
"getCommentRegexSet",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"REGEX_COMMENT_SINGLE_LINE",
",",
"self",
"::",
"REGEX_COMMENT_MULTILINE_START",
",",
"self",
"::",
"REGEX_COMMENT_MULTILINE_CONT",
",",
"self",
"::",
"REGEX_COMMENT_MULTILI... | Get the set of regular expressions that represent the different
comment blocks that might be found in the PHP code.
@return array | [
"Get",
"the",
"set",
"of",
"regular",
"expressions",
"that",
"represent",
"the",
"different",
"comment",
"blocks",
"that",
"might",
"be",
"found",
"in",
"the",
"PHP",
"code",
"."
] | 01b119a003362fd3a50e843341c62c95374d87cf | https://github.com/ncuesta/pinocchio/blob/01b119a003362fd3a50e843341c62c95374d87cf/src/Pinocchio/Parser/Php.php#L114-L123 |
239,633 | ncuesta/pinocchio | src/Pinocchio/Parser/Php.php | Php.parseDocblocks | protected function parseDocblocks($rawDocBlocks)
{
$parsedDocBlocks = array();
$docBlockParser = new MarkdownParser();
foreach ($rawDocBlocks as $docBlock) {
$docBlock = preg_replace(self::REGEX_DOCBLOCK_TYPE, '$1$2 `$4` ', $docBlock);
$docBlock = preg_replace(self::... | php | protected function parseDocblocks($rawDocBlocks)
{
$parsedDocBlocks = array();
$docBlockParser = new MarkdownParser();
foreach ($rawDocBlocks as $docBlock) {
$docBlock = preg_replace(self::REGEX_DOCBLOCK_TYPE, '$1$2 `$4` ', $docBlock);
$docBlock = preg_replace(self::... | [
"protected",
"function",
"parseDocblocks",
"(",
"$",
"rawDocBlocks",
")",
"{",
"$",
"parsedDocBlocks",
"=",
"array",
"(",
")",
";",
"$",
"docBlockParser",
"=",
"new",
"MarkdownParser",
"(",
")",
";",
"foreach",
"(",
"$",
"rawDocBlocks",
"as",
"$",
"docBlock"... | Parse the given documentation blocks with a Markdown parser and return
the resulting formatted blocks as HTML snippets.
@param array $rawDocBlocks The raw documentation blocks to parse.
@return array | [
"Parse",
"the",
"given",
"documentation",
"blocks",
"with",
"a",
"Markdown",
"parser",
"and",
"return",
"the",
"resulting",
"formatted",
"blocks",
"as",
"HTML",
"snippets",
"."
] | 01b119a003362fd3a50e843341c62c95374d87cf | https://github.com/ncuesta/pinocchio/blob/01b119a003362fd3a50e843341c62c95374d87cf/src/Pinocchio/Parser/Php.php#L133-L147 |
239,634 | wearenolte/wp-widgets | src/Collection/LeanRecent.php | LeanRecent.update | public function update( $new_instance, $old_instance ) {
$post_types = get_post_types();
$selected = isset( $_REQUEST[ $this->get_field_id( 'post_type' ) ] )
? sanitize_text_field( wp_unslash( $_REQUEST[ $this->get_field_id( 'post_type' ) ] ) )
: false;
if ( in_array( $selected, $post_types, true ) ) {
... | php | public function update( $new_instance, $old_instance ) {
$post_types = get_post_types();
$selected = isset( $_REQUEST[ $this->get_field_id( 'post_type' ) ] )
? sanitize_text_field( wp_unslash( $_REQUEST[ $this->get_field_id( 'post_type' ) ] ) )
: false;
if ( in_array( $selected, $post_types, true ) ) {
... | [
"public",
"function",
"update",
"(",
"$",
"new_instance",
",",
"$",
"old_instance",
")",
"{",
"$",
"post_types",
"=",
"get_post_types",
"(",
")",
";",
"$",
"selected",
"=",
"isset",
"(",
"$",
"_REQUEST",
"[",
"$",
"this",
"->",
"get_field_id",
"(",
"'pos... | Save the post type
@param array $new_instance
@param array $old_instance
@return array | [
"Save",
"the",
"post",
"type"
] | 7b008dc3182f8b9da44657bd2fe714e7e48cf002 | https://github.com/wearenolte/wp-widgets/blob/7b008dc3182f8b9da44657bd2fe714e7e48cf002/src/Collection/LeanRecent.php#L80-L99 |
239,635 | Puzzlout/FrameworkMvcLegacy | src/Helpers/UserHelper.php | UserHelper.GetAndStoreUsersInSession | public static function GetAndStoreUsersInSession($caller) {
$users = array();
if (!$caller->app()->user()->getAttribute(\Puzzlout\Framework\Enums\SessionKeys::AllUsers)) {
$manager = $caller->managers()->getDalInstance($caller->module());
$users = $manager->selectAllUsers();
... | php | public static function GetAndStoreUsersInSession($caller) {
$users = array();
if (!$caller->app()->user()->getAttribute(\Puzzlout\Framework\Enums\SessionKeys::AllUsers)) {
$manager = $caller->managers()->getDalInstance($caller->module());
$users = $manager->selectAllUsers();
... | [
"public",
"static",
"function",
"GetAndStoreUsersInSession",
"(",
"$",
"caller",
")",
"{",
"$",
"users",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"$",
"caller",
"->",
"app",
"(",
")",
"->",
"user",
"(",
")",
"->",
"getAttribute",
"(",
"\\",
"Puzz... | Checks if the users are not stored in Session.
Stores the users
Set the data into the session for later use.
@param /Library/Request $rq
@return array $lists : the lists of objects if any | [
"Checks",
"if",
"the",
"users",
"are",
"not",
"stored",
"in",
"Session",
".",
"Stores",
"the",
"users",
"Set",
"the",
"data",
"into",
"the",
"session",
"for",
"later",
"use",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Helpers/UserHelper.php#L70-L83 |
239,636 | Puzzlout/FrameworkMvcLegacy | src/Helpers/UserHelper.php | UserHelper.AddNewUserToSession | public static function AddNewUserToSession($caller, $user) {
$users = self::GetAndStoreUsersInSession($caller);
$users[] = $user;
$caller->app()->user->setAttribute(
\Puzzlout\Framework\Enums\SessionKeys::AllUsers, $users
);
} | php | public static function AddNewUserToSession($caller, $user) {
$users = self::GetAndStoreUsersInSession($caller);
$users[] = $user;
$caller->app()->user->setAttribute(
\Puzzlout\Framework\Enums\SessionKeys::AllUsers, $users
);
} | [
"public",
"static",
"function",
"AddNewUserToSession",
"(",
"$",
"caller",
",",
"$",
"user",
")",
"{",
"$",
"users",
"=",
"self",
"::",
"GetAndStoreUsersInSession",
"(",
"$",
"caller",
")",
";",
"$",
"users",
"[",
"]",
"=",
"$",
"user",
";",
"$",
"call... | Add new user in session | [
"Add",
"new",
"user",
"in",
"session"
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Helpers/UserHelper.php#L88-L94 |
239,637 | Puzzlout/FrameworkMvcLegacy | src/Helpers/UserHelper.php | UserHelper.CategorizeUsersList | public static function CategorizeUsersList($users) {
$list = array();
if (is_array($users) && count($users) > 0) {
foreach ($users as $user) {
$userType = $user->user_type();
$list[$userType][] = $user;
}
}
return $list;
} | php | public static function CategorizeUsersList($users) {
$list = array();
if (is_array($users) && count($users) > 0) {
foreach ($users as $user) {
$userType = $user->user_type();
$list[$userType][] = $user;
}
}
return $list;
} | [
"public",
"static",
"function",
"CategorizeUsersList",
"(",
"$",
"users",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"users",
")",
"&&",
"count",
"(",
"$",
"users",
")",
">",
"0",
")",
"{",
"foreach",
"(",
... | Categorize user list by type | [
"Categorize",
"user",
"list",
"by",
"type"
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Helpers/UserHelper.php#L99-L108 |
239,638 | mszewcz/php-light-framework | src/Visitor/Ip.php | Ip.getProxyString | private static function getProxyString(): ?string
{
$proxyString = null;
if (\getenv('HTTP_CLIENT_IP')) {
$proxyString = \getenv('HTTP_CLIENT_IP');
} elseif (\getenv('HTTP_X_FORWARDED_FOR')) {
$proxyString = \getenv('HTTP_X_FORWARDED_FOR');
} elseif (\getenv('... | php | private static function getProxyString(): ?string
{
$proxyString = null;
if (\getenv('HTTP_CLIENT_IP')) {
$proxyString = \getenv('HTTP_CLIENT_IP');
} elseif (\getenv('HTTP_X_FORWARDED_FOR')) {
$proxyString = \getenv('HTTP_X_FORWARDED_FOR');
} elseif (\getenv('... | [
"private",
"static",
"function",
"getProxyString",
"(",
")",
":",
"?",
"string",
"{",
"$",
"proxyString",
"=",
"null",
";",
"if",
"(",
"\\",
"getenv",
"(",
"'HTTP_CLIENT_IP'",
")",
")",
"{",
"$",
"proxyString",
"=",
"\\",
"getenv",
"(",
"'HTTP_CLIENT_IP'",... | Check and returns proxy string
@return null|string | [
"Check",
"and",
"returns",
"proxy",
"string"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Visitor/Ip.php#L39-L58 |
239,639 | mszewcz/php-light-framework | src/Visitor/Ip.php | Ip.getFirstIP | private static function getFirstIP($proxyString = ''): ?string
{
\preg_match('/^(([0-9]{1,3}\.){3}[0-9]{1,3})/', $proxyString, $matches);
return (\is_array($matches) && isset($matches[1])) ? $matches[1] : null;
} | php | private static function getFirstIP($proxyString = ''): ?string
{
\preg_match('/^(([0-9]{1,3}\.){3}[0-9]{1,3})/', $proxyString, $matches);
return (\is_array($matches) && isset($matches[1])) ? $matches[1] : null;
} | [
"private",
"static",
"function",
"getFirstIP",
"(",
"$",
"proxyString",
"=",
"''",
")",
":",
"?",
"string",
"{",
"\\",
"preg_match",
"(",
"'/^(([0-9]{1,3}\\.){3}[0-9]{1,3})/'",
",",
"$",
"proxyString",
",",
"$",
"matches",
")",
";",
"return",
"(",
"\\",
"is_... | Checks for first IP in proxy string and returns it
@param string $proxyString
@return null|string | [
"Checks",
"for",
"first",
"IP",
"in",
"proxy",
"string",
"and",
"returns",
"it"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Visitor/Ip.php#L77-L81 |
239,640 | mszewcz/php-light-framework | src/Visitor/Ip.php | Ip.getFullIpHost | private static function getFullIpHost($clientIpHost = null, $proxyIpHost = null): ?string
{
$fullIpHost = [];
if ($clientIpHost !== null) {
$fullIpHost[] = \sprintf('client: %s', $clientIpHost);
}
if ($proxyIpHost !== null) {
$fullIpHost[] = \sprintf('proxy: %... | php | private static function getFullIpHost($clientIpHost = null, $proxyIpHost = null): ?string
{
$fullIpHost = [];
if ($clientIpHost !== null) {
$fullIpHost[] = \sprintf('client: %s', $clientIpHost);
}
if ($proxyIpHost !== null) {
$fullIpHost[] = \sprintf('proxy: %... | [
"private",
"static",
"function",
"getFullIpHost",
"(",
"$",
"clientIpHost",
"=",
"null",
",",
"$",
"proxyIpHost",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"fullIpHost",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"clientIpHost",
"!==",
"null",
")",
"{",... | Returns full ip host string
@param null $clientIpHost
@param null $proxyIpHost
@return null|string | [
"Returns",
"full",
"ip",
"host",
"string"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Visitor/Ip.php#L90-L101 |
239,641 | mszewcz/php-light-framework | src/Visitor/Ip.php | Ip.check | public static function check(): array
{
$remoteAddr = \getenv('REMOTE_ADDR') ?: null;
$httpVia = \getenv('HTTP_VIA') ?: null;
$proxyString = static::getProxyString();
$ipData = static::$ipData;
if ($remoteAddr !== null) {
if ($proxyString !== null) {
... | php | public static function check(): array
{
$remoteAddr = \getenv('REMOTE_ADDR') ?: null;
$httpVia = \getenv('HTTP_VIA') ?: null;
$proxyString = static::getProxyString();
$ipData = static::$ipData;
if ($remoteAddr !== null) {
if ($proxyString !== null) {
... | [
"public",
"static",
"function",
"check",
"(",
")",
":",
"array",
"{",
"$",
"remoteAddr",
"=",
"\\",
"getenv",
"(",
"'REMOTE_ADDR'",
")",
"?",
":",
"null",
";",
"$",
"httpVia",
"=",
"\\",
"getenv",
"(",
"'HTTP_VIA'",
")",
"?",
":",
"null",
";",
"$",
... | Checks for visitor IP address, proxy address and returns them
@return array | [
"Checks",
"for",
"visitor",
"IP",
"address",
"proxy",
"address",
"and",
"returns",
"them"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Visitor/Ip.php#L108-L150 |
239,642 | jagilpe/entity-list-bundle | Twig/JagilpeEntityListExtension.php | JagilpeEntityListExtension.getAttributesString | public function getAttributesString(array $attributes = array())
{
$attributesString = '';
foreach ($attributes as $name => $values) {
$value = is_array($values) ? implode(' ', $values) : $values;
$attributesString .= ' '.$name.'="'.$value.'"';
}
return $att... | php | public function getAttributesString(array $attributes = array())
{
$attributesString = '';
foreach ($attributes as $name => $values) {
$value = is_array($values) ? implode(' ', $values) : $values;
$attributesString .= ' '.$name.'="'.$value.'"';
}
return $att... | [
"public",
"function",
"getAttributesString",
"(",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"attributesString",
"=",
"''",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"values",
")",
"{",
"$",
"value",
... | Returns an string for the given attributes ready to be places in an html element
@param array $attributes
@return string | [
"Returns",
"an",
"string",
"for",
"the",
"given",
"attributes",
"ready",
"to",
"be",
"places",
"in",
"an",
"html",
"element"
] | 54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc | https://github.com/jagilpe/entity-list-bundle/blob/54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc/Twig/JagilpeEntityListExtension.php#L67-L77 |
239,643 | Sowapps/orpheus-sqladapter | src/SQLAdapter/SQLAdapterMySQL.php | SQLAdapterMySQL.update | public function update(array $options=array()) {
$options += self::$updateDefaults;
if( empty($options['table']) ) {
throw new Exception('Empty table option');
}
if( empty($options['what']) ) {
throw new Exception('No field');
}
$OPTIONS = '';
$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PR... | php | public function update(array $options=array()) {
$options += self::$updateDefaults;
if( empty($options['table']) ) {
throw new Exception('Empty table option');
}
if( empty($options['what']) ) {
throw new Exception('No field');
}
$OPTIONS = '';
$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PR... | [
"public",
"function",
"update",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"+=",
"self",
"::",
"$",
"updateDefaults",
";",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'table'",
"]",
")",
")",
"{",
"throw",
"n... | Update something in database
@param array $options The options used to build the query.
@return int The number of affected rows.
@see http://dev.mysql.com/doc/refman/5.0/en/update.html
Using pdo_query(), It parses the query from an array to a UPDATE query. | [
"Update",
"something",
"in",
"database"
] | d7730e70f84d7d877a688ff4408cefea34117a1c | https://github.com/Sowapps/orpheus-sqladapter/blob/d7730e70f84d7d877a688ff4408cefea34117a1c/src/SQLAdapter/SQLAdapterMySQL.php#L156-L188 |
239,644 | Sowapps/orpheus-sqladapter | src/SQLAdapter/SQLAdapterMySQL.php | SQLAdapterMySQL.insert | public function insert(array $options=array()) {
$options += self::$insertDefaults;
if( empty($options['table']) ) {
throw new Exception('Empty table option');
}
if( empty($options['what']) ) {
throw new Exception('No field');
}
$OPTIONS = '';
$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PR... | php | public function insert(array $options=array()) {
$options += self::$insertDefaults;
if( empty($options['table']) ) {
throw new Exception('Empty table option');
}
if( empty($options['what']) ) {
throw new Exception('No field');
}
$OPTIONS = '';
$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PR... | [
"public",
"function",
"insert",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"+=",
"self",
"::",
"$",
"insertDefaults",
";",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'table'",
"]",
")",
")",
"{",
"throw",
"n... | Insert something in database
@param array $options The options used to build the query.
@return int The number of inserted rows.
It parses the query from an array to a INSERT query.
Accept only the String syntax for what option. | [
"Insert",
"something",
"in",
"database"
] | d7730e70f84d7d877a688ff4408cefea34117a1c | https://github.com/Sowapps/orpheus-sqladapter/blob/d7730e70f84d7d877a688ff4408cefea34117a1c/src/SQLAdapter/SQLAdapterMySQL.php#L199-L240 |
239,645 | Sowapps/orpheus-sqladapter | src/SQLAdapter/SQLAdapterMySQL.php | SQLAdapterMySQL.delete | public function delete(array $options=array()) {
$options += self::$deleteDefaults;
if( empty($options['table']) ) {
throw new Exception('Empty table option');
}
$OPTIONS = '';
$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PRIORITY' : '';
$OPTIONS .= (!empty($options['quick'])) ? ' QUICK' : '';
... | php | public function delete(array $options=array()) {
$options += self::$deleteDefaults;
if( empty($options['table']) ) {
throw new Exception('Empty table option');
}
$OPTIONS = '';
$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PRIORITY' : '';
$OPTIONS .= (!empty($options['quick'])) ? ' QUICK' : '';
... | [
"public",
"function",
"delete",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"+=",
"self",
"::",
"$",
"deleteDefaults",
";",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'table'",
"]",
")",
")",
"{",
"throw",
"n... | Delete something in database
@param array $options The options used to build the query.
@return int The number of deleted rows.
It parses the query from an array to a DELETE query. | [
"Delete",
"something",
"in",
"database"
] | d7730e70f84d7d877a688ff4408cefea34117a1c | https://github.com/Sowapps/orpheus-sqladapter/blob/d7730e70f84d7d877a688ff4408cefea34117a1c/src/SQLAdapter/SQLAdapterMySQL.php#L250-L270 |
239,646 | unyx/console | terminals/Posix.php | Posix.getDimensionsFromTput | protected function getDimensionsFromTput() : ?array
{
if (empty($output = $this->execute('tput cols && tput lines'))) {
return null;
}
// tput will have returned the values on separate lines, so let's just explode.
$output = explode("\n", $output);
return [
... | php | protected function getDimensionsFromTput() : ?array
{
if (empty($output = $this->execute('tput cols && tput lines'))) {
return null;
}
// tput will have returned the values on separate lines, so let's just explode.
$output = explode("\n", $output);
return [
... | [
"protected",
"function",
"getDimensionsFromTput",
"(",
")",
":",
"?",
"array",
"{",
"if",
"(",
"empty",
"(",
"$",
"output",
"=",
"$",
"this",
"->",
"execute",
"(",
"'tput cols && tput lines'",
")",
")",
")",
"{",
"return",
"null",
";",
"}",
"// tput will h... | Executes a combined 'tput' call and parses the results in order to determine the dimensions of the terminal.
@return array Either an array containing two keys - 'width' and 'height' or null if the data couldn't
be parsed to retrieve anything useful. | [
"Executes",
"a",
"combined",
"tput",
"call",
"and",
"parses",
"the",
"results",
"in",
"order",
"to",
"determine",
"the",
"dimensions",
"of",
"the",
"terminal",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/terminals/Posix.php#L63-L76 |
239,647 | FDT2k/noctis-core | src/Service/UserSessionService.php | UserSessionService.recover_session | function recover_session($token=''){
//$r = Env::getRequest();
$key = Env::getConfig("jwt")->get('key');
$expiration = Env::getConfig("jwt")->get('token_expiration');
$cookie_key= Env::getConfig("jwt")->get('cookie_key');
if(empty($key) || empty($expiration) || empty($cookie_key)){
throw new Exception(... | php | function recover_session($token=''){
//$r = Env::getRequest();
$key = Env::getConfig("jwt")->get('key');
$expiration = Env::getConfig("jwt")->get('token_expiration');
$cookie_key= Env::getConfig("jwt")->get('cookie_key');
if(empty($key) || empty($expiration) || empty($cookie_key)){
throw new Exception(... | [
"function",
"recover_session",
"(",
"$",
"token",
"=",
"''",
")",
"{",
"//$r = Env::getRequest();",
"$",
"key",
"=",
"Env",
"::",
"getConfig",
"(",
"\"jwt\"",
")",
"->",
"get",
"(",
"'key'",
")",
";",
"$",
"expiration",
"=",
"Env",
"::",
"getConfig",
"("... | Recover a jwt user session from a cookie | [
"Recover",
"a",
"jwt",
"user",
"session",
"from",
"a",
"cookie"
] | 482763dd92efcf3d96d13939cdb745763416f3b5 | https://github.com/FDT2k/noctis-core/blob/482763dd92efcf3d96d13939cdb745763416f3b5/src/Service/UserSessionService.php#L17-L76 |
239,648 | FDT2k/noctis-core | src/Service/UserSessionService.php | UserSessionService.create_session | function create_session($data){
$key = Env::getConfig("jwt")->get('key');
$expiration = Env::getConfig("jwt")->get('token_expiration');
$cookie_key= Env::getConfig("jwt")->get('cookie_key');
$token = array(
"iss" => $_SERVER['HTTP_HOST'],
"iat" => time(),
"nbf" => time(),
"exp" => time()+($ex... | php | function create_session($data){
$key = Env::getConfig("jwt")->get('key');
$expiration = Env::getConfig("jwt")->get('token_expiration');
$cookie_key= Env::getConfig("jwt")->get('cookie_key');
$token = array(
"iss" => $_SERVER['HTTP_HOST'],
"iat" => time(),
"nbf" => time(),
"exp" => time()+($ex... | [
"function",
"create_session",
"(",
"$",
"data",
")",
"{",
"$",
"key",
"=",
"Env",
"::",
"getConfig",
"(",
"\"jwt\"",
")",
"->",
"get",
"(",
"'key'",
")",
";",
"$",
"expiration",
"=",
"Env",
"::",
"getConfig",
"(",
"\"jwt\"",
")",
"->",
"get",
"(",
... | Create a jwt user session | [
"Create",
"a",
"jwt",
"user",
"session"
] | 482763dd92efcf3d96d13939cdb745763416f3b5 | https://github.com/FDT2k/noctis-core/blob/482763dd92efcf3d96d13939cdb745763416f3b5/src/Service/UserSessionService.php#L82-L103 |
239,649 | FDT2k/noctis-core | src/Service/UserSessionService.php | UserSessionService.destroy | function destroy(){
$cookie_key= Env::getConfig("jwt")->get('cookie_key');
setcookie($cookie_key,'',time()-10000,'/');
unset($_SESSION[$cookie_key]);
session_destroy();
} | php | function destroy(){
$cookie_key= Env::getConfig("jwt")->get('cookie_key');
setcookie($cookie_key,'',time()-10000,'/');
unset($_SESSION[$cookie_key]);
session_destroy();
} | [
"function",
"destroy",
"(",
")",
"{",
"$",
"cookie_key",
"=",
"Env",
"::",
"getConfig",
"(",
"\"jwt\"",
")",
"->",
"get",
"(",
"'cookie_key'",
")",
";",
"setcookie",
"(",
"$",
"cookie_key",
",",
"''",
",",
"time",
"(",
")",
"-",
"10000",
",",
"'/'",
... | Destroy a jwt user session | [
"Destroy",
"a",
"jwt",
"user",
"session"
] | 482763dd92efcf3d96d13939cdb745763416f3b5 | https://github.com/FDT2k/noctis-core/blob/482763dd92efcf3d96d13939cdb745763416f3b5/src/Service/UserSessionService.php#L108-L113 |
239,650 | flowcode/pachamama | src/flowcode/pachamama/domain/MailMessage.php | MailMessage.getHtmlMail | public static function getHtmlMail($mailView, $params, $to, $from, $subject) {
if (file_exists($mailView)) {
ob_start();
require_once $mailView;
$body = ob_get_contents();
ob_end_clean();
} else {
throw new MailViewException($mailView);
... | php | public static function getHtmlMail($mailView, $params, $to, $from, $subject) {
if (file_exists($mailView)) {
ob_start();
require_once $mailView;
$body = ob_get_contents();
ob_end_clean();
} else {
throw new MailViewException($mailView);
... | [
"public",
"static",
"function",
"getHtmlMail",
"(",
"$",
"mailView",
",",
"$",
"params",
",",
"$",
"to",
",",
"$",
"from",
",",
"$",
"subject",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"mailView",
")",
")",
"{",
"ob_start",
"(",
")",
";",
"req... | Get Html Mail with a view.
@param type $mailView
@param type $params
@param type $to
@param type $from
@param type $subject
@return \flowcode\pachamama\domain\Mail
@throws MailViewException | [
"Get",
"Html",
"Mail",
"with",
"a",
"view",
"."
] | c258de6da7af9c5e6453edcce87f5f40faf4f7c6 | https://github.com/flowcode/pachamama/blob/c258de6da7af9c5e6453edcce87f5f40faf4f7c6/src/flowcode/pachamama/domain/MailMessage.php#L44-L62 |
239,651 | flowcode/pachamama | src/flowcode/pachamama/domain/MailMessage.php | MailMessage.getPlainMail | public static function getPlainMail($to, $from, $body, $subject) {
$mail = new MailMessage($to, $from, $body, $subject);
return $mail;
} | php | public static function getPlainMail($to, $from, $body, $subject) {
$mail = new MailMessage($to, $from, $body, $subject);
return $mail;
} | [
"public",
"static",
"function",
"getPlainMail",
"(",
"$",
"to",
",",
"$",
"from",
",",
"$",
"body",
",",
"$",
"subject",
")",
"{",
"$",
"mail",
"=",
"new",
"MailMessage",
"(",
"$",
"to",
",",
"$",
"from",
",",
"$",
"body",
",",
"$",
"subject",
")... | Gat a standard plain mail.
@param type $to
@param type $from
@param type $body
@param type $subject
@return \flowcode\pachamama\domain\Mail | [
"Gat",
"a",
"standard",
"plain",
"mail",
"."
] | c258de6da7af9c5e6453edcce87f5f40faf4f7c6 | https://github.com/flowcode/pachamama/blob/c258de6da7af9c5e6453edcce87f5f40faf4f7c6/src/flowcode/pachamama/domain/MailMessage.php#L72-L75 |
239,652 | bashilbers/domain | src/Aggregates/Reconstitution.php | Reconstitution.reconstituteFrom | public static function reconstituteFrom(CommittedEvents $history)
{
$instance = static::fromIdentity($history->getIdentity());
$instance->whenAll($history);
return $instance;
} | php | public static function reconstituteFrom(CommittedEvents $history)
{
$instance = static::fromIdentity($history->getIdentity());
$instance->whenAll($history);
return $instance;
} | [
"public",
"static",
"function",
"reconstituteFrom",
"(",
"CommittedEvents",
"$",
"history",
")",
"{",
"$",
"instance",
"=",
"static",
"::",
"fromIdentity",
"(",
"$",
"history",
"->",
"getIdentity",
"(",
")",
")",
";",
"$",
"instance",
"->",
"whenAll",
"(",
... | Reconstructs given concrete aggregate and applies the history
@param CommittedEvents $history
@return static | [
"Reconstructs",
"given",
"concrete",
"aggregate",
"and",
"applies",
"the",
"history"
] | 864736b8c409077706554b6ac4c574832678d316 | https://github.com/bashilbers/domain/blob/864736b8c409077706554b6ac4c574832678d316/src/Aggregates/Reconstitution.php#L21-L27 |
239,653 | Dhii/container-helper-base | src/ContainerHasCapableTrait.php | ContainerHasCapableTrait._containerHas | protected function _containerHas($container, $key)
{
$key = $this->_normalizeKey($key);
if ($container instanceof BaseContainerInterface) {
return $container->has($key);
}
if ($container instanceof ArrayAccess) {
// Catching exceptions thrown by `offsetExist... | php | protected function _containerHas($container, $key)
{
$key = $this->_normalizeKey($key);
if ($container instanceof BaseContainerInterface) {
return $container->has($key);
}
if ($container instanceof ArrayAccess) {
// Catching exceptions thrown by `offsetExist... | [
"protected",
"function",
"_containerHas",
"(",
"$",
"container",
",",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"_normalizeKey",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"container",
"instanceof",
"BaseContainerInterface",
")",
"{",
"re... | Checks for a key on a container.
@since [*next-version*]
@param array|ArrayAccess|stdClass|BaseContainerInterface $container The container to check.
@param string|int|float|bool|Stringable $key The key to check for.
@throws ContainerExceptionInterface If an error occurred while checking the co... | [
"Checks",
"for",
"a",
"key",
"on",
"a",
"container",
"."
] | ccb2f56971d70cf203baa596cd14fdf91be6bfae | https://github.com/Dhii/container-helper-base/blob/ccb2f56971d70cf203baa596cd14fdf91be6bfae/src/ContainerHasCapableTrait.php#L34-L60 |
239,654 | jannisfink/config | src/value/ConfigurationValue.php | ConfigurationValue.parse | public function parse() {
$value = $this->getRawValue();
$matches = [];
if (is_array($value)) {
return $value;
}
if (preg_match(self::NESTED_CONFIGURATION_REGEX, $value, $matches) === 1) {
return $this->parseNestedValue($value, $matches);
} else {
return $this->parser->parseIn... | php | public function parse() {
$value = $this->getRawValue();
$matches = [];
if (is_array($value)) {
return $value;
}
if (preg_match(self::NESTED_CONFIGURATION_REGEX, $value, $matches) === 1) {
return $this->parseNestedValue($value, $matches);
} else {
return $this->parser->parseIn... | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getRawValue",
"(",
")",
";",
"$",
"matches",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if... | Parse the configuration value and return the parsed result
@return mixed the parsed value | [
"Parse",
"the",
"configuration",
"value",
"and",
"return",
"the",
"parsed",
"result"
] | 54dc18c6125c971c46ded9f9484f6802112aab44 | https://github.com/jannisfink/config/blob/54dc18c6125c971c46ded9f9484f6802112aab44/src/value/ConfigurationValue.php#L63-L75 |
239,655 | phperf/pipeline | src/Vector/KalmanFilter.php | KalmanFilter.value | function value($value, $u = 0)
{
if (null === $this->x) {
$this->x = (1 / $this->measurementVector) * $value;
$this->cov = (1 / $this->measurementVector) * $this->measurementNoise * (1 / $this->measurementVector);
} else {
// Compute prediction
$predX ... | php | function value($value, $u = 0)
{
if (null === $this->x) {
$this->x = (1 / $this->measurementVector) * $value;
$this->cov = (1 / $this->measurementVector) * $this->measurementNoise * (1 / $this->measurementVector);
} else {
// Compute prediction
$predX ... | [
"function",
"value",
"(",
"$",
"value",
",",
"$",
"u",
"=",
"0",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"x",
")",
"{",
"$",
"this",
"->",
"x",
"=",
"(",
"1",
"/",
"$",
"this",
"->",
"measurementVector",
")",
"*",
"$",
"value",... | Filter a new value
@param float $value Measurement
@param float|int $u Control
@return float | [
"Filter",
"a",
"new",
"value"
] | d3c4f36e586a677f42674a3fe7077d1334840c6d | https://github.com/phperf/pipeline/blob/d3c4f36e586a677f42674a3fe7077d1334840c6d/src/Vector/KalmanFilter.php#L48-L68 |
239,656 | synapsestudios/synapse-base | src/Synapse/Mapper/FinderTrait.php | FinderTrait.findBy | public function findBy(array $wheres, array $options = [])
{
$query = $this->getSqlObject()->select();
$this->setColumns($query, $options);
$wheres = $this->addJoins($query, $wheres, $options);
$this->addWheres($query, $wheres, $options);
if (Arr::get($options, 'order')) ... | php | public function findBy(array $wheres, array $options = [])
{
$query = $this->getSqlObject()->select();
$this->setColumns($query, $options);
$wheres = $this->addJoins($query, $wheres, $options);
$this->addWheres($query, $wheres, $options);
if (Arr::get($options, 'order')) ... | [
"public",
"function",
"findBy",
"(",
"array",
"$",
"wheres",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getSqlObject",
"(",
")",
"->",
"select",
"(",
")",
";",
"$",
"this",
"->",
"setColumns",
"(",... | Find a single entity by specific field values
@param array $wheres An array of where conditions in the format:
['column' => 'value'] or
['column', 'operator', 'value']
@param array $options
@return AbstractEntity|bool | [
"Find",
"a",
"single",
"entity",
"by",
"specific",
"field",
"values"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/FinderTrait.php#L51-L66 |
239,657 | synapsestudios/synapse-base | src/Synapse/Mapper/FinderTrait.php | FinderTrait.findAllBy | public function findAllBy(array $wheres, array $options = [])
{
$query = $this->getSqlObject()->select();
$this->setColumns($query, $options);
$wheres = $this->addJoins($query, $wheres, $options);
$this->addWheres($query, $wheres, $options);
$page = Arr::get($options, 'pa... | php | public function findAllBy(array $wheres, array $options = [])
{
$query = $this->getSqlObject()->select();
$this->setColumns($query, $options);
$wheres = $this->addJoins($query, $wheres, $options);
$this->addWheres($query, $wheres, $options);
$page = Arr::get($options, 'pa... | [
"public",
"function",
"findAllBy",
"(",
"array",
"$",
"wheres",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getSqlObject",
"(",
")",
"->",
"select",
"(",
")",
";",
"$",
"this",
"->",
"setColumns",
"... | Find all entities matching specific field values
@param array $wheres An array of where conditions in the format:
['column' => 'value'] or
['column', 'operator', 'value']
@param array $options Array of options for this request.
May include 'order', 'page', or 'resultsPerPage'.
@return EntityIterator AbstractEntity ... | [
"Find",
"all",
"entities",
"matching",
"specific",
"field",
"values"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/FinderTrait.php#L90-L124 |
239,658 | synapsestudios/synapse-base | src/Synapse/Mapper/FinderTrait.php | FinderTrait.setOrder | protected function setOrder(Select $query, array $order)
{
// Normalize to [['column', 'direction']] format if only one column
if (! is_array(Arr::get($order, 0))) {
$order = [$order];
}
foreach ($order as $key => $orderValue) {
if (is_array($orderValue)) {
... | php | protected function setOrder(Select $query, array $order)
{
// Normalize to [['column', 'direction']] format if only one column
if (! is_array(Arr::get($order, 0))) {
$order = [$order];
}
foreach ($order as $key => $orderValue) {
if (is_array($orderValue)) {
... | [
"protected",
"function",
"setOrder",
"(",
"Select",
"$",
"query",
",",
"array",
"$",
"order",
")",
"{",
"// Normalize to [['column', 'direction']] format if only one column",
"if",
"(",
"!",
"is_array",
"(",
"Arr",
"::",
"get",
"(",
"$",
"order",
",",
"0",
")",
... | Set the order on the given query
Can specify order as [['column', 'direction'], ['column', 'direction']]
or just ['column', 'direction'] or even [['column', 'direction'], 'column']
@param Select $query
@param array $order
@return Select | [
"Set",
"the",
"order",
"on",
"the",
"given",
"query"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/FinderTrait.php#L148-L165 |
239,659 | synapsestudios/synapse-base | src/Synapse/Mapper/FinderTrait.php | FinderTrait.getPaginationData | protected function getPaginationData(Select $query, array $options)
{
// Get pagination options
$page = (int) Arr::get($options, 'page');
if ($page < 1) {
$page = 1;
}
$resultsPerPage = Arr::get(
$options,
'resultsPerPage',
$t... | php | protected function getPaginationData(Select $query, array $options)
{
// Get pagination options
$page = (int) Arr::get($options, 'page');
if ($page < 1) {
$page = 1;
}
$resultsPerPage = Arr::get(
$options,
'resultsPerPage',
$t... | [
"protected",
"function",
"getPaginationData",
"(",
"Select",
"$",
"query",
",",
"array",
"$",
"options",
")",
"{",
"// Get pagination options",
"$",
"page",
"=",
"(",
"int",
")",
"Arr",
"::",
"get",
"(",
"$",
"options",
",",
"'page'",
")",
";",
"if",
"("... | Get data object with pagination data like page and page_count
@param Select $query
@param array $options
@return PaginationData | [
"Get",
"data",
"object",
"with",
"pagination",
"data",
"like",
"page",
"and",
"page_count"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/FinderTrait.php#L174-L199 |
239,660 | synapsestudios/synapse-base | src/Synapse/Mapper/FinderTrait.php | FinderTrait.getQueryResultCount | protected function getQueryResultCount(Select $query)
{
$queryString = $this->getSqlObject()->getSqlStringForSqlObject($query, $this->dbAdapter->getPlatform());
$format = 'Select count(*) as `count` from (%s) as `query_count`';
$countQueryString = sprintf($format, $queryString);
$... | php | protected function getQueryResultCount(Select $query)
{
$queryString = $this->getSqlObject()->getSqlStringForSqlObject($query, $this->dbAdapter->getPlatform());
$format = 'Select count(*) as `count` from (%s) as `query_count`';
$countQueryString = sprintf($format, $queryString);
$... | [
"protected",
"function",
"getQueryResultCount",
"(",
"Select",
"$",
"query",
")",
"{",
"$",
"queryString",
"=",
"$",
"this",
"->",
"getSqlObject",
"(",
")",
"->",
"getSqlStringForSqlObject",
"(",
"$",
"query",
",",
"$",
"this",
"->",
"dbAdapter",
"->",
"getP... | Get the count of results from a given query
@param Select $query
@return int | [
"Get",
"the",
"count",
"of",
"results",
"from",
"a",
"given",
"query"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/FinderTrait.php#L207-L220 |
239,661 | synapsestudios/synapse-base | src/Synapse/Mapper/FinderTrait.php | FinderTrait.addWheres | protected function addWheres(PreparableSqlInterface $query, array $wheres, array $options = [])
{
foreach ($wheres as $key => $where) {
if (is_array($where) && count($where) === 3) {
$leftOpRightSyntax = true;
$operator = $where[1];
switch ($oper... | php | protected function addWheres(PreparableSqlInterface $query, array $wheres, array $options = [])
{
foreach ($wheres as $key => $where) {
if (is_array($where) && count($where) === 3) {
$leftOpRightSyntax = true;
$operator = $where[1];
switch ($oper... | [
"protected",
"function",
"addWheres",
"(",
"PreparableSqlInterface",
"$",
"query",
",",
"array",
"$",
"wheres",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"wheres",
"as",
"$",
"key",
"=>",
"$",
"where",
")",
"{",
"if",
... | Add where clauses to query
@param PreparableSqlInterface $query
@param array $wheres An array of where conditions in the format:
['column' => 'value'] or
['column', 'operator', 'value']
@param array $options
@return PreparableSqlInterface
@throws InvalidArgumentException If a WHERE requireme... | [
"Add",
"where",
"clauses",
"to",
"query"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Mapper/FinderTrait.php#L233-L318 |
239,662 | Dhii/validation-abstract | src/ValidatorAwareTrait.php | ValidatorAwareTrait._setValidator | protected function _setValidator($validator)
{
if (!is_null($validator) && !($validator instanceof ValidatorInterface)) {
throw $this->_createInvalidArgumentException($this->__('Invalid validator'), null, null, $validator);
}
$this->validator = $validator;
} | php | protected function _setValidator($validator)
{
if (!is_null($validator) && !($validator instanceof ValidatorInterface)) {
throw $this->_createInvalidArgumentException($this->__('Invalid validator'), null, null, $validator);
}
$this->validator = $validator;
} | [
"protected",
"function",
"_setValidator",
"(",
"$",
"validator",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"validator",
")",
"&&",
"!",
"(",
"$",
"validator",
"instanceof",
"ValidatorInterface",
")",
")",
"{",
"throw",
"$",
"this",
"->",
"_createInval... | Assigns a validator to this instance.
@since [*next-version*]
@param ValidatorInterface|null $validator The validator. | [
"Assigns",
"a",
"validator",
"to",
"this",
"instance",
"."
] | dff998ba3476927a0fc6d10bb022425de8f1c844 | https://github.com/Dhii/validation-abstract/blob/dff998ba3476927a0fc6d10bb022425de8f1c844/src/ValidatorAwareTrait.php#L44-L51 |
239,663 | extendsframework/extends-router | src/Route/Path/PathRoute.php | PathRoute.getMatchedParameters | protected function getMatchedParameters(array $matches): array
{
$parameters = [];
foreach ($matches as $key => $match) {
if (is_string($key)) {
$parameters[$key] = $match[0];
}
}
return array_replace_recursive($this->getParameters(), $paramet... | php | protected function getMatchedParameters(array $matches): array
{
$parameters = [];
foreach ($matches as $key => $match) {
if (is_string($key)) {
$parameters[$key] = $match[0];
}
}
return array_replace_recursive($this->getParameters(), $paramet... | [
"protected",
"function",
"getMatchedParameters",
"(",
"array",
"$",
"matches",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"matches",
"as",
"$",
"key",
"=>",
"$",
"match",
")",
"{",
"if",
"(",
"is_string",
"(",
... | Get the parameters when the route is matched.
The $matches will be filtered for integer keys and merged into the default parameters.
@param array $matches
@return array | [
"Get",
"the",
"parameters",
"when",
"the",
"route",
"is",
"matched",
"."
] | 7c142749635c6fb1c58508bf3c8f594529e136d9 | https://github.com/extendsframework/extends-router/blob/7c142749635c6fb1c58508bf3c8f594529e136d9/src/Route/Path/PathRoute.php#L136-L146 |
239,664 | extendsframework/extends-router | src/Route/Path/PathRoute.php | PathRoute.getPattern | protected function getPattern(): string
{
$path = preg_replace_callback('~:([a-z][a-z0-9\_]+)~i', function ($match) {
return sprintf('(?<%s>%s)', $match[1], '[^\/]*');
}, $this->getPath());
return sprintf('~\G(%s)(/|\z)~', $path);
} | php | protected function getPattern(): string
{
$path = preg_replace_callback('~:([a-z][a-z0-9\_]+)~i', function ($match) {
return sprintf('(?<%s>%s)', $match[1], '[^\/]*');
}, $this->getPath());
return sprintf('~\G(%s)(/|\z)~', $path);
} | [
"protected",
"function",
"getPattern",
"(",
")",
":",
"string",
"{",
"$",
"path",
"=",
"preg_replace_callback",
"(",
"'~:([a-z][a-z0-9\\_]+)~i'",
",",
"function",
"(",
"$",
"match",
")",
"{",
"return",
"sprintf",
"(",
"'(?<%s>%s)'",
",",
"$",
"match",
"[",
"... | Get pattern to match request path.
@return string | [
"Get",
"pattern",
"to",
"match",
"request",
"path",
"."
] | 7c142749635c6fb1c58508bf3c8f594529e136d9 | https://github.com/extendsframework/extends-router/blob/7c142749635c6fb1c58508bf3c8f594529e136d9/src/Route/Path/PathRoute.php#L153-L160 |
239,665 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/FrontendProcessing/SubscribeToList.php | SubscribeToList.prepareEmailDataForInsert | public function prepareEmailDataForInsert($request) {
$data = [];
$data['email_type_id'] = 1; // Primary
$data['title'] = $request->input('email');
$data['description'] = "";
$data['comments'] = "Created by front-end subscription to an email list";
$data... | php | public function prepareEmailDataForInsert($request) {
$data = [];
$data['email_type_id'] = 1; // Primary
$data['title'] = $request->input('email');
$data['description'] = "";
$data['comments'] = "Created by front-end subscription to an email list";
$data... | [
"public",
"function",
"prepareEmailDataForInsert",
"(",
"$",
"request",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"data",
"[",
"'email_type_id'",
"]",
"=",
"1",
";",
"// Primary",
"$",
"data",
"[",
"'title'",
"]",
"=",
"$",
"request",
"->",
"inpu... | Prepare the data for creating a new record in the "emails" db table
@param object $request The request object
@return array | [
"Prepare",
"the",
"data",
"for",
"creating",
"a",
"new",
"record",
"in",
"the",
"emails",
"db",
"table"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/FrontendProcessing/SubscribeToList.php#L168-L182 |
239,666 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/FrontendProcessing/SubscribeToList.php | SubscribeToList.prepareList_emailDataForInsert | public function prepareList_emailDataForInsert($input) {
$data = [];
$data['title'] = $input['listID']." ".$input['emailID'];
$data['list_id'] = $input['listID'];
$data['email_id'] = $input['emailID'];
$data['comments'] = "";
$data['enabled'] ... | php | public function prepareList_emailDataForInsert($input) {
$data = [];
$data['title'] = $input['listID']." ".$input['emailID'];
$data['list_id'] = $input['listID'];
$data['email_id'] = $input['emailID'];
$data['comments'] = "";
$data['enabled'] ... | [
"public",
"function",
"prepareList_emailDataForInsert",
"(",
"$",
"input",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"data",
"[",
"'title'",
"]",
"=",
"$",
"input",
"[",
"'listID'",
"]",
".",
"\" \"",
".",
"$",
"input",
"[",
"'emailID'",
"]",
"... | Prepare the data for creating a new record in the "list_email" db table
@param array $input POST and processed vars merged into one array
@return array | [
"Prepare",
"the",
"data",
"for",
"creating",
"a",
"new",
"record",
"in",
"the",
"list_email",
"db",
"table"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/FrontendProcessing/SubscribeToList.php#L200-L216 |
239,667 | lasallecrm/lasallecrm-l5-listmanagement-pkg | src/FrontendProcessing/SubscribeToList.php | SubscribeToList.preparePeoplesDataForInsert | public function preparePeoplesDataForInsert($input) {
$data = [];
$data['user_id'] = null; // Set users up as PEOPLES in the admin
$data['title'] = $input['first_name']." ".$input['surname'];
$data['salutation'] = "";
$data['first_name'] = $input['first_nam... | php | public function preparePeoplesDataForInsert($input) {
$data = [];
$data['user_id'] = null; // Set users up as PEOPLES in the admin
$data['title'] = $input['first_name']." ".$input['surname'];
$data['salutation'] = "";
$data['first_name'] = $input['first_nam... | [
"public",
"function",
"preparePeoplesDataForInsert",
"(",
"$",
"input",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"data",
"[",
"'user_id'",
"]",
"=",
"null",
";",
"// Set users up as PEOPLES in the admin",
"$",
"data",
"[",
"'title'",
"]",
"=",
"$",
... | Prepare the data for creating a new record in the "peoplesl" db table
@param array $input POST and processed vars merged into one array
@return array | [
"Prepare",
"the",
"data",
"for",
"creating",
"a",
"new",
"record",
"in",
"the",
"peoplesl",
"db",
"table"
] | 4b5da1af5d25d5fb4be5199f3cf22da313d475f3 | https://github.com/lasallecrm/lasallecrm-l5-listmanagement-pkg/blob/4b5da1af5d25d5fb4be5199f3cf22da313d475f3/src/FrontendProcessing/SubscribeToList.php#L245-L271 |
239,668 | webriq/core | module/Customize/src/Grid/Customize/Controller/ImportExportController.php | ImportExportController.getValidReturnUri | protected function getValidReturnUri( $returnUri, $default = null )
{
$match = array();
$returnUri = ltrim( str_replace( '\\', '/', $returnUri ), "\n\r\t\v\e\f" );
if ( ! preg_match( '#^/([^/].*)?$#', $returnUri, $match ) )
{
return $default;
}
ret... | php | protected function getValidReturnUri( $returnUri, $default = null )
{
$match = array();
$returnUri = ltrim( str_replace( '\\', '/', $returnUri ), "\n\r\t\v\e\f" );
if ( ! preg_match( '#^/([^/].*)?$#', $returnUri, $match ) )
{
return $default;
}
ret... | [
"protected",
"function",
"getValidReturnUri",
"(",
"$",
"returnUri",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"match",
"=",
"array",
"(",
")",
";",
"$",
"returnUri",
"=",
"ltrim",
"(",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"return... | Gte valid return-uri
@param string $returnUri
@param string|null $default
@return string|null | [
"Gte",
"valid",
"return",
"-",
"uri"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Controller/ImportExportController.php#L54-L65 |
239,669 | webriq/core | module/Customize/src/Grid/Customize/Controller/ImportExportController.php | ImportExportController.exportAction | public function exportAction()
{
$params = $this->params();
$paragraphId = $params->fromRoute( 'paragraphId' );
$serviceLocator = $this->getServiceLocator();
$paragraphModel = $serviceLocator->get( 'Grid\Paragraph\Model\Paragraph\Model' );
$paragraph = $paragr... | php | public function exportAction()
{
$params = $this->params();
$paragraphId = $params->fromRoute( 'paragraphId' );
$serviceLocator = $this->getServiceLocator();
$paragraphModel = $serviceLocator->get( 'Grid\Paragraph\Model\Paragraph\Model' );
$paragraph = $paragr... | [
"public",
"function",
"exportAction",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"params",
"(",
")",
";",
"$",
"paragraphId",
"=",
"$",
"params",
"->",
"fromRoute",
"(",
"'paragraphId'",
")",
";",
"$",
"serviceLocator",
"=",
"$",
"this",
"->... | Export paragraph action | [
"Export",
"paragraph",
"action"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Controller/ImportExportController.php#L179-L216 |
239,670 | PlatoCreative/plato-external-login | src/security/ExternalLoginAuthenticator.php | ExternalMemberAuthenticator.authenticateExternalMember | protected function authenticateExternalMember($data, ValidationResult &$result = null, Member $member = null)
{
$result = $result ?: ValidationResult::create();
$ssLoginUserName = Environment::getEnv('SS_DEFAULT_ADMIN_USERNAME');
$email = !empty($data['Email']) ? $data['Email'] : null;
... | php | protected function authenticateExternalMember($data, ValidationResult &$result = null, Member $member = null)
{
$result = $result ?: ValidationResult::create();
$ssLoginUserName = Environment::getEnv('SS_DEFAULT_ADMIN_USERNAME');
$email = !empty($data['Email']) ? $data['Email'] : null;
... | [
"protected",
"function",
"authenticateExternalMember",
"(",
"$",
"data",
",",
"ValidationResult",
"&",
"$",
"result",
"=",
"null",
",",
"Member",
"$",
"member",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"result",
"?",
":",
"ValidationResult",
"::",
"... | Attempt to find and authenticate external member if possible from the given data
@param array $data Form submitted data
@param ValidationResult $result
@param Member $member This third parameter is used in the CMSAuthenticator(s)
@return Member|Null | [
"Attempt",
"to",
"find",
"and",
"authenticate",
"external",
"member",
"if",
"possible",
"from",
"the",
"given",
"data"
] | 365277a84551e630b03ba24a49f26d536fdf3601 | https://github.com/PlatoCreative/plato-external-login/blob/365277a84551e630b03ba24a49f26d536fdf3601/src/security/ExternalLoginAuthenticator.php#L55-L79 |
239,671 | Aureja/JobQueue | src/JobRestoreManager.php | JobRestoreManager.saveReport | private function saveReport(JobConfigurationInterface $configuration)
{
$report = $this->reportManager->create($configuration);
$report
->setEndedAt()
->setOutput('Job was dead and restored.')
->setSuccessful(true);
$this->reportManager->add($report, true... | php | private function saveReport(JobConfigurationInterface $configuration)
{
$report = $this->reportManager->create($configuration);
$report
->setEndedAt()
->setOutput('Job was dead and restored.')
->setSuccessful(true);
$this->reportManager->add($report, true... | [
"private",
"function",
"saveReport",
"(",
"JobConfigurationInterface",
"$",
"configuration",
")",
"{",
"$",
"report",
"=",
"$",
"this",
"->",
"reportManager",
"->",
"create",
"(",
"$",
"configuration",
")",
";",
"$",
"report",
"->",
"setEndedAt",
"(",
")",
"... | Create restored job report.
@param JobConfigurationInterface $configuration
@return JobReportInterface | [
"Create",
"restored",
"job",
"report",
"."
] | 0e488ca123d3105cf791173e3147ede1bcf39018 | https://github.com/Aureja/JobQueue/blob/0e488ca123d3105cf791173e3147ede1bcf39018/src/JobRestoreManager.php#L83-L92 |
239,672 | Aureja/JobQueue | src/JobRestoreManager.php | JobRestoreManager.isDead | private function isDead(JobConfigurationInterface $configuration)
{
$report = $this->reportManager->getLastStartedByConfiguration($configuration);
return $report && $report->getPid() && (false === $report->isSuccessful()) && !posix_getsid($report->getPid());
} | php | private function isDead(JobConfigurationInterface $configuration)
{
$report = $this->reportManager->getLastStartedByConfiguration($configuration);
return $report && $report->getPid() && (false === $report->isSuccessful()) && !posix_getsid($report->getPid());
} | [
"private",
"function",
"isDead",
"(",
"JobConfigurationInterface",
"$",
"configuration",
")",
"{",
"$",
"report",
"=",
"$",
"this",
"->",
"reportManager",
"->",
"getLastStartedByConfiguration",
"(",
"$",
"configuration",
")",
";",
"return",
"$",
"report",
"&&",
... | Checks or job is dead.
@param JobConfigurationInterface $configuration
@return bool | [
"Checks",
"or",
"job",
"is",
"dead",
"."
] | 0e488ca123d3105cf791173e3147ede1bcf39018 | https://github.com/Aureja/JobQueue/blob/0e488ca123d3105cf791173e3147ede1bcf39018/src/JobRestoreManager.php#L101-L106 |
239,673 | Puzzlout/FrameworkMvcLegacy | src/GeneratorEngine/Core/ResourceConstantsClassGenerator.php | ResourceConstantsClassGenerator.WriteContent | public function WriteContent() {
$output = $this->WriteGetListMethod();
$output .= PhpCodeSnippets::CRLF;
fwrite($this->writer, $output);
} | php | public function WriteContent() {
$output = $this->WriteGetListMethod();
$output .= PhpCodeSnippets::CRLF;
fwrite($this->writer, $output);
} | [
"public",
"function",
"WriteContent",
"(",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"WriteGetListMethod",
"(",
")",
";",
"$",
"output",
".=",
"PhpCodeSnippets",
"::",
"CRLF",
";",
"fwrite",
"(",
"$",
"this",
"->",
"writer",
",",
"$",
"output",
... | Write the content of the class, method by method. | [
"Write",
"the",
"content",
"of",
"the",
"class",
"method",
"by",
"method",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/GeneratorEngine/Core/ResourceConstantsClassGenerator.php#L145-L149 |
239,674 | Puzzlout/FrameworkMvcLegacy | src/GeneratorEngine/Core/ResourceConstantsClassGenerator.php | ResourceConstantsClassGenerator.WriteNewArrayAndItsContents | public function WriteNewArrayAndItsContents($array, $arrayOpened = false, $tabAmount = 0) {
$output = "";
foreach ($array as $key => $value) {
if (is_array($value)) {
$output .= $this->WriteAssociativeArrayValueAsNewArray($key, $tabAmount); //new array opened
... | php | public function WriteNewArrayAndItsContents($array, $arrayOpened = false, $tabAmount = 0) {
$output = "";
foreach ($array as $key => $value) {
if (is_array($value)) {
$output .= $this->WriteAssociativeArrayValueAsNewArray($key, $tabAmount); //new array opened
... | [
"public",
"function",
"WriteNewArrayAndItsContents",
"(",
"$",
"array",
",",
"$",
"arrayOpened",
"=",
"false",
",",
"$",
"tabAmount",
"=",
"0",
")",
"{",
"$",
"output",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value... | Recursively writes an array from an array of values.
@param array $array the array to loop through to generate the values given.
@param type $arrayOpened flag to specify if an array is opened and needs to
be closed before moving on.
@param type $tabAmount the number of tabs or 2 spaces to print in the generated
code.
... | [
"Recursively",
"writes",
"an",
"array",
"from",
"an",
"array",
"of",
"values",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/GeneratorEngine/Core/ResourceConstantsClassGenerator.php#L190-L204 |
239,675 | DGAC/MattermostModule | src/MattermostMessenger/Controller/MattermostChatController.php | MattermostChatController.ackAction | public function ackAction()
{
$json = array();
$postId = $this->params()->fromQuery('postid', null);
$response = $this->mattermost->saveReaction($postId, 'ok');
$json['result'] = $response;
return new JsonModel($json);
} | php | public function ackAction()
{
$json = array();
$postId = $this->params()->fromQuery('postid', null);
$response = $this->mattermost->saveReaction($postId, 'ok');
$json['result'] = $response;
return new JsonModel($json);
} | [
"public",
"function",
"ackAction",
"(",
")",
"{",
"$",
"json",
"=",
"array",
"(",
")",
";",
"$",
"postId",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromQuery",
"(",
"'postid'",
",",
"null",
")",
";",
"$",
"response",
"=",
"$",
"this",
"... | Post a 'ok' reaction to send an acknowledge
@return JsonModel | [
"Post",
"a",
"ok",
"reaction",
"to",
"send",
"an",
"acknowledge"
] | 02da5791d70715d2478d816c28fc034707c9d341 | https://github.com/DGAC/MattermostModule/blob/02da5791d70715d2478d816c28fc034707c9d341/src/MattermostMessenger/Controller/MattermostChatController.php#L251-L258 |
239,676 | DGAC/MattermostModule | src/MattermostMessenger/Controller/MattermostChatController.php | MattermostChatController.isAckAction | public function isAckAction()
{
$json = array();
$postId = $this->params()->fromQuery('postid', null);
$myReactions = $this->mattermost->getMyReactions($postId);
$ok = array_filter($myReactions, function($v){
return strcmp($v['emoji_name'], 'ok') == 0;
});
... | php | public function isAckAction()
{
$json = array();
$postId = $this->params()->fromQuery('postid', null);
$myReactions = $this->mattermost->getMyReactions($postId);
$ok = array_filter($myReactions, function($v){
return strcmp($v['emoji_name'], 'ok') == 0;
});
... | [
"public",
"function",
"isAckAction",
"(",
")",
"{",
"$",
"json",
"=",
"array",
"(",
")",
";",
"$",
"postId",
"=",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromQuery",
"(",
"'postid'",
",",
"null",
")",
";",
"$",
"myReactions",
"=",
"$",
"this"... | Test if the post has a "ok" reaction, signifying the post has already been aknowledged
@return JsonModel | [
"Test",
"if",
"the",
"post",
"has",
"a",
"ok",
"reaction",
"signifying",
"the",
"post",
"has",
"already",
"been",
"aknowledged"
] | 02da5791d70715d2478d816c28fc034707c9d341 | https://github.com/DGAC/MattermostModule/blob/02da5791d70715d2478d816c28fc034707c9d341/src/MattermostMessenger/Controller/MattermostChatController.php#L279-L289 |
239,677 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrate | public function migrate(array $filters)
{
$this->filters =$filters;
foreach ($this->academicPeriods() as $period) {
$this->period = $period->id;
$this->setDestinationConnectionByPeriod($this->period);
$this->switchToDestinationConnection();
$this->outp... | php | public function migrate(array $filters)
{
$this->filters =$filters;
foreach ($this->academicPeriods() as $period) {
$this->period = $period->id;
$this->setDestinationConnectionByPeriod($this->period);
$this->switchToDestinationConnection();
$this->outp... | [
"public",
"function",
"migrate",
"(",
"array",
"$",
"filters",
")",
"{",
"$",
"this",
"->",
"filters",
"=",
"$",
"filters",
";",
"foreach",
"(",
"$",
"this",
"->",
"academicPeriods",
"(",
")",
"as",
"$",
"period",
")",
"{",
"$",
"this",
"->",
"period... | Migrate old database to new database.
@param array $filters
@return void | [
"Migrate",
"old",
"database",
"to",
"new",
"database",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L366-L384 |
239,678 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateTeachers | protected function migrateTeachers()
{
$this->output->info('### Migrating teachers ###');
foreach ($this->teachers() as $teacher) {
$this->showMigratingInfo($teacher, 1);
$this->output->info(' email: ' . $teacher->email);
$this->migrateTeacher($teacher);
... | php | protected function migrateTeachers()
{
$this->output->info('### Migrating teachers ###');
foreach ($this->teachers() as $teacher) {
$this->showMigratingInfo($teacher, 1);
$this->output->info(' email: ' . $teacher->email);
$this->migrateTeacher($teacher);
... | [
"protected",
"function",
"migrateTeachers",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Migrating teachers ###'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"teachers",
"(",
")",
"as",
"$",
"teacher",
")",
"{",
"$",
"this",
"->... | Migrate teachers. | [
"Migrate",
"teachers",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L389-L399 |
239,679 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateTeacher | protected function migrateTeacher(Teacher $teacher) {
$user = User::firstOrNew([
'email' => $teacher->email,
]);
$user->name = $teacher->name;
$user->password = bcrypt('secret');
$user->remember_token = str_random(10);
$user->save();
//TODO: migrate te... | php | protected function migrateTeacher(Teacher $teacher) {
$user = User::firstOrNew([
'email' => $teacher->email,
]);
$user->name = $teacher->name;
$user->password = bcrypt('secret');
$user->remember_token = str_random(10);
$user->save();
//TODO: migrate te... | [
"protected",
"function",
"migrateTeacher",
"(",
"Teacher",
"$",
"teacher",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"firstOrNew",
"(",
"[",
"'email'",
"=>",
"$",
"teacher",
"->",
"email",
",",
"]",
")",
";",
"$",
"user",
"->",
"name",
"=",
"$",
"tea... | Migrate teacher.
@param Teacher $teacher | [
"Migrate",
"teacher",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L406-L415 |
239,680 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateEnrollment | protected function migrateEnrollment($enrollment)
{
$user = $this->migratePerson($enrollment->person);
try {
$enrollment = ScoolEnrollment::firstOrNew([
'user_id' => $user->id,
'study_id' => $this->translateStudyId($enrollment->study_id),
... | php | protected function migrateEnrollment($enrollment)
{
$user = $this->migratePerson($enrollment->person);
try {
$enrollment = ScoolEnrollment::firstOrNew([
'user_id' => $user->id,
'study_id' => $this->translateStudyId($enrollment->study_id),
... | [
"protected",
"function",
"migrateEnrollment",
"(",
"$",
"enrollment",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"migratePerson",
"(",
"$",
"enrollment",
"->",
"person",
")",
";",
"try",
"{",
"$",
"enrollment",
"=",
"ScoolEnrollment",
"::",
"firstOrNew",... | Migrate ebre-escool enrollment to scool enrollment.
@param $enrollment
@return null | [
"Migrate",
"ebre",
"-",
"escool",
"enrollment",
"to",
"scool",
"enrollment",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L423-L441 |
239,681 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateLesson | protected function migrateLesson($oldLesson)
{
if ($this->lessonNotExists($oldLesson)) {
DB::beginTransaction();
try {
$lesson = new ScoolLesson;
$lesson->location_id = $this->translateLocationId($oldLesson->location_id);
... | php | protected function migrateLesson($oldLesson)
{
if ($this->lessonNotExists($oldLesson)) {
DB::beginTransaction();
try {
$lesson = new ScoolLesson;
$lesson->location_id = $this->translateLocationId($oldLesson->location_id);
... | [
"protected",
"function",
"migrateLesson",
"(",
"$",
"oldLesson",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lessonNotExists",
"(",
"$",
"oldLesson",
")",
")",
"{",
"DB",
"::",
"beginTransaction",
"(",
")",
";",
"try",
"{",
"$",
"lesson",
"=",
"new",
"Sco... | Migrate lesson. | [
"Migrate",
"lesson",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L447-L480 |
239,682 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateEnrollmentDetail | protected function migrateEnrollmentDetail($enrollmentDetail,$enrollment_id)
{
try {
$enrollment = ScoolEnrollmentSubmodule::firstOrNew([
'enrollment_id' => $enrollment_id,
'module_id' => $this->translateModuleId($enrollmentDetail->moduleid),
'... | php | protected function migrateEnrollmentDetail($enrollmentDetail,$enrollment_id)
{
try {
$enrollment = ScoolEnrollmentSubmodule::firstOrNew([
'enrollment_id' => $enrollment_id,
'module_id' => $this->translateModuleId($enrollmentDetail->moduleid),
'... | [
"protected",
"function",
"migrateEnrollmentDetail",
"(",
"$",
"enrollmentDetail",
",",
"$",
"enrollment_id",
")",
"{",
"try",
"{",
"$",
"enrollment",
"=",
"ScoolEnrollmentSubmodule",
"::",
"firstOrNew",
"(",
"[",
"'enrollment_id'",
"=>",
"$",
"enrollment_id",
",",
... | Migrate ebre-escool enrollment detail to scool enrollment.
@param $enrollmentDetail
@param $enrollment_id | [
"Migrate",
"ebre",
"-",
"escool",
"enrollment",
"detail",
"to",
"scool",
"enrollment",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L525-L539 |
239,683 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateLocationId | protected function translateLocationId($oldLocationId)
{
$location = ScoolLocation::where('name',Location::findOrFail($oldLocationId)->name)->first();
if ( $location != null ) {
return $location->id;
}
throw new LocationNotFoundByNameException();
} | php | protected function translateLocationId($oldLocationId)
{
$location = ScoolLocation::where('name',Location::findOrFail($oldLocationId)->name)->first();
if ( $location != null ) {
return $location->id;
}
throw new LocationNotFoundByNameException();
} | [
"protected",
"function",
"translateLocationId",
"(",
"$",
"oldLocationId",
")",
"{",
"$",
"location",
"=",
"ScoolLocation",
"::",
"where",
"(",
"'name'",
",",
"Location",
"::",
"findOrFail",
"(",
"$",
"oldLocationId",
")",
"->",
"name",
")",
"->",
"first",
"... | Translate location id.
@param $oldLocationId
@return mixed
@throws LocationNotFoundByNameException | [
"Translate",
"location",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L559-L566 |
239,684 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateTimeslotId | protected function translateTimeslotId($oldTimeslotId)
{
$timeslot = ScoolTimeslot::where('order',Timeslot::findOrFail($oldTimeslotId)->order)->first();
if ( $timeslot != null ) {
return $timeslot->id;
}
throw new TimeslotNotFoundByNameException();
} | php | protected function translateTimeslotId($oldTimeslotId)
{
$timeslot = ScoolTimeslot::where('order',Timeslot::findOrFail($oldTimeslotId)->order)->first();
if ( $timeslot != null ) {
return $timeslot->id;
}
throw new TimeslotNotFoundByNameException();
} | [
"protected",
"function",
"translateTimeslotId",
"(",
"$",
"oldTimeslotId",
")",
"{",
"$",
"timeslot",
"=",
"ScoolTimeslot",
"::",
"where",
"(",
"'order'",
",",
"Timeslot",
"::",
"findOrFail",
"(",
"$",
"oldTimeslotId",
")",
"->",
"order",
")",
"->",
"first",
... | Translate timeslot id.
@param $oldTimeslotId
@return mixed
@throws TimeslotNotFoundByNameException | [
"Translate",
"timeslot",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L603-L610 |
239,685 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateModuleId | protected function translateModuleId($oldModuleId)
{
$module = Module::where('name',StudyModule::findOrFail($oldModuleId)->name)->first();
if ( $module != null ) {
return $module->id;
}
throw new ModuleNotFoundByNameException();
} | php | protected function translateModuleId($oldModuleId)
{
$module = Module::where('name',StudyModule::findOrFail($oldModuleId)->name)->first();
if ( $module != null ) {
return $module->id;
}
throw new ModuleNotFoundByNameException();
} | [
"protected",
"function",
"translateModuleId",
"(",
"$",
"oldModuleId",
")",
"{",
"$",
"module",
"=",
"Module",
"::",
"where",
"(",
"'name'",
",",
"StudyModule",
"::",
"findOrFail",
"(",
"$",
"oldModuleId",
")",
"->",
"name",
")",
"->",
"first",
"(",
")",
... | Translate module id.
@param $oldModuleId
@return
@throws ModuleNotFoundByNameException | [
"Translate",
"module",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L619-L626 |
239,686 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateSubmoduleId | protected function translateSubmoduleId($oldSubModuleId)
{
$submodule = Submodule::where('name',StudySubModule::findOrFail($oldSubModuleId)->name)->first();
if ( $submodule != null ) {
return $submodule->id;
}
throw new SubmoduleNotFoundByNameException();
} | php | protected function translateSubmoduleId($oldSubModuleId)
{
$submodule = Submodule::where('name',StudySubModule::findOrFail($oldSubModuleId)->name)->first();
if ( $submodule != null ) {
return $submodule->id;
}
throw new SubmoduleNotFoundByNameException();
} | [
"protected",
"function",
"translateSubmoduleId",
"(",
"$",
"oldSubModuleId",
")",
"{",
"$",
"submodule",
"=",
"Submodule",
"::",
"where",
"(",
"'name'",
",",
"StudySubModule",
"::",
"findOrFail",
"(",
"$",
"oldSubModuleId",
")",
"->",
"name",
")",
"->",
"first... | Translate submodule id.
@param $oldSubModuleId
@return
@throws SubmoduleNotFoundByNameException | [
"Translate",
"submodule",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L635-L642 |
239,687 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateStudyId | protected function translateStudyId($oldStudyId)
{
$study = ScoolStudy::where('name',Study::findOrFail($oldStudyId)->name)->first();
if ( $study != null ) {
return $study->id;
}
throw new StudyNotFoundByNameException();
} | php | protected function translateStudyId($oldStudyId)
{
$study = ScoolStudy::where('name',Study::findOrFail($oldStudyId)->name)->first();
if ( $study != null ) {
return $study->id;
}
throw new StudyNotFoundByNameException();
} | [
"protected",
"function",
"translateStudyId",
"(",
"$",
"oldStudyId",
")",
"{",
"$",
"study",
"=",
"ScoolStudy",
"::",
"where",
"(",
"'name'",
",",
"Study",
"::",
"findOrFail",
"(",
"$",
"oldStudyId",
")",
"->",
"name",
")",
"->",
"first",
"(",
")",
";",
... | Translate old ebre-escool study id to scool id.
@param $oldStudyId
@return mixed
@throws StudyNotFoundByNameException | [
"Translate",
"old",
"ebre",
"-",
"escool",
"study",
"id",
"to",
"scool",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L652-L659 |
239,688 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateCourseId | protected function translateCourseId($oldCourseId)
{
$course = ScoolCourse::where('name',Course::findOrFail($oldCourseId)->name)->first();
if ( $course != null ) {
return $course->id;
}
throw new CourseNotFoundByNameException();
} | php | protected function translateCourseId($oldCourseId)
{
$course = ScoolCourse::where('name',Course::findOrFail($oldCourseId)->name)->first();
if ( $course != null ) {
return $course->id;
}
throw new CourseNotFoundByNameException();
} | [
"protected",
"function",
"translateCourseId",
"(",
"$",
"oldCourseId",
")",
"{",
"$",
"course",
"=",
"ScoolCourse",
"::",
"where",
"(",
"'name'",
",",
"Course",
"::",
"findOrFail",
"(",
"$",
"oldCourseId",
")",
"->",
"name",
")",
"->",
"first",
"(",
")",
... | Translate old ebre-escool course id to scool id.
@param $oldCourseId
@return mixed
@throws CourseNotFoundByNameException | [
"Translate",
"old",
"ebre",
"-",
"escool",
"course",
"id",
"to",
"scool",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L668-L675 |
239,689 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.translateClassroomId | protected function translateClassroomId($oldClassroomId)
{
$classroom = Classroom::where('name',ClassroomGroup::findOrFail($oldClassroomId)->name)->first();
if ( $classroom != null ) {
return $classroom->id;
}
throw new ClassroomNotFoundByNameException();
} | php | protected function translateClassroomId($oldClassroomId)
{
$classroom = Classroom::where('name',ClassroomGroup::findOrFail($oldClassroomId)->name)->first();
if ( $classroom != null ) {
return $classroom->id;
}
throw new ClassroomNotFoundByNameException();
} | [
"protected",
"function",
"translateClassroomId",
"(",
"$",
"oldClassroomId",
")",
"{",
"$",
"classroom",
"=",
"Classroom",
"::",
"where",
"(",
"'name'",
",",
"ClassroomGroup",
"::",
"findOrFail",
"(",
"$",
"oldClassroomId",
")",
"->",
"name",
")",
"->",
"first... | Translate old ebre-escool classroom id to scool id.
@param $oldClassroomId
@return integer
@throws ClassroomNotFoundByNameException | [
"Translate",
"old",
"ebre",
"-",
"escool",
"classroom",
"id",
"to",
"scool",
"id",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L684-L691 |
239,690 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migratePerson | protected function migratePerson($person)
{
//TODO create person in personal data table
$user = User::firstOrNew([
'email' => $person->email,
]);
$user->name = $person->name;
$user->password = bcrypt('secret');
$user->remember_token = str_random(10);
... | php | protected function migratePerson($person)
{
//TODO create person in personal data table
$user = User::firstOrNew([
'email' => $person->email,
]);
$user->name = $person->name;
$user->password = bcrypt('secret');
$user->remember_token = str_random(10);
... | [
"protected",
"function",
"migratePerson",
"(",
"$",
"person",
")",
"{",
"//TODO create person in personal data table",
"$",
"user",
"=",
"User",
"::",
"firstOrNew",
"(",
"[",
"'email'",
"=>",
"$",
"person",
"->",
"email",
",",
"]",
")",
";",
"$",
"user",
"->... | Migrate ebre-escool person to scool person.
@param $person | [
"Migrate",
"ebre",
"-",
"escool",
"person",
"to",
"scool",
"person",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L698-L709 |
239,691 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateClassrooms | protected function migrateClassrooms()
{
$this->output->info('### Migrating classrooms ###');
foreach ($classrooms = $this->classrooms() as $classroom) {
$this->showMigratingInfo($classroom, 1);
$this->migrateClassroom($classroom);
}
$this->output->info(
... | php | protected function migrateClassrooms()
{
$this->output->info('### Migrating classrooms ###');
foreach ($classrooms = $this->classrooms() as $classroom) {
$this->showMigratingInfo($classroom, 1);
$this->migrateClassroom($classroom);
}
$this->output->info(
... | [
"protected",
"function",
"migrateClassrooms",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Migrating classrooms ###'",
")",
";",
"foreach",
"(",
"$",
"classrooms",
"=",
"$",
"this",
"->",
"classrooms",
"(",
")",
"as",
"$",
"classroom"... | Migrate classrooms. | [
"Migrate",
"classrooms",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L714-L723 |
239,692 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateLocations | protected function migrateLocations()
{
$this->output->info('### Migrating locations ###');
foreach ($this->locations() as $location) {
$this->showMigratingInfo($location, 1);
$this->migrateLocation($location);
}
$this->output->info(
'### END Migra... | php | protected function migrateLocations()
{
$this->output->info('### Migrating locations ###');
foreach ($this->locations() as $location) {
$this->showMigratingInfo($location, 1);
$this->migrateLocation($location);
}
$this->output->info(
'### END Migra... | [
"protected",
"function",
"migrateLocations",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Migrating locations ###'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"locations",
"(",
")",
"as",
"$",
"location",
")",
"{",
"$",
"this",
... | Migrate locations. | [
"Migrate",
"locations",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L728-L737 |
239,693 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateLocation | protected function migrateLocation($srcLocation) {
$location = ScoolLocation::firstOrNew([
'name' => $srcLocation->name,
]);
$location->save();
$location->shortname = $srcLocation->shortName;
$location->description = $srcLocation->description;
$location->code ... | php | protected function migrateLocation($srcLocation) {
$location = ScoolLocation::firstOrNew([
'name' => $srcLocation->name,
]);
$location->save();
$location->shortname = $srcLocation->shortName;
$location->description = $srcLocation->description;
$location->code ... | [
"protected",
"function",
"migrateLocation",
"(",
"$",
"srcLocation",
")",
"{",
"$",
"location",
"=",
"ScoolLocation",
"::",
"firstOrNew",
"(",
"[",
"'name'",
"=>",
"$",
"srcLocation",
"->",
"name",
",",
"]",
")",
";",
"$",
"location",
"->",
"save",
"(",
... | Migrate location.
@param $srcLocation | [
"Migrate",
"location",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L744-L752 |
239,694 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateClassroom | protected function migrateClassroom($srcClassroom) {
$classroom = Classroom::firstOrNew([
'name' => $srcClassroom->name,
]);
$classroom->save();
$this->addCourseToClassroom($classroom, $srcClassroom->course_id);
$classroom->shortname = $srcClassroom->shortName;
... | php | protected function migrateClassroom($srcClassroom) {
$classroom = Classroom::firstOrNew([
'name' => $srcClassroom->name,
]);
$classroom->save();
$this->addCourseToClassroom($classroom, $srcClassroom->course_id);
$classroom->shortname = $srcClassroom->shortName;
... | [
"protected",
"function",
"migrateClassroom",
"(",
"$",
"srcClassroom",
")",
"{",
"$",
"classroom",
"=",
"Classroom",
"::",
"firstOrNew",
"(",
"[",
"'name'",
"=>",
"$",
"srcClassroom",
"->",
"name",
",",
"]",
")",
";",
"$",
"classroom",
"->",
"save",
"(",
... | Migrate classroom.
@param $srcClassroom | [
"Migrate",
"classroom",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L759-L768 |
239,695 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateCurriculum | private function migrateCurriculum()
{
foreach ($this->departments() as $department) {
$this->setDepartment($department);
$this->showMigratingInfo($department,1);
$this->migrateDepartment($department);
foreach ($this->studies($department) as $study) {
... | php | private function migrateCurriculum()
{
foreach ($this->departments() as $department) {
$this->setDepartment($department);
$this->showMigratingInfo($department,1);
$this->migrateDepartment($department);
foreach ($this->studies($department) as $study) {
... | [
"private",
"function",
"migrateCurriculum",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"departments",
"(",
")",
"as",
"$",
"department",
")",
"{",
"$",
"this",
"->",
"setDepartment",
"(",
"$",
"department",
")",
";",
"$",
"this",
"->",
"showMigrat... | Migrate curriculum. | [
"Migrate",
"curriculum",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L775-L806 |
239,696 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateEnrollments | private function migrateEnrollments()
{
$this->output->info('### Migrating enrollments ###');
foreach ($this->enrollments() as $enrollment) {
if ($enrollment->person == null ) {
$this->output->error('Skipping enrolmment because no personal data');
continue... | php | private function migrateEnrollments()
{
$this->output->info('### Migrating enrollments ###');
foreach ($this->enrollments() as $enrollment) {
if ($enrollment->person == null ) {
$this->output->error('Skipping enrolmment because no personal data');
continue... | [
"private",
"function",
"migrateEnrollments",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Migrating enrollments ###'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"enrollments",
"(",
")",
"as",
"$",
"enrollment",
")",
"{",
"if",
"(... | Migrate enrollment. | [
"Migrate",
"enrollment",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L811-L824 |
239,697 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.seedDays | protected function seedDays()
{
$this->output->info('### Seeding days###');
//%u ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
$timestamp = strtotime('next Monday');
$days = array();
for ($i = 1; $i < 8; $i++) {
$days... | php | protected function seedDays()
{
$this->output->info('### Seeding days###');
//%u ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
$timestamp = strtotime('next Monday');
$days = array();
for ($i = 1; $i < 8; $i++) {
$days... | [
"protected",
"function",
"seedDays",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Seeding days###'",
")",
";",
"//%u\tISO-8601 numeric representation of the day of the week\t1 (for Monday) through 7 (for Sunday)",
"$",
"timestamp",
"=",
"strtotime",
... | Seed days of the week with ISO-8601 numeric code. | [
"Seed",
"days",
"of",
"the",
"week",
"with",
"ISO",
"-",
"8601",
"numeric",
"code",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L829-L855 |
239,698 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateTimeslots | protected function migrateTimeslots()
{
$this->output->info('### Migrating timeslots ###');
foreach ($this->timeslots() as $timeslot) {
$timeslot->showMigratingInfo($this->output,1);
$this->migrateTimeslot($timeslot);
}
$this->output->info('### END OF Migratin... | php | protected function migrateTimeslots()
{
$this->output->info('### Migrating timeslots ###');
foreach ($this->timeslots() as $timeslot) {
$timeslot->showMigratingInfo($this->output,1);
$this->migrateTimeslot($timeslot);
}
$this->output->info('### END OF Migratin... | [
"protected",
"function",
"migrateTimeslots",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Migrating timeslots ###'",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"timeslots",
"(",
")",
"as",
"$",
"timeslot",
")",
"{",
"$",
"timeslot... | Migrate timeslots. | [
"Migrate",
"timeslots",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L881-L889 |
239,699 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateLessons | protected function migrateLessons()
{
$this->output->info('### Migrating lessons ###');
if ($this->checkLessonsMigrationState()) {
foreach ($this->lessons() as $lesson) {
$lesson->showMigratingInfo($this->output,1);
$this->migrateLesson($lesson);
... | php | protected function migrateLessons()
{
$this->output->info('### Migrating lessons ###');
if ($this->checkLessonsMigrationState()) {
foreach ($this->lessons() as $lesson) {
$lesson->showMigratingInfo($this->output,1);
$this->migrateLesson($lesson);
... | [
"protected",
"function",
"migrateLessons",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'### Migrating lessons ###'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"checkLessonsMigrationState",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
... | Migrate lessons. | [
"Migrate",
"lessons",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L894-L904 |
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.