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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
201,200 | jabernardo/lollipop-php | Library/Config.php | Config.set | static public function set($key, $value) {
$config = &self::$_config;
Utils::arraySet($config, $key, $value);
} | php | static public function set($key, $value) {
$config = &self::$_config;
Utils::arraySet($config, $key, $value);
} | [
"static",
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"config",
"=",
"&",
"self",
"::",
"$",
"_config",
";",
"Utils",
"::",
"arraySet",
"(",
"$",
"config",
",",
"$",
"key",
",",
"$",
"value",
")",
";",
"}"
] | Add or set configuration key
@access public
@param string $key Configuration key
@param string $value Configuration value
@return void | [
"Add",
"or",
"set",
"configuration",
"key"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Config.php#L59-L63 |
201,201 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddTitleField | private function AddTitleField()
{
$name = 'Title';
$this->AddField(Input::Text($name, $this->page->GetTitle()));
} | php | private function AddTitleField()
{
$name = 'Title';
$this->AddField(Input::Text($name, $this->page->GetTitle()));
} | [
"private",
"function",
"AddTitleField",
"(",
")",
"{",
"$",
"name",
"=",
"'Title'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"page",
"->",
"GetTitle",
"(",
")",
")",
")",
";",
"}"
] | Adds the title field to the form | [
"Adds",
"the",
"title",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L251-L255 |
201,202 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddDescriptionField | private function AddDescriptionField()
{
$name = 'Description';
$this->AddField(Input::Text($name, $this->page->GetDescription()));
} | php | private function AddDescriptionField()
{
$name = 'Description';
$this->AddField(Input::Text($name, $this->page->GetDescription()));
} | [
"private",
"function",
"AddDescriptionField",
"(",
")",
"{",
"$",
"name",
"=",
"'Description'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"page",
"->",
"GetDescription",
"(",
")",
")",
")"... | Adds the description field to the form | [
"Adds",
"the",
"description",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L260-L264 |
201,203 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddKeywordsField | private function AddKeywordsField()
{
$name = 'Keywords';
$this->AddField(Input::Text($name, $this->page->GetKeywords()));
} | php | private function AddKeywordsField()
{
$name = 'Keywords';
$this->AddField(Input::Text($name, $this->page->GetKeywords()));
} | [
"private",
"function",
"AddKeywordsField",
"(",
")",
"{",
"$",
"name",
"=",
"'Keywords'",
";",
"$",
"this",
"->",
"AddField",
"(",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"page",
"->",
"GetKeywords",
"(",
")",
")",
")",
";",
... | Adds the keywords field to the form | [
"Adds",
"the",
"keywords",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L269-L273 |
201,204 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddLayoutField | private function AddLayoutField()
{
$name = 'Layout';
$select = new Select($name);
if ($this->page->Exists())
{
$select->SetValue($this->page->GetLayout()->GetID());
}
$select->AddOption('', Trans('Core.PleaseSelect'));
$sql = Access::SqlB... | php | private function AddLayoutField()
{
$name = 'Layout';
$select = new Select($name);
if ($this->page->Exists())
{
$select->SetValue($this->page->GetLayout()->GetID());
}
$select->AddOption('', Trans('Core.PleaseSelect'));
$sql = Access::SqlB... | [
"private",
"function",
"AddLayoutField",
"(",
")",
"{",
"$",
"name",
"=",
"'Layout'",
";",
"$",
"select",
"=",
"new",
"Select",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"this",
"->",
"page",
"->",
"Exists",
"(",
")",
")",
"{",
"$",
"select",
"... | Adds the layout field to the form | [
"Adds",
"the",
"layout",
"field",
"to",
"the",
"form"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L278-L299 |
201,205 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddMenuAccessField | private function AddMenuAccessField()
{
$name = 'MenuAccess';
$value = $this->page->Exists() ? $this->page->GetMenuAccess() : (string)MenuAccess::Authorized();
$select = new Select($name, $value);
foreach (MenuAccess::AllowedValues() as $access)
{
$select->AddOpti... | php | private function AddMenuAccessField()
{
$name = 'MenuAccess';
$value = $this->page->Exists() ? $this->page->GetMenuAccess() : (string)MenuAccess::Authorized();
$select = new Select($name, $value);
foreach (MenuAccess::AllowedValues() as $access)
{
$select->AddOpti... | [
"private",
"function",
"AddMenuAccessField",
"(",
")",
"{",
"$",
"name",
"=",
"'MenuAccess'",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"page",
"->",
"Exists",
"(",
")",
"?",
"$",
"this",
"->",
"page",
"->",
"GetMenuAccess",
"(",
")",
":",
"(",
"str... | Adds the menu access select | [
"Adds",
"the",
"menu",
"access",
"select"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L305-L316 |
201,206 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddPublishToHourField | private function AddPublishToHourField()
{
$name = 'PublishToHour';
$to = $this->page->GetPublishTo();
$field = Input::Text($name, $to ? $to->ToString('H') : '');
$field->SetHtmlAttribute('data-type', 'hour');
$this->AddField($field);
} | php | private function AddPublishToHourField()
{
$name = 'PublishToHour';
$to = $this->page->GetPublishTo();
$field = Input::Text($name, $to ? $to->ToString('H') : '');
$field->SetHtmlAttribute('data-type', 'hour');
$this->AddField($field);
} | [
"private",
"function",
"AddPublishToHourField",
"(",
")",
"{",
"$",
"name",
"=",
"'PublishToHour'",
";",
"$",
"to",
"=",
"$",
"this",
"->",
"page",
"->",
"GetPublishTo",
"(",
")",
";",
"$",
"field",
"=",
"Input",
"::",
"Text",
"(",
"$",
"name",
",",
... | Adds the publish to hour field | [
"Adds",
"the",
"publish",
"to",
"hour",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L382-L389 |
201,207 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddSitemapRelevanceField | private function AddSitemapRelevanceField()
{
$name = 'SitemapRelevance';
$value = $this->page->Exists() ? 10* $this->page->GetSitemapRelevance() : 7;
$field = new Select($name, $value);
for ($val = 0; $val <= 10; ++$val)
{
$decSep = Trans('Core.DecimalSeparator')... | php | private function AddSitemapRelevanceField()
{
$name = 'SitemapRelevance';
$value = $this->page->Exists() ? 10* $this->page->GetSitemapRelevance() : 7;
$field = new Select($name, $value);
for ($val = 0; $val <= 10; ++$val)
{
$decSep = Trans('Core.DecimalSeparator')... | [
"private",
"function",
"AddSitemapRelevanceField",
"(",
")",
"{",
"$",
"name",
"=",
"'SitemapRelevance'",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"page",
"->",
"Exists",
"(",
")",
"?",
"10",
"*",
"$",
"this",
"->",
"page",
"->",
"GetSitemapRelevance",
... | Adds the sitemap relevance field | [
"Adds",
"the",
"sitemap",
"relevance",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L404-L417 |
201,208 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AddSitemapChangeFrequencyField | private function AddSitemapChangeFrequencyField()
{
$name = 'SitemapChangeFrequency';
$value = $this->page->Exists() ? $this->page->GetSitemapChangeFrequency() :
(string)ChangeFrequency::Weekly();
$field = new Select($name, $value);
$values = ChangeFrequency::All... | php | private function AddSitemapChangeFrequencyField()
{
$name = 'SitemapChangeFrequency';
$value = $this->page->Exists() ? $this->page->GetSitemapChangeFrequency() :
(string)ChangeFrequency::Weekly();
$field = new Select($name, $value);
$values = ChangeFrequency::All... | [
"private",
"function",
"AddSitemapChangeFrequencyField",
"(",
")",
"{",
"$",
"name",
"=",
"'SitemapChangeFrequency'",
";",
"$",
"value",
"=",
"$",
"this",
"->",
"page",
"->",
"Exists",
"(",
")",
"?",
"$",
"this",
"->",
"page",
"->",
"GetSitemapChangeFrequency"... | Adds the sitemap change frequency field | [
"Adds",
"the",
"sitemap",
"change",
"frequency",
"field"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L422-L435 |
201,209 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.OnSuccess | protected function OnSuccess()
{
$prevLayout = $this->page->GetLayout();
$this->page->SetName($this->Value('Name'));
$this->page->SetUrl($this->Value('Url'));
$this->page->SetSite($this->site);
$this->page->SetTitle($this->Value('Title'));
$this->page->SetDes... | php | protected function OnSuccess()
{
$prevLayout = $this->page->GetLayout();
$this->page->SetName($this->Value('Name'));
$this->page->SetUrl($this->Value('Url'));
$this->page->SetSite($this->site);
$this->page->SetTitle($this->Value('Title'));
$this->page->SetDes... | [
"protected",
"function",
"OnSuccess",
"(",
")",
"{",
"$",
"prevLayout",
"=",
"$",
"this",
"->",
"page",
"->",
"GetLayout",
"(",
")",
";",
"$",
"this",
"->",
"page",
"->",
"SetName",
"(",
"$",
"this",
"->",
"Value",
"(",
"'Name'",
")",
")",
";",
"$"... | Saves the page | [
"Saves",
"the",
"page"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L473-L514 |
201,210 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.ReassignContents | private function ReassignContents(Layout $prevLayout, Layout $newLayout)
{
if ($prevLayout->Equals($newLayout)) {
return;
}
$oldAreas = Area::Schema()->FetchByLayout(false, $prevLayout);
foreach ($oldAreas as $oldArea)
{
$newArea = $this->Find... | php | private function ReassignContents(Layout $prevLayout, Layout $newLayout)
{
if ($prevLayout->Equals($newLayout)) {
return;
}
$oldAreas = Area::Schema()->FetchByLayout(false, $prevLayout);
foreach ($oldAreas as $oldArea)
{
$newArea = $this->Find... | [
"private",
"function",
"ReassignContents",
"(",
"Layout",
"$",
"prevLayout",
",",
"Layout",
"$",
"newLayout",
")",
"{",
"if",
"(",
"$",
"prevLayout",
"->",
"Equals",
"(",
"$",
"newLayout",
")",
")",
"{",
"return",
";",
"}",
"$",
"oldAreas",
"=",
"Area",
... | Reassigns contents by area names if layout was changed
@param Layout $prevLayout The old layout
@param Layout $newLayout The new layout | [
"Reassigns",
"contents",
"by",
"area",
"names",
"if",
"layout",
"was",
"changed"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L521-L538 |
201,211 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.SaveRights | private function SaveRights()
{
$groupID = $this->Value('UserGroup');
$userGroup = Usergroup::Schema()->ByID($groupID);
$this->page->SetUserGroup($userGroup);
if (!$userGroup)
{
$oldRights = $this->page->GetUserGroupRights();
if ($oldRights)
... | php | private function SaveRights()
{
$groupID = $this->Value('UserGroup');
$userGroup = Usergroup::Schema()->ByID($groupID);
$this->page->SetUserGroup($userGroup);
if (!$userGroup)
{
$oldRights = $this->page->GetUserGroupRights();
if ($oldRights)
... | [
"private",
"function",
"SaveRights",
"(",
")",
"{",
"$",
"groupID",
"=",
"$",
"this",
"->",
"Value",
"(",
"'UserGroup'",
")",
";",
"$",
"userGroup",
"=",
"Usergroup",
"::",
"Schema",
"(",
")",
"->",
"ByID",
"(",
"$",
"groupID",
")",
";",
"$",
"this",... | Saves the group and right settings | [
"Saves",
"the",
"group",
"and",
"right",
"settings"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L621-L641 |
201,212 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.SaveMemberGroups | private function SaveMemberGroups()
{
$selectedIDs = Request::PostArray('MemberGroup');
if ($this->page->GetGuestsOnly())
{
$selectedIDs = array();
}
$exIDs = Membergroup::GetKeyList(MembergroupUtil::PageMembergroups($this->page));
$this->DeleteOldMemberGr... | php | private function SaveMemberGroups()
{
$selectedIDs = Request::PostArray('MemberGroup');
if ($this->page->GetGuestsOnly())
{
$selectedIDs = array();
}
$exIDs = Membergroup::GetKeyList(MembergroupUtil::PageMembergroups($this->page));
$this->DeleteOldMemberGr... | [
"private",
"function",
"SaveMemberGroups",
"(",
")",
"{",
"$",
"selectedIDs",
"=",
"Request",
"::",
"PostArray",
"(",
"'MemberGroup'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"page",
"->",
"GetGuestsOnly",
"(",
")",
")",
"{",
"$",
"selectedIDs",
"=",
"ar... | Saves the member groups | [
"Saves",
"the",
"member",
"groups"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L646-L656 |
201,213 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.DeleteOldMemberGroups | private function DeleteOldMemberGroups(array $selectedIDs)
{
$sql = Access::SqlBuilder();
$tblPgGrp = PageMembergroup::Schema()->Table();
$where = $sql->Equals($tblPgGrp->Field('Page'), $sql->Value($this->page->GetID()));
if (count($selectedIDs))
{
$inSelected = $... | php | private function DeleteOldMemberGroups(array $selectedIDs)
{
$sql = Access::SqlBuilder();
$tblPgGrp = PageMembergroup::Schema()->Table();
$where = $sql->Equals($tblPgGrp->Field('Page'), $sql->Value($this->page->GetID()));
if (count($selectedIDs))
{
$inSelected = $... | [
"private",
"function",
"DeleteOldMemberGroups",
"(",
"array",
"$",
"selectedIDs",
")",
"{",
"$",
"sql",
"=",
"Access",
"::",
"SqlBuilder",
"(",
")",
";",
"$",
"tblPgGrp",
"=",
"PageMembergroup",
"::",
"Schema",
"(",
")",
"->",
"Table",
"(",
")",
";",
"$"... | Deletes the old member groups
@param array $selectedIDs The selected member ids | [
"Deletes",
"the",
"old",
"member",
"groups"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L662-L673 |
201,214 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.SaveNewMemberGroups | private function SaveNewMemberGroups(array $selectedIDs, array $exIDs)
{
foreach ($selectedIDs as $selID)
{
if (!in_array($selID, $exIDs))
{
$pgGrp = new PageMembergroup();
$pgGrp->SetPage($this->page);
$pgGrp->SetMemberGroup(ne... | php | private function SaveNewMemberGroups(array $selectedIDs, array $exIDs)
{
foreach ($selectedIDs as $selID)
{
if (!in_array($selID, $exIDs))
{
$pgGrp = new PageMembergroup();
$pgGrp->SetPage($this->page);
$pgGrp->SetMemberGroup(ne... | [
"private",
"function",
"SaveNewMemberGroups",
"(",
"array",
"$",
"selectedIDs",
",",
"array",
"$",
"exIDs",
")",
"{",
"foreach",
"(",
"$",
"selectedIDs",
"as",
"$",
"selID",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"selID",
",",
"$",
"exIDs",
")... | Saves page member groups not already assigned
@param array $selectedIDs The selected member group ids
@param array $exIDs The already assigned membergroup ids | [
"Saves",
"page",
"member",
"groups",
"not",
"already",
"assigned"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L680-L693 |
201,215 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.SaveNew | private function SaveNew()
{
$treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));
$treeBuilder->Insert($this->page, $this->parent, $this->previous);
} | php | private function SaveNew()
{
$treeBuilder = new TreeBuilder(new PageTreeProvider($this->site));
$treeBuilder->Insert($this->page, $this->parent, $this->previous);
} | [
"private",
"function",
"SaveNew",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"new",
"PageTreeProvider",
"(",
"$",
"this",
"->",
"site",
")",
")",
";",
"$",
"treeBuilder",
"->",
"Insert",
"(",
"$",
"this",
"->",
"page",
",",
"$",... | Takes care of page tree insertion important for a fresh page | [
"Takes",
"care",
"of",
"page",
"tree",
"insertion",
"important",
"for",
"a",
"fresh",
"page"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L698-L702 |
201,216 | agentmedia/phine-core | src/Core/Modules/Backend/PageForm.php | PageForm.AdjustHtaccess | private function AdjustHtaccess()
{
$file = Path::Combine(PHINE_PATH, 'Public/.htaccess');
if (!File::Exists($file))
{
throw new \Exception('HTACCESS FILE $file NOT FOUND');
}
$writer = new Writer();
$rewriter = new Rewriter($writer);
$text = File:... | php | private function AdjustHtaccess()
{
$file = Path::Combine(PHINE_PATH, 'Public/.htaccess');
if (!File::Exists($file))
{
throw new \Exception('HTACCESS FILE $file NOT FOUND');
}
$writer = new Writer();
$rewriter = new Rewriter($writer);
$text = File:... | [
"private",
"function",
"AdjustHtaccess",
"(",
")",
"{",
"$",
"file",
"=",
"Path",
"::",
"Combine",
"(",
"PHINE_PATH",
",",
"'Public/.htaccess'",
")",
";",
"if",
"(",
"!",
"File",
"::",
"Exists",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"\\",
... | Adds necessary rewrite commands | [
"Adds",
"necessary",
"rewrite",
"commands"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/PageForm.php#L707-L741 |
201,217 | kaiohken1982/NeobazaarDocumentModule | src/Document/Service/Classified.php | Classified.get | public function get($idOrDocument)
{
$modelFetcher = $this->getServiceLocator()->get('document.model.fetcher');
$this->getEventManager()->trigger(__FUNCTION__, $this, array('document' => $idOrDocument));
$classifiedModel = $modelFetcher->get($idOrDocument);
$this->getEventManager()->trigger(__FUNCTION__ . ... | php | public function get($idOrDocument)
{
$modelFetcher = $this->getServiceLocator()->get('document.model.fetcher');
$this->getEventManager()->trigger(__FUNCTION__, $this, array('document' => $idOrDocument));
$classifiedModel = $modelFetcher->get($idOrDocument);
$this->getEventManager()->trigger(__FUNCTION__ . ... | [
"public",
"function",
"get",
"(",
"$",
"idOrDocument",
")",
"{",
"$",
"modelFetcher",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'document.model.fetcher'",
")",
";",
"$",
"this",
"->",
"getEventManager",
"(",
")",
"->",
"trig... | Get a classified model
@param unknown $idOrDocument
@return Document\Model\Classified | [
"Get",
"a",
"classified",
"model"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Service/Classified.php#L82-L90 |
201,218 | kaiohken1982/NeobazaarDocumentModule | src/Document/Service/Classified.php | Classified.expired | public function expired($limit = 10)
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$em = $main->getEntityManager();
$cache = $this->getServiceLocator()->get('ClassifiedCache');
$documentRepository = $main->getDocumentEntityRepository();
$documents = $documentRepository->getExpiredE... | php | public function expired($limit = 10)
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$em = $main->getEntityManager();
$cache = $this->getServiceLocator()->get('ClassifiedCache');
$documentRepository = $main->getDocumentEntityRepository();
$documents = $documentRepository->getExpiredE... | [
"public",
"function",
"expired",
"(",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"main",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'neobazaar.service.main'",
")",
";",
"$",
"em",
"=",
"$",
"main",
"->",
"getEntityManager",
... | This service will trigger event with expired classifieds.
anything binded with these events will run
@param int $limit
@return array with document ids | [
"This",
"service",
"will",
"trigger",
"event",
"with",
"expired",
"classifieds",
".",
"anything",
"binded",
"with",
"these",
"events",
"will",
"run"
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Service/Classified.php#L99-L138 |
201,219 | kaiohken1982/NeobazaarDocumentModule | src/Document/Service/Classified.php | Classified.activationEmailResend | public function activationEmailResend($limit = 10)
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$em = $main->getEntityManager();
$cache = $this->getServiceLocator()->get('ClassifiedCache');
$documentRepository = $main->getDocumentEntityRepository();
$documents = $documentRepositor... | php | public function activationEmailResend($limit = 10)
{
$main = $this->getServiceLocator()->get('neobazaar.service.main');
$em = $main->getEntityManager();
$cache = $this->getServiceLocator()->get('ClassifiedCache');
$documentRepository = $main->getDocumentEntityRepository();
$documents = $documentRepositor... | [
"public",
"function",
"activationEmailResend",
"(",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"main",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'neobazaar.service.main'",
")",
";",
"$",
"em",
"=",
"$",
"main",
"->",
"getEnti... | This service will trigger event with classifieds that needs activetion email to be resent.
@param int $limit
@return array with document ids | [
"This",
"service",
"will",
"trigger",
"event",
"with",
"classifieds",
"that",
"needs",
"activetion",
"email",
"to",
"be",
"resent",
"."
] | edb0223878fe02e791d2a0266c5a7c0f2029e3fe | https://github.com/kaiohken1982/NeobazaarDocumentModule/blob/edb0223878fe02e791d2a0266c5a7c0f2029e3fe/src/Document/Service/Classified.php#L146-L182 |
201,220 | PenoaksDev/Milky-Framework | src/Milky/Helpers/Str.php | Str.indent | public static function indent( $lines, $cnt = 1 )
{
$new = [];
$lines = str_contains( $lines, '\r\n' ) ? explode( "\r\n", $lines ) : explode( "\n", $lines );
foreach ( $lines as $line )
$new[] = str_repeat( "\t", $cnt ) . $line;
return implode( "\n", $new );
} | php | public static function indent( $lines, $cnt = 1 )
{
$new = [];
$lines = str_contains( $lines, '\r\n' ) ? explode( "\r\n", $lines ) : explode( "\n", $lines );
foreach ( $lines as $line )
$new[] = str_repeat( "\t", $cnt ) . $line;
return implode( "\n", $new );
} | [
"public",
"static",
"function",
"indent",
"(",
"$",
"lines",
",",
"$",
"cnt",
"=",
"1",
")",
"{",
"$",
"new",
"=",
"[",
"]",
";",
"$",
"lines",
"=",
"str_contains",
"(",
"$",
"lines",
",",
"'\\r\\n'",
")",
"?",
"explode",
"(",
"\"\\r\\n\"",
",",
... | Indents each line
@param string $lines
@param int $cnt
@return string | [
"Indents",
"each",
"line"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Str.php#L1053-L1062 |
201,221 | PenoaksDev/Milky-Framework | src/Milky/Helpers/Str.php | Str.prependLines | public static function prependLines( $lines, $prepend, $prependFirstLine = false )
{
$new = [];
$lines = str_contains( $lines, '\r\n' ) ? explode( "\r\n", $lines ) : explode( "\n", $lines );
if ( !$prependFirstLine )
$new[] = $lines[0];
for ( $i = $prependFirstLine ? 0 : 1; $i < count( $lines ); $i++ )
... | php | public static function prependLines( $lines, $prepend, $prependFirstLine = false )
{
$new = [];
$lines = str_contains( $lines, '\r\n' ) ? explode( "\r\n", $lines ) : explode( "\n", $lines );
if ( !$prependFirstLine )
$new[] = $lines[0];
for ( $i = $prependFirstLine ? 0 : 1; $i < count( $lines ); $i++ )
... | [
"public",
"static",
"function",
"prependLines",
"(",
"$",
"lines",
",",
"$",
"prepend",
",",
"$",
"prependFirstLine",
"=",
"false",
")",
"{",
"$",
"new",
"=",
"[",
"]",
";",
"$",
"lines",
"=",
"str_contains",
"(",
"$",
"lines",
",",
"'\\r\\n'",
")",
... | Prepends each line
@param string $lines
@param string $prepend
$param bool $prependFirstLine
@return string | [
"Prepends",
"each",
"line"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Helpers/Str.php#L1073-L1085 |
201,222 | Subscribo/klarna-invoice-sdk-wrapped | src/Country.php | KlarnaCountry.getCode | public static function getCode($val, $alpha3 = false)
{
if (self::$_countryFlip === array()) {
self::$_countryFlip = array_flip(self::$_countries);
}
if (!array_key_exists($val, self::$_countryFlip)) {
return null;
}
$result = self::$_countryFlip[$val]... | php | public static function getCode($val, $alpha3 = false)
{
if (self::$_countryFlip === array()) {
self::$_countryFlip = array_flip(self::$_countries);
}
if (!array_key_exists($val, self::$_countryFlip)) {
return null;
}
$result = self::$_countryFlip[$val]... | [
"public",
"static",
"function",
"getCode",
"(",
"$",
"val",
",",
"$",
"alpha3",
"=",
"false",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_countryFlip",
"===",
"array",
"(",
")",
")",
"{",
"self",
"::",
"$",
"_countryFlip",
"=",
"array_flip",
"(",
"self... | Converts a KlarnaCountry constant to the respective country code.
@param int $val KlarnaCountry constant
@param bool $alpha3 Whether to return a ISO-3166-1 alpha-3 code
@return string|null | [
"Converts",
"a",
"KlarnaCountry",
"constant",
"to",
"the",
"respective",
"country",
"code",
"."
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Country.php#L117-L130 |
201,223 | Subscribo/klarna-invoice-sdk-wrapped | src/Country.php | KlarnaCountry.checkLanguage | public static function checkLanguage($country, $language)
{
switch($country) {
case KlarnaCountry::AT:
case KlarnaCountry::DE:
return ($language === KlarnaLanguage::DE);
case KlarnaCountry::NL:
return ($language === KlarnaLanguage::NL);
case KlarnaCoun... | php | public static function checkLanguage($country, $language)
{
switch($country) {
case KlarnaCountry::AT:
case KlarnaCountry::DE:
return ($language === KlarnaLanguage::DE);
case KlarnaCountry::NL:
return ($language === KlarnaLanguage::NL);
case KlarnaCoun... | [
"public",
"static",
"function",
"checkLanguage",
"(",
"$",
"country",
",",
"$",
"language",
")",
"{",
"switch",
"(",
"$",
"country",
")",
"{",
"case",
"KlarnaCountry",
"::",
"AT",
":",
"case",
"KlarnaCountry",
"::",
"DE",
":",
"return",
"(",
"$",
"langua... | Checks country against currency and returns true if they match.
@param int $country {@link KlarnaCountry}
@param int $language {@link KlarnaLanguage}
@deprecated Do not use.
@return bool | [
"Checks",
"country",
"against",
"currency",
"and",
"returns",
"true",
"if",
"they",
"match",
"."
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Country.php#L142-L162 |
201,224 | Subscribo/klarna-invoice-sdk-wrapped | src/Country.php | KlarnaCountry.checkCurrency | public static function checkCurrency($country, $currency)
{
switch($country) {
case KlarnaCountry::AT:
case KlarnaCountry::DE:
case KlarnaCountry::NL:
case KlarnaCountry::FI:
return ($currency === KlarnaCurrency::EUR);
case KlarnaCountry::DK:
r... | php | public static function checkCurrency($country, $currency)
{
switch($country) {
case KlarnaCountry::AT:
case KlarnaCountry::DE:
case KlarnaCountry::NL:
case KlarnaCountry::FI:
return ($currency === KlarnaCurrency::EUR);
case KlarnaCountry::DK:
r... | [
"public",
"static",
"function",
"checkCurrency",
"(",
"$",
"country",
",",
"$",
"currency",
")",
"{",
"switch",
"(",
"$",
"country",
")",
"{",
"case",
"KlarnaCountry",
"::",
"AT",
":",
"case",
"KlarnaCountry",
"::",
"DE",
":",
"case",
"KlarnaCountry",
"::"... | Checks country against language and returns true if they match.
@param int $country {@link KlarnaCountry}
@param int $currency {@link KlarnaCurrency}
@deprecated Do not use.
@return bool | [
"Checks",
"country",
"against",
"language",
"and",
"returns",
"true",
"if",
"they",
"match",
"."
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Country.php#L173-L191 |
201,225 | Subscribo/klarna-invoice-sdk-wrapped | src/Country.php | KlarnaCountry.getLanguage | public static function getLanguage($country)
{
switch($country) {
case KlarnaCountry::AT:
case KlarnaCountry::DE:
return KlarnaLanguage::DE;
case KlarnaCountry::NL:
return KlarnaLanguage::NL;
case KlarnaCountry::FI:
return KlarnaLanguage::F... | php | public static function getLanguage($country)
{
switch($country) {
case KlarnaCountry::AT:
case KlarnaCountry::DE:
return KlarnaLanguage::DE;
case KlarnaCountry::NL:
return KlarnaLanguage::NL;
case KlarnaCountry::FI:
return KlarnaLanguage::F... | [
"public",
"static",
"function",
"getLanguage",
"(",
"$",
"country",
")",
"{",
"switch",
"(",
"$",
"country",
")",
"{",
"case",
"KlarnaCountry",
"::",
"AT",
":",
"case",
"KlarnaCountry",
"::",
"DE",
":",
"return",
"KlarnaLanguage",
"::",
"DE",
";",
"case",
... | Get language for supplied country. Defaults to English.
@param int $country KlarnaCountry constant
@deprecated Do not use.
@return int | [
"Get",
"language",
"for",
"supplied",
"country",
".",
"Defaults",
"to",
"English",
"."
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/Country.php#L201-L220 |
201,226 | ptlis/grep-db | src/Metadata/MySQL/ColumnMetadata.php | ColumnMetadata.isStringType | public function isStringType()
{
$stringTypeList = [
'char',
'varchar',
'tinyblob',
'blob',
'mediumblob',
'longblob',
'tinytext',
'text',
'mediumtext',
'longtext'
];
$isStr... | php | public function isStringType()
{
$stringTypeList = [
'char',
'varchar',
'tinyblob',
'blob',
'mediumblob',
'longblob',
'tinytext',
'text',
'mediumtext',
'longtext'
];
$isStr... | [
"public",
"function",
"isStringType",
"(",
")",
"{",
"$",
"stringTypeList",
"=",
"[",
"'char'",
",",
"'varchar'",
",",
"'tinyblob'",
",",
"'blob'",
",",
"'mediumblob'",
",",
"'longblob'",
",",
"'tinytext'",
",",
"'text'",
",",
"'mediumtext'",
",",
"'longtext'"... | Returns true if the column is a string type.
List validated against https://dev.mysql.com/doc/refman/5.7/en/string-types.html | [
"Returns",
"true",
"if",
"the",
"column",
"is",
"a",
"string",
"type",
"."
] | 7abff68982d426690d0515ccd7adc7a2e3d72a3f | https://github.com/ptlis/grep-db/blob/7abff68982d426690d0515ccd7adc7a2e3d72a3f/src/Metadata/MySQL/ColumnMetadata.php#L106-L129 |
201,227 | Dhii/exception-helper-base | src/CreateInvalidArgumentExceptionCapableTrait.php | CreateInvalidArgumentExceptionCapableTrait._createInvalidArgumentException | protected function _createInvalidArgumentException(
$message = null,
$code = null,
RootException $previous = null,
$argument = null
) {
return new InvalidArgumentException($message, $code, $previous, $argument);
} | php | protected function _createInvalidArgumentException(
$message = null,
$code = null,
RootException $previous = null,
$argument = null
) {
return new InvalidArgumentException($message, $code, $previous, $argument);
} | [
"protected",
"function",
"_createInvalidArgumentException",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"code",
"=",
"null",
",",
"RootException",
"$",
"previous",
"=",
"null",
",",
"$",
"argument",
"=",
"null",
")",
"{",
"return",
"new",
"InvalidArgumentExcep... | Creates a new Dhii invalid argument exception.
@since [*next-version*]
@param string|Stringable|int|float|bool|null $message The message, if any.
@param int|float|string|Stringable|null $code The numeric error code, if any.
@param RootException|null $previous The inner exception, if any.
... | [
"Creates",
"a",
"new",
"Dhii",
"invalid",
"argument",
"exception",
"."
] | e97bfa6c0f79ea079e36b2f1d8f84d7566a3ccf5 | https://github.com/Dhii/exception-helper-base/blob/e97bfa6c0f79ea079e36b2f1d8f84d7566a3ccf5/src/CreateInvalidArgumentExceptionCapableTrait.php#L27-L34 |
201,228 | fulgurio/LightCMSBundle | Controller/AdminPageController.php | AdminPageController.createPage | private function createPage($page, $options, $models)
{
$request = $this->getRequest();
if ($request->getMethod() == 'POST')
{
$data = $request->get('page');
$page->setModel($data['model']);
}
$formClassName = isset($models[$page->getModel()]['back']['... | php | private function createPage($page, $options, $models)
{
$request = $this->getRequest();
if ($request->getMethod() == 'POST')
{
$data = $request->get('page');
$page->setModel($data['model']);
}
$formClassName = isset($models[$page->getModel()]['back']['... | [
"private",
"function",
"createPage",
"(",
"$",
"page",
",",
"$",
"options",
",",
"$",
"models",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"$",
"request",
"->",
"getMethod",
"(",
")",
"==",
"'POST'",
"... | Create form for page entity, use for edit or add page
@param Page $page
@param array $options
@param array $models
@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response | [
"Create",
"form",
"for",
"page",
"entity",
"use",
"for",
"edit",
"or",
"add",
"page"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminPageController.php#L131-L177 |
201,229 | fulgurio/LightCMSBundle | Controller/AdminPageController.php | AdminPageController.removeAction | public function removeAction($pageId)
{
$page = $this->getPage($pageId);
if ($page->getSlug() == '')
{
throw new AccessDeniedException();
}
$request = $this->getRequest();
if ($request->request->get('confirm') === 'yes')
{
if ($this->co... | php | public function removeAction($pageId)
{
$page = $this->getPage($pageId);
if ($page->getSlug() == '')
{
throw new AccessDeniedException();
}
$request = $this->getRequest();
if ($request->request->get('confirm') === 'yes')
{
if ($this->co... | [
"public",
"function",
"removeAction",
"(",
"$",
"pageId",
")",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"getPage",
"(",
"$",
"pageId",
")",
";",
"if",
"(",
"$",
"page",
"->",
"getSlug",
"(",
")",
"==",
"''",
")",
"{",
"throw",
"new",
"AccessDenied... | Remove page, with confirm form
@param number $pageId | [
"Remove",
"page",
"with",
"confirm",
"form"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminPageController.php#L184-L226 |
201,230 | fulgurio/LightCMSBundle | Controller/AdminPageController.php | AdminPageController.copyAction | public function copyAction($sourceId, $targetId, $lang)
{
$em = $this->getDoctrine()->getManager();
$source = $this->getPage($sourceId);
$target = $this->getPage($targetId);
$newPage = clone($source);
$newPage->setParent($target);
// Children page
if ($target-... | php | public function copyAction($sourceId, $targetId, $lang)
{
$em = $this->getDoctrine()->getManager();
$source = $this->getPage($sourceId);
$target = $this->getPage($targetId);
$newPage = clone($source);
$newPage->setParent($target);
// Children page
if ($target-... | [
"public",
"function",
"copyAction",
"(",
"$",
"sourceId",
",",
"$",
"targetId",
",",
"$",
"lang",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"source",
"=",
"$",
"this",
"->",
"getPa... | Page copy, use for multilang site
@param number $sourceId
@param number $targetId
@param string $lang
@return \Symfony\Component\HttpFoundation\Response> | [
"Page",
"copy",
"use",
"for",
"multilang",
"site"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminPageController.php#L236-L257 |
201,231 | fulgurio/LightCMSBundle | Controller/AdminPageController.php | AdminPageController.changePositionAction | public function changePositionAction()
{
$request = $this->getRequest();
if ($request->isXmlHttpRequest())
{
$em = $this->getDoctrine()->getManager();
$pageRepository = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:Page');
$page = $this->getP... | php | public function changePositionAction()
{
$request = $this->getRequest();
if ($request->isXmlHttpRequest())
{
$em = $this->getDoctrine()->getManager();
$pageRepository = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:Page');
$page = $this->getP... | [
"public",
"function",
"changePositionAction",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",... | Change page position using ajax tree
@return type
@throws AccessDeniedException | [
"Change",
"page",
"position",
"using",
"ajax",
"tree"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminPageController.php#L265-L308 |
201,232 | fulgurio/LightCMSBundle | Controller/AdminPageController.php | AdminPageController.getPageMetas | private function getPageMetas($pageId)
{
$pageMetas = array();
$metas = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMeta')->findByPage($pageId);
foreach ($metas as $meta)
{
$pageMetas[$meta->getMetaKey()] = $meta;
}
return $pageMetas;
... | php | private function getPageMetas($pageId)
{
$pageMetas = array();
$metas = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMeta')->findByPage($pageId);
foreach ($metas as $meta)
{
$pageMetas[$meta->getMetaKey()] = $meta;
}
return $pageMetas;
... | [
"private",
"function",
"getPageMetas",
"(",
"$",
"pageId",
")",
"{",
"$",
"pageMetas",
"=",
"array",
"(",
")",
";",
"$",
"metas",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getRepository",
"(",
"'FulgurioLightCMSBundle:PageMeta'",
")",
"->",
"... | Get meta data from given ID page
@param number $pageId
@return array | [
"Get",
"meta",
"data",
"from",
"given",
"ID",
"page"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Controller/AdminPageController.php#L333-L342 |
201,233 | squareproton/Bond | src/Bond/Set.php | Set.add | public function add()
{
if( !$args = func_get_args() ) {
return $this;
}
$intervals = array_map(
array($this, 'addHelper'),
$args
);
$intervals[] = $this->intervals;
$output = array();
// merge the lot
$intervals... | php | public function add()
{
if( !$args = func_get_args() ) {
return $this;
}
$intervals = array_map(
array($this, 'addHelper'),
$args
);
$intervals[] = $this->intervals;
$output = array();
// merge the lot
$intervals... | [
"public",
"function",
"add",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"args",
"=",
"func_get_args",
"(",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"intervals",
"=",
"array_map",
"(",
"array",
"(",
"$",
"this",
",",
"'addHelper'",
")",
",",
... | Variable number of argument of things we're likey to be able to make a set out of.
@param See $this->addHelper()
..
@return $this | [
"Variable",
"number",
"of",
"argument",
"of",
"things",
"we",
"re",
"likey",
"to",
"be",
"able",
"to",
"make",
"a",
"set",
"out",
"of",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L73-L133 |
201,234 | squareproton/Bond | src/Bond/Set.php | Set.contains | public function contains()
{
// build new set from passed arguments
$reflection = new \ReflectionClass( get_called_class() );
$comparing = $reflection->newInstanceArgs( func_get_args() );
// we don't have a null but the set we're comparing against has it
if( !$this->contain... | php | public function contains()
{
// build new set from passed arguments
$reflection = new \ReflectionClass( get_called_class() );
$comparing = $reflection->newInstanceArgs( func_get_args() );
// we don't have a null but the set we're comparing against has it
if( !$this->contain... | [
"public",
"function",
"contains",
"(",
")",
"{",
"// build new set from passed arguments",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"get_called_class",
"(",
")",
")",
";",
"$",
"comparing",
"=",
"$",
"reflection",
"->",
"newInstanceArgs",
"(",
... | Is a set contained within another set
@return <type> | [
"Is",
"a",
"set",
"contained",
"within",
"another",
"set"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L262-L310 |
201,235 | squareproton/Bond | src/Bond/Set.php | Set.invert | public function invert()
{
$this->containsNull = !$this->containsNull;
if( $this->intervals === array( array(null, null) ) ) {
$this->intervals = array();
return $this;
}
$output = array();
$working = array( null, null );
reset( $this->inte... | php | public function invert()
{
$this->containsNull = !$this->containsNull;
if( $this->intervals === array( array(null, null) ) ) {
$this->intervals = array();
return $this;
}
$output = array();
$working = array( null, null );
reset( $this->inte... | [
"public",
"function",
"invert",
"(",
")",
"{",
"$",
"this",
"->",
"containsNull",
"=",
"!",
"$",
"this",
"->",
"containsNull",
";",
"if",
"(",
"$",
"this",
"->",
"intervals",
"===",
"array",
"(",
"array",
"(",
"null",
",",
"null",
")",
")",
")",
"{... | Invert a set.
@return $this; | [
"Invert",
"a",
"set",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L316-L360 |
201,236 | squareproton/Bond | src/Bond/Set.php | Set.addHelper | protected function addHelper( $data )
{
// array of values
if( is_array( $data ) ) {
$originalSize = count( $data );
$data = array_filter( $data, '\Bond\is_not_null' );
// have null
if( $originalSize !== count( $data ) ) {
$this->con... | php | protected function addHelper( $data )
{
// array of values
if( is_array( $data ) ) {
$originalSize = count( $data );
$data = array_filter( $data, '\Bond\is_not_null' );
// have null
if( $originalSize !== count( $data ) ) {
$this->con... | [
"protected",
"function",
"addHelper",
"(",
"$",
"data",
")",
"{",
"// array of values",
"if",
"(",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
"$",
"originalSize",
"=",
"count",
"(",
"$",
"data",
")",
";",
"$",
"data",
"=",
"array_filter",
"(",
"$",
... | Convert something that looks like it's going to be a set castable into a array of intervals
Not nessisarily sorted
@param mixed $data
@return array Intervals | [
"Convert",
"something",
"that",
"looks",
"like",
"it",
"s",
"going",
"to",
"be",
"a",
"set",
"castable",
"into",
"a",
"array",
"of",
"intervals",
"Not",
"nessisarily",
"sorted"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L392-L432 |
201,237 | squareproton/Bond | src/Bond/Set.php | Set.parseStringToIntervals | private function parseStringToIntervals( $string )
{
if( !$length = mb_strlen( $string ) ) {
return array();
}
// The following isn't as bat shit crazy loco nutjob wtf loony as it looks.
// People need to enter literal commas, dashes and backslashes and you can't easily... | php | private function parseStringToIntervals( $string )
{
if( !$length = mb_strlen( $string ) ) {
return array();
}
// The following isn't as bat shit crazy loco nutjob wtf loony as it looks.
// People need to enter literal commas, dashes and backslashes and you can't easily... | [
"private",
"function",
"parseStringToIntervals",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"$",
"length",
"=",
"mb_strlen",
"(",
"$",
"string",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"// The following isn't as bat shit crazy loco nutjob wtf lo... | Parse the data into an array of unique values
@param string $string String represensation of a set which we're going to parse into
a valid, sorted array of intervals
@return array | [
"Parse",
"the",
"data",
"into",
"an",
"array",
"of",
"unique",
"values"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L516-L586 |
201,238 | squareproton/Bond | src/Bond/Set.php | Set.sortIntervals | private final function sortIntervals( $a, $b )
{
if( 0 !== $lowerCompare = $this->sort( $a[0], $b[0], self::NULL_IS_LOW ) ) {
return $lowerCompare;
}
return -$this->sort( $a[1], $b[1], self::NULL_IS_HIGH );
} | php | private final function sortIntervals( $a, $b )
{
if( 0 !== $lowerCompare = $this->sort( $a[0], $b[0], self::NULL_IS_LOW ) ) {
return $lowerCompare;
}
return -$this->sort( $a[1], $b[1], self::NULL_IS_HIGH );
} | [
"private",
"final",
"function",
"sortIntervals",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"if",
"(",
"0",
"!==",
"$",
"lowerCompare",
"=",
"$",
"this",
"->",
"sort",
"(",
"$",
"a",
"[",
"0",
"]",
",",
"$",
"b",
"[",
"0",
"]",
",",
"self",
"::"... | Sort two intervals
@param array $a
@param array $b
@return -1,0,1 | [
"Sort",
"two",
"intervals"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L631-L637 |
201,239 | squareproton/Bond | src/Bond/Set.php | Set.max | protected function max( $a, $b, $handleNull )
{
return $this->sort( $a, $b, $handleNull ) > 0 ? $a : $b;
} | php | protected function max( $a, $b, $handleNull )
{
return $this->sort( $a, $b, $handleNull ) > 0 ? $a : $b;
} | [
"protected",
"function",
"max",
"(",
"$",
"a",
",",
"$",
"b",
",",
"$",
"handleNull",
")",
"{",
"return",
"$",
"this",
"->",
"sort",
"(",
"$",
"a",
",",
"$",
"b",
",",
"$",
"handleNull",
")",
">",
"0",
"?",
"$",
"a",
":",
"$",
"b",
";",
"}"... | Return the max of two things
@param mixed $a
@param mixed $b
@param mixed $handleNull Is null treated as a high value or a low value. See, self::NULL_IS_HIGH
@return mixed | [
"Return",
"the",
"max",
"of",
"two",
"things"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L665-L668 |
201,240 | squareproton/Bond | src/Bond/Set.php | Set.min | protected function min( $a, $b, $handleNull )
{
return $this->sort( $a, $b, $handleNull ) > 0 ? $b : $a;
} | php | protected function min( $a, $b, $handleNull )
{
return $this->sort( $a, $b, $handleNull ) > 0 ? $b : $a;
} | [
"protected",
"function",
"min",
"(",
"$",
"a",
",",
"$",
"b",
",",
"$",
"handleNull",
")",
"{",
"return",
"$",
"this",
"->",
"sort",
"(",
"$",
"a",
",",
"$",
"b",
",",
"$",
"handleNull",
")",
">",
"0",
"?",
"$",
"b",
":",
"$",
"a",
";",
"}"... | Return the min of two things.
@param mixed $a
@param mixed $b
@param mixed $handleNull Is null treated as a high value or a low value. See, self::NULL_IS_HIGH
@return mixed | [
"Return",
"the",
"min",
"of",
"two",
"things",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L677-L680 |
201,241 | squareproton/Bond | src/Bond/Set.php | Set.escape | public static function escape( $value, $escapeNull = true )
{
if( $value === null ) {
return $escapeNull ? self::ESCAPE_CHARACTER . self::NULL_CHARACTER : '';
}
$value = str_replace( self::ESCAPE_CHARACTER, self::ESCAPE_CHARACTER . self::ESCAPE_CHARACTER, $value );
$val... | php | public static function escape( $value, $escapeNull = true )
{
if( $value === null ) {
return $escapeNull ? self::ESCAPE_CHARACTER . self::NULL_CHARACTER : '';
}
$value = str_replace( self::ESCAPE_CHARACTER, self::ESCAPE_CHARACTER . self::ESCAPE_CHARACTER, $value );
$val... | [
"public",
"static",
"function",
"escape",
"(",
"$",
"value",
",",
"$",
"escapeNull",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
"$",
"escapeNull",
"?",
"self",
"::",
"ESCAPE_CHARACTER",
".",
"self",
"::",
"NULL_C... | Escape a interval fragments
@param scalar $value
@return string | [
"Escape",
"a",
"interval",
"fragments"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Set.php#L718-L731 |
201,242 | TuumPHP/Router | src/ReverseRoute.php | ReverseRoute.prepare | public function prepare()
{
$this->preparedRoutes = true;
foreach($this->routers as $router) {
$this->prepareRoutes($router->routes);
}
} | php | public function prepare()
{
$this->preparedRoutes = true;
foreach($this->routers as $router) {
$this->prepareRoutes($router->routes);
}
} | [
"public",
"function",
"prepare",
"(",
")",
"{",
"$",
"this",
"->",
"preparedRoutes",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"routers",
"as",
"$",
"router",
")",
"{",
"$",
"this",
"->",
"prepareRoutes",
"(",
"$",
"router",
"->",
"routes",
... | prepares reverse routes from added routers. | [
"prepares",
"reverse",
"routes",
"from",
"added",
"routers",
"."
] | 781e40b387fd1c7deb8175ccddd758a10e2cd0bd | https://github.com/TuumPHP/Router/blob/781e40b387fd1c7deb8175ccddd758a10e2cd0bd/src/ReverseRoute.php#L44-L50 |
201,243 | congraphcms/core | Traits/MapperTrait.php | MapperTrait.maps | public static function maps(array $mappings, $key = 'default')
{
self::$mappings = array_merge_recursive(self::$mappings, [ $key => $mappings ]);
} | php | public static function maps(array $mappings, $key = 'default')
{
self::$mappings = array_merge_recursive(self::$mappings, [ $key => $mappings ]);
} | [
"public",
"static",
"function",
"maps",
"(",
"array",
"$",
"mappings",
",",
"$",
"key",
"=",
"'default'",
")",
"{",
"self",
"::",
"$",
"mappings",
"=",
"array_merge_recursive",
"(",
"self",
"::",
"$",
"mappings",
",",
"[",
"$",
"key",
"=>",
"$",
"mappi... | Register mappings.
@param array $mappings
@return void | [
"Register",
"mappings",
"."
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/MapperTrait.php#L58-L61 |
201,244 | congraphcms/core | Traits/MapperTrait.php | MapperTrait.getMappings | public static function getMappings($resource, $key = 'default')
{
$resourceName = $resource;
if( is_object($resource) )
{
$resourceName = get_class($resource);
}
$mappings = [];
if( isset(self::$mappers[$key]) )
{
$mappings = array_merge_recursive( $mappings, call_user_func(self::$mappers[$key], ... | php | public static function getMappings($resource, $key = 'default')
{
$resourceName = $resource;
if( is_object($resource) )
{
$resourceName = get_class($resource);
}
$mappings = [];
if( isset(self::$mappers[$key]) )
{
$mappings = array_merge_recursive( $mappings, call_user_func(self::$mappers[$key], ... | [
"public",
"static",
"function",
"getMappings",
"(",
"$",
"resource",
",",
"$",
"key",
"=",
"'default'",
")",
"{",
"$",
"resourceName",
"=",
"$",
"resource",
";",
"if",
"(",
"is_object",
"(",
"$",
"resource",
")",
")",
"{",
"$",
"resourceName",
"=",
"ge... | Get mappings for the resource.
@param mixed $command
@return string | [
"Get",
"mappings",
"for",
"the",
"resource",
"."
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/MapperTrait.php#L80-L101 |
201,245 | congraphcms/core | Traits/MapperTrait.php | MapperTrait.resolveMapping | public function resolveMapping($resource, $parameters = [], $key = 'default', $method = null)
{
$resourceName = $resource;
if( is_object($resource) )
{
$resourceName = get_class($resource);
}
$mappings = $this->getMappings($resourceName, $key);
if(empty($mappings))
{
throw new Exception('No reso... | php | public function resolveMapping($resource, $parameters = [], $key = 'default', $method = null)
{
$resourceName = $resource;
if( is_object($resource) )
{
$resourceName = get_class($resource);
}
$mappings = $this->getMappings($resourceName, $key);
if(empty($mappings))
{
throw new Exception('No reso... | [
"public",
"function",
"resolveMapping",
"(",
"$",
"resource",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"key",
"=",
"'default'",
",",
"$",
"method",
"=",
"null",
")",
"{",
"$",
"resourceName",
"=",
"$",
"resource",
";",
"if",
"(",
"is_object",
... | Resolve mapping end return result
@param mixed $resource - mapping name to be resolved
@param array $parameters - params for resolver
@param string $key - mapping section
@throws Exception
@return mixed | [
"Resolve",
"mapping",
"end",
"return",
"result"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/MapperTrait.php#L114-L138 |
201,246 | congraphcms/core | Traits/MapperTrait.php | MapperTrait.runResolver | public function runResolver($resolver, $parameters = [], $method = null)
{
if (is_callable($resolver))
{
return call_user_func_array($resolver, $parameters);
}
if(class_exists($resolver))
{
$instance = $this->container->make($resolver, $parameters);
if($instance ... | php | public function runResolver($resolver, $parameters = [], $method = null)
{
if (is_callable($resolver))
{
return call_user_func_array($resolver, $parameters);
}
if(class_exists($resolver))
{
$instance = $this->container->make($resolver, $parameters);
if($instance ... | [
"public",
"function",
"runResolver",
"(",
"$",
"resolver",
",",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"method",
"=",
"null",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"resolver",
")",
")",
"{",
"return",
"call_user_func_array",
"(",
"$",
"res... | Handle and run the resolver
@param mixed $resolver
@param array $parameters - params for resolver
@return mixed | [
"Handle",
"and",
"run",
"the",
"resolver"
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Traits/MapperTrait.php#L148-L181 |
201,247 | Soneritics/Buckaroo | Soneritics/Buckaroo/ServiceOperations/TransactionRequest.php | TransactionRequest.getPostFields | public function getPostFields()
{
$this->validate();
$mappedFields = $this->getMappedFields();
$this->paymentMethod->addAdditionalFields($mappedFields);
return $mappedFields;
} | php | public function getPostFields()
{
$this->validate();
$mappedFields = $this->getMappedFields();
$this->paymentMethod->addAdditionalFields($mappedFields);
return $mappedFields;
} | [
"public",
"function",
"getPostFields",
"(",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"$",
"mappedFields",
"=",
"$",
"this",
"->",
"getMappedFields",
"(",
")",
";",
"$",
"this",
"->",
"paymentMethod",
"->",
"addAdditionalFields",
"(",
"$",
... | Get the post fields for the requests.
@return array | [
"Get",
"the",
"post",
"fields",
"for",
"the",
"requests",
"."
] | cb345dce9b96c996e47121d6145a7e314943c8f1 | https://github.com/Soneritics/Buckaroo/blob/cb345dce9b96c996e47121d6145a7e314943c8f1/Soneritics/Buckaroo/ServiceOperations/TransactionRequest.php#L93-L99 |
201,248 | RSQueue/RSQueue | src/RSQueue/RedisFactory.php | RedisFactory.createSimple | private function createSimple(): Redis
{
$redis = new Redis();
$redis->connect($this->config['host'], (int) $this->config['port']);
$redis->setOption(Redis::OPT_READ_TIMEOUT, '-1');
if ($this->config['database']) {
$redis->select($this->config['database']);
}
... | php | private function createSimple(): Redis
{
$redis = new Redis();
$redis->connect($this->config['host'], (int) $this->config['port']);
$redis->setOption(Redis::OPT_READ_TIMEOUT, '-1');
if ($this->config['database']) {
$redis->select($this->config['database']);
}
... | [
"private",
"function",
"createSimple",
"(",
")",
":",
"Redis",
"{",
"$",
"redis",
"=",
"new",
"Redis",
"(",
")",
";",
"$",
"redis",
"->",
"connect",
"(",
"$",
"this",
"->",
"config",
"[",
"'host'",
"]",
",",
"(",
"int",
")",
"$",
"this",
"->",
"c... | Create single redis.
@return Redis | [
"Create",
"single",
"redis",
"."
] | 1a8d72a2b025ed65684644febf9493d4f6ac9333 | https://github.com/RSQueue/RSQueue/blob/1a8d72a2b025ed65684644febf9493d4f6ac9333/src/RSQueue/RedisFactory.php#L74-L84 |
201,249 | zicht/tinymce-bundle | src/Zicht/Bundle/TinymceBundle/Twig/Extension/ZichtTinymceExtension.php | ZichtTinymceExtension.getAssetsUrl | protected function getAssetsUrl($inputUrl)
{
/** @var $assets \Symfony\Component\Templating\Helper\CoreAssetsHelper */
$assets = $this->getService('assets.packages');
$url = preg_replace('/^asset\[(.+)\]$/i', '$1', $inputUrl);
if ($inputUrl !== $url) {
return $assets->g... | php | protected function getAssetsUrl($inputUrl)
{
/** @var $assets \Symfony\Component\Templating\Helper\CoreAssetsHelper */
$assets = $this->getService('assets.packages');
$url = preg_replace('/^asset\[(.+)\]$/i', '$1', $inputUrl);
if ($inputUrl !== $url) {
return $assets->g... | [
"protected",
"function",
"getAssetsUrl",
"(",
"$",
"inputUrl",
")",
"{",
"/** @var $assets \\Symfony\\Component\\Templating\\Helper\\CoreAssetsHelper */",
"$",
"assets",
"=",
"$",
"this",
"->",
"getService",
"(",
"'assets.packages'",
")",
";",
"$",
"url",
"=",
"preg_rep... | Get url from config string
@param string $inputUrl
@return string | [
"Get",
"url",
"from",
"config",
"string"
] | 43d2eb4eb3f7f0e4752fb496f4aada6f2d805c96 | https://github.com/zicht/tinymce-bundle/blob/43d2eb4eb3f7f0e4752fb496f4aada6f2d805c96/src/Zicht/Bundle/TinymceBundle/Twig/Extension/ZichtTinymceExtension.php#L211-L223 |
201,250 | Wedeto/DB | src/DAO.php | DAO.getSelector | public function getSelector($pkey, array $record)
{
if ($pkey !== null && !is_array($pkey))
throw new InvalidTypeException("Invalid primary key: " . WF::str($pkey));
// When no primary key is available, we match on all fields
$is_primary_key = true;
if ($pkey === null)
... | php | public function getSelector($pkey, array $record)
{
if ($pkey !== null && !is_array($pkey))
throw new InvalidTypeException("Invalid primary key: " . WF::str($pkey));
// When no primary key is available, we match on all fields
$is_primary_key = true;
if ($pkey === null)
... | [
"public",
"function",
"getSelector",
"(",
"$",
"pkey",
",",
"array",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"pkey",
"!==",
"null",
"&&",
"!",
"is_array",
"(",
"$",
"pkey",
")",
")",
"throw",
"new",
"InvalidTypeException",
"(",
"\"Invalid primary key: \""... | Form a condition that matches the record using the values in the provided record.
@param array $pkey The column names in the primary key
@param array $record The record to match | [
"Form",
"a",
"condition",
"that",
"matches",
"the",
"record",
"using",
"the",
"values",
"in",
"the",
"provided",
"record",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L131-L162 |
201,251 | Wedeto/DB | src/DAO.php | DAO.save | public function save(Model $model)
{
$database = $model->getSourceDB();
$pkey = $model->getID();
if ($database === null || $database !== $this->db)
$this->insert($model);
else
$this->update($model);
return $this;
} | php | public function save(Model $model)
{
$database = $model->getSourceDB();
$pkey = $model->getID();
if ($database === null || $database !== $this->db)
$this->insert($model);
else
$this->update($model);
return $this;
} | [
"public",
"function",
"save",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"database",
"=",
"$",
"model",
"->",
"getSourceDB",
"(",
")",
";",
"$",
"pkey",
"=",
"$",
"model",
"->",
"getID",
"(",
")",
";",
"if",
"(",
"$",
"database",
"===",
"null",
"... | Save the current record to the database.
@param Wedeto\DB\Model $model The model instance to save.
If the model does not have a source
database, it is inserted, otherwise
an update is executed.
@return Wedeto\DB\DAO Provides fluent interface | [
"Save",
"the",
"current",
"record",
"to",
"the",
"database",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L173-L184 |
201,252 | Wedeto/DB | src/DAO.php | DAO.getByID | public function getByID($id)
{
$pkey = $this->getPrimaryKey();
if ($pkey === null)
throw new DAOException("A primary key is required to select a record by ID");
// If there's a unary primary key, the value can be specified as a
// single scalar, rather than an array
... | php | public function getByID($id)
{
$pkey = $this->getPrimaryKey();
if ($pkey === null)
throw new DAOException("A primary key is required to select a record by ID");
// If there's a unary primary key, the value can be specified as a
// single scalar, rather than an array
... | [
"public",
"function",
"getByID",
"(",
"$",
"id",
")",
"{",
"$",
"pkey",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"if",
"(",
"$",
"pkey",
"===",
"null",
")",
"throw",
"new",
"DAOException",
"(",
"\"A primary key is required to select a record b... | Load the record from the database
@param mixed $id The record to load, indicating the primary key. The
type should match the primary key: scalar for unary
primary keys, associative array for combined primary
keys. | [
"Load",
"the",
"record",
"from",
"the",
"database"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L193-L214 |
201,253 | Wedeto/DB | src/DAO.php | DAO.get | public function get(...$args)
{
$record = $this->fetchSingle($args);
if (!$record)
return null;
$obj = new $this->model_class;
$obj->assignRecord($record, $this->db);
return $obj;
} | php | public function get(...$args)
{
$record = $this->fetchSingle($args);
if (!$record)
return null;
$obj = new $this->model_class;
$obj->assignRecord($record, $this->db);
return $obj;
} | [
"public",
"function",
"get",
"(",
"...",
"$",
"args",
")",
"{",
"$",
"record",
"=",
"$",
"this",
"->",
"fetchSingle",
"(",
"$",
"args",
")",
";",
"if",
"(",
"!",
"$",
"record",
")",
"return",
"null",
";",
"$",
"obj",
"=",
"new",
"$",
"this",
"-... | Retrieve a single record based on a provided query
@param args The provided arguments for the select query.
@return Model The fetch model
@see Wedeto\DB\DAO::select | [
"Retrieve",
"a",
"single",
"record",
"based",
"on",
"a",
"provided",
"query"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L222-L230 |
201,254 | Wedeto/DB | src/DAO.php | DAO.getAll | public function getAll(...$args)
{
$pkey = $this->getPrimaryKey();
if (count($pkey) === 1)
{
reset($pkey);
$pkey_as_index = key($pkey);
}
else
$pkey_as_index = false;
$list = array();
$records = $this->fetchAll($args);
... | php | public function getAll(...$args)
{
$pkey = $this->getPrimaryKey();
if (count($pkey) === 1)
{
reset($pkey);
$pkey_as_index = key($pkey);
}
else
$pkey_as_index = false;
$list = array();
$records = $this->fetchAll($args);
... | [
"public",
"function",
"getAll",
"(",
"...",
"$",
"args",
")",
"{",
"$",
"pkey",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"pkey",
")",
"===",
"1",
")",
"{",
"reset",
"(",
"$",
"pkey",
")",
";",
"$",
... | Retrieve a set of records, create object from them and return the resulting list.
@param $args The provided arguments for the select query.
@return array The retrieved DAO objects. If the primary key is a single field, the indices correspond to the primary key
@see Wedeto\DB\DAO::select | [
"Retrieve",
"a",
"set",
"of",
"records",
"create",
"object",
"from",
"them",
"and",
"return",
"the",
"resulting",
"list",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L238-L263 |
201,255 | Wedeto/DB | src/DAO.php | DAO.fetchSingle | public function fetchSingle(...$args)
{
$args[] = QB::limit(1);
$select = $this->select($args);
return $select->fetch();
} | php | public function fetchSingle(...$args)
{
$args[] = QB::limit(1);
$select = $this->select($args);
return $select->fetch();
} | [
"public",
"function",
"fetchSingle",
"(",
"...",
"$",
"args",
")",
"{",
"$",
"args",
"[",
"]",
"=",
"QB",
"::",
"limit",
"(",
"1",
")",
";",
"$",
"select",
"=",
"$",
"this",
"->",
"select",
"(",
"$",
"args",
")",
";",
"return",
"$",
"select",
"... | Execute a query, retrieve the first record and return it.
@param $args The provided arguments for the select query.
@return array The retrieved record
@see Wedeto\DB\DAO::select | [
"Execute",
"a",
"query",
"retrieve",
"the",
"first",
"record",
"and",
"return",
"it",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L272-L277 |
201,256 | Wedeto/DB | src/DAO.php | DAO.select | public function select(...$args)
{
$args = WF::flatten_array($args);
$select = new Query\Select;
$select->add(new Query\SourceTableClause($this->tablename));
$cols = $this->getColumns();
foreach ($cols as $name => $def)
$select->add(new Query\GetClause($name));
... | php | public function select(...$args)
{
$args = WF::flatten_array($args);
$select = new Query\Select;
$select->add(new Query\SourceTableClause($this->tablename));
$cols = $this->getColumns();
foreach ($cols as $name => $def)
$select->add(new Query\GetClause($name));
... | [
"public",
"function",
"select",
"(",
"...",
"$",
"args",
")",
"{",
"$",
"args",
"=",
"WF",
"::",
"flatten_array",
"(",
"$",
"args",
")",
";",
"$",
"select",
"=",
"new",
"Query",
"\\",
"Select",
";",
"$",
"select",
"->",
"add",
"(",
"new",
"Query",
... | Select one or more records from the database.
@param $args The provided arguments should contain query parts passed to the
Select constructor. These can be objects such as:
FieldName, JoinClause, WhereClause, OrderClause, LimitClause,
OffsetClause. A Wedeto\DB\DB object can also be passed in to
use as a Database.
@ret... | [
"Select",
"one",
"or",
"more",
"records",
"from",
"the",
"database",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L303-L317 |
201,257 | Wedeto/DB | src/DAO.php | DAO.update | public function update($id, array $record = null)
{
$model = is_a($id, $this->model_class) ? $id : null;
if (null !== $model)
{
if ($record !== null)
throw new DAOException("You should not pass an array of updates when supplying a Model");
if ($id->ge... | php | public function update($id, array $record = null)
{
$model = is_a($id, $this->model_class) ? $id : null;
if (null !== $model)
{
if ($record !== null)
throw new DAOException("You should not pass an array of updates when supplying a Model");
if ($id->ge... | [
"public",
"function",
"update",
"(",
"$",
"id",
",",
"array",
"$",
"record",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"is_a",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"model_class",
")",
"?",
"$",
"id",
":",
"null",
";",
"if",
"(",
"null",
"!==... | Update records in the database.
@param mixed $id The values for the primary key to select the record to update. You can also supply
an instance of the accompanying Model class.
@param array $record The record to update. Should contain key/value pairs where
keys are fieldnames, values are the values to update them to.
... | [
"Update",
"records",
"in",
"the",
"database",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L331-L393 |
201,258 | Wedeto/DB | src/DAO.php | DAO.delete | public function delete($where)
{
$is_model = is_a($where, $this->model_class);
if (!$is_model && !is_a($where, Query\WhereClause::class))
throw new InvalidTypeException("Must provide a WhereClause or an instance of {$this->model_class} to delete");
$modelInstance = null;
... | php | public function delete($where)
{
$is_model = is_a($where, $this->model_class);
if (!$is_model && !is_a($where, Query\WhereClause::class))
throw new InvalidTypeException("Must provide a WhereClause or an instance of {$this->model_class} to delete");
$modelInstance = null;
... | [
"public",
"function",
"delete",
"(",
"$",
"where",
")",
"{",
"$",
"is_model",
"=",
"is_a",
"(",
"$",
"where",
",",
"$",
"this",
"->",
"model_class",
")",
";",
"if",
"(",
"!",
"$",
"is_model",
"&&",
"!",
"is_a",
"(",
"$",
"where",
",",
"Query",
"\... | Delete records from the database.
@param Wedeto\DB\Query\WhereClause Specifies which records to delete. You can use
Wedeto\DB\Query\Builder to create it, or provide a
string that will be interpreted as custom SQL. A third
option is to provide an associative array where keys
indicate field names and values their
values... | [
"Delete",
"records",
"from",
"the",
"database",
"."
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/DAO.php#L475-L500 |
201,259 | JumpGateio/Core | src/JumpGate/Core/Services/Response.php | Response.route | public function route($name, $details = [])
{
$this->route = route($name, $details);
$this->routeName = $name;
return $this;
} | php | public function route($name, $details = [])
{
$this->route = route($name, $details);
$this->routeName = $name;
return $this;
} | [
"public",
"function",
"route",
"(",
"$",
"name",
",",
"$",
"details",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"route",
"=",
"route",
"(",
"$",
"name",
",",
"$",
"details",
")",
";",
"$",
"this",
"->",
"routeName",
"=",
"$",
"name",
";",
"re... | Add a route to redirect the request to.
@param string $name
@param array $details
@return $this | [
"Add",
"a",
"route",
"to",
"redirect",
"the",
"request",
"to",
"."
] | 485b5cf03b3072267bffbee428b81e48d407d6b6 | https://github.com/JumpGateio/Core/blob/485b5cf03b3072267bffbee428b81e48d407d6b6/src/JumpGate/Core/Services/Response.php#L71-L77 |
201,260 | JumpGateio/Core | src/JumpGate/Core/Services/Response.php | Response.redirectIntended | public function redirectIntended()
{
// Make sure we have a route.
if (is_null($this->route)) {
throw new \Exception('No route has been provided. Please use route() to add one.');
}
// If this response passed, show the success message.
if ($this->success) {
... | php | public function redirectIntended()
{
// Make sure we have a route.
if (is_null($this->route)) {
throw new \Exception('No route has been provided. Please use route() to add one.');
}
// If this response passed, show the success message.
if ($this->success) {
... | [
"public",
"function",
"redirectIntended",
"(",
")",
"{",
"// Make sure we have a route.",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"route",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'No route has been provided. Please use route() to add one.'",
")"... | Redirect the request to the intended route or the provided one.
@return \Illuminate\Http\RedirectResponse
@throws \Exception | [
"Redirect",
"the",
"request",
"to",
"the",
"intended",
"route",
"or",
"the",
"provided",
"one",
"."
] | 485b5cf03b3072267bffbee428b81e48d407d6b6 | https://github.com/JumpGateio/Core/blob/485b5cf03b3072267bffbee428b81e48d407d6b6/src/JumpGate/Core/Services/Response.php#L109-L126 |
201,261 | lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/Traits/Persist.php | Persist.associateRelatedRecordsToNewRecord | public function associateRelatedRecordsToNewRecord($modelInstance, $associatedRecords, $relatedNamespace, $relatedModelClass)
{
// Check if there are any records to insert into the pivot table
if (count($associatedRecords) > 0)
{
// What is the namespace.class of the related tabl... | php | public function associateRelatedRecordsToNewRecord($modelInstance, $associatedRecords, $relatedNamespace, $relatedModelClass)
{
// Check if there are any records to insert into the pivot table
if (count($associatedRecords) > 0)
{
// What is the namespace.class of the related tabl... | [
"public",
"function",
"associateRelatedRecordsToNewRecord",
"(",
"$",
"modelInstance",
",",
"$",
"associatedRecords",
",",
"$",
"relatedNamespace",
",",
"$",
"relatedModelClass",
")",
"{",
"// Check if there are any records to insert into the pivot table",
"if",
"(",
"count",... | Associate each related record with the record just created
@param object $modelInstance object just created
@param array $associatedRecords array of id's associated with the record just created
@param string $relatedNamespace Namespace of the associated model
@param string $relatedModelClas... | [
"Associate",
"each",
"related",
"record",
"with",
"the",
"record",
"just",
"created"
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/Traits/Persist.php#L194-L225 |
201,262 | lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/Traits/Persist.php | Persist.associateRelatedRecordsToUpdatedRecord | public function associateRelatedRecordsToUpdatedRecord($modelInstance, $associatedRecords, $relatedModelClass)
{
// Check if there are any records to sync with the pivot table
if (count($associatedRecords) > 0)
{
// There's probably a function for this, but for now:
/... | php | public function associateRelatedRecordsToUpdatedRecord($modelInstance, $associatedRecords, $relatedModelClass)
{
// Check if there are any records to sync with the pivot table
if (count($associatedRecords) > 0)
{
// There's probably a function for this, but for now:
/... | [
"public",
"function",
"associateRelatedRecordsToUpdatedRecord",
"(",
"$",
"modelInstance",
",",
"$",
"associatedRecords",
",",
"$",
"relatedModelClass",
")",
"{",
"// Check if there are any records to sync with the pivot table",
"if",
"(",
"count",
"(",
"$",
"associatedRecord... | Associate each related record with the record just updated.
@param object $modelInstance object just updated
@param array $associatedRecords array of id's associated with the record just updated
@param string $relatedNamespace Namespace of the associated model
@param string $relatedModelCla... | [
"Associate",
"each",
"related",
"record",
"with",
"the",
"record",
"just",
"updated",
"."
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/Traits/Persist.php#L350-L373 |
201,263 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.get | public function get($idOrKey, array $fields = null)
{
$parameters = $fields ?
sprintf(
'?%s',
$this->createUriParameters(
['fields' => implode(',', $fields)]
)
)
: ''
;
return $this->getR... | php | public function get($idOrKey, array $fields = null)
{
$parameters = $fields ?
sprintf(
'?%s',
$this->createUriParameters(
['fields' => implode(',', $fields)]
)
)
: ''
;
return $this->getR... | [
"public",
"function",
"get",
"(",
"$",
"idOrKey",
",",
"array",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"$",
"fields",
"?",
"sprintf",
"(",
"'?%s'",
",",
"$",
"this",
"->",
"createUriParameters",
"(",
"[",
"'fields'",
"=>",
"implo... | Returns issue by id or key.
@link https://docs.atlassian.com/jira/REST/latest/#d2e1375
@param integer|string $idOrKey
@param array $fields array of fields to be returns (return all by default)
@return \GuzzleHttp\Message\Response | [
"Returns",
"issue",
"by",
"id",
"or",
"key",
"."
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L28-L41 |
201,264 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.delete | public function delete($idOrKey, $deleteSubtasks = false)
{
$parameters = sprintf('?deleteSubtasks=%s', $deleteSubtasks);
return $this->deleteRequest(sprintf('issue/%s%s', $idOrKey, $parameters));
} | php | public function delete($idOrKey, $deleteSubtasks = false)
{
$parameters = sprintf('?deleteSubtasks=%s', $deleteSubtasks);
return $this->deleteRequest(sprintf('issue/%s%s', $idOrKey, $parameters));
} | [
"public",
"function",
"delete",
"(",
"$",
"idOrKey",
",",
"$",
"deleteSubtasks",
"=",
"false",
")",
"{",
"$",
"parameters",
"=",
"sprintf",
"(",
"'?deleteSubtasks=%s'",
",",
"$",
"deleteSubtasks",
")",
";",
"return",
"$",
"this",
"->",
"deleteRequest",
"(",
... | Deletes an issue by id or key
@link https://docs.atlassian.com/jira/REST/latest/#d2e1401
@param integer|string $idOrKey
@param boolean $deleteSubtasks
@return \GuzzleHttp\Message\Response | [
"Deletes",
"an",
"issue",
"by",
"id",
"or",
"key"
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L67-L72 |
201,265 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.createAttachment | public function createAttachment($idOrKey, $fileHandle)
{
if (gettype($fileHandle) != 'resource') {
throw new \RuntimeException(sprintf('createAttachment() expects parameter 2 to be resource, %s given', gettype($fileHandle)));
}
return $this->postFile(sprintf('issue/%s/attachmen... | php | public function createAttachment($idOrKey, $fileHandle)
{
if (gettype($fileHandle) != 'resource') {
throw new \RuntimeException(sprintf('createAttachment() expects parameter 2 to be resource, %s given', gettype($fileHandle)));
}
return $this->postFile(sprintf('issue/%s/attachmen... | [
"public",
"function",
"createAttachment",
"(",
"$",
"idOrKey",
",",
"$",
"fileHandle",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"fileHandle",
")",
"!=",
"'resource'",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'createAttachmen... | Create issue attachment by its id or key
@link https://docs.atlassian.com/jira/REST/latest/#d2e1228
@param integer|string $idOrKey
@param array $data
@return \GuzzleHttp\Message\Response | [
"Create",
"issue",
"attachment",
"by",
"its",
"id",
"or",
"key"
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L99-L106 |
201,266 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.updateComment | public function updateComment($idOrKey, $commentId, array $data)
{
return $this->putRequest(sprintf('issue/%s/comment/%s', $idOrKey, $commentId), $data);
} | php | public function updateComment($idOrKey, $commentId, array $data)
{
return $this->putRequest(sprintf('issue/%s/comment/%s', $idOrKey, $commentId), $data);
} | [
"public",
"function",
"updateComment",
"(",
"$",
"idOrKey",
",",
"$",
"commentId",
",",
"array",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"putRequest",
"(",
"sprintf",
"(",
"'issue/%s/comment/%s'",
",",
"$",
"idOrKey",
",",
"$",
"commentId",
")"... | Updates a comment by issue id or key, comment id with given data
@link https://docs.atlassian.com/jira/REST/latest/#d2e1221
@param integer|string $idOrKey
@param integer $commentId
@param array $data
@return \GuzzleHttp\Message\Response | [
"Updates",
"a",
"comment",
"by",
"issue",
"id",
"or",
"key",
"comment",
"id",
"with",
"given",
"data"
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L177-L180 |
201,267 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.createWorklog | public function createWorklog($idOrKey, array $data, $adjustEstimate = null, $newEstimate = null, $reduceBy = null)
{
$parameters = http_build_query(
[
'adjustEstimate' => $adjustEstimate,
'newEstimate' => $newEstimate,
'reduceBy' => $redu... | php | public function createWorklog($idOrKey, array $data, $adjustEstimate = null, $newEstimate = null, $reduceBy = null)
{
$parameters = http_build_query(
[
'adjustEstimate' => $adjustEstimate,
'newEstimate' => $newEstimate,
'reduceBy' => $redu... | [
"public",
"function",
"createWorklog",
"(",
"$",
"idOrKey",
",",
"array",
"$",
"data",
",",
"$",
"adjustEstimate",
"=",
"null",
",",
"$",
"newEstimate",
"=",
"null",
",",
"$",
"reduceBy",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"http_build_query",
... | Creates worklog for the issue by issue id or key
@link https://docs.atlassian.com/jira/REST/latest/#d2e1788
@param integer|string $idOrKey
@param array $data
@param string $adjustEstimate ("new", "leave", "manual", "auto")
@param string $newEstimate (required for "new" adjustEstimate)... | [
"Creates",
"worklog",
"for",
"the",
"issue",
"by",
"issue",
"id",
"or",
"key"
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L224-L239 |
201,268 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.updateWorklog | public function updateWorklog($idOrKey, $worklogId, array $data, $adjustEstimate = null, $newEstimate = null)
{
$parameters = http_build_query(
[
'adjustEstimate' => $adjustEstimate,
'newEstimate' => $newEstimate,
]
);
if ($paramete... | php | public function updateWorklog($idOrKey, $worklogId, array $data, $adjustEstimate = null, $newEstimate = null)
{
$parameters = http_build_query(
[
'adjustEstimate' => $adjustEstimate,
'newEstimate' => $newEstimate,
]
);
if ($paramete... | [
"public",
"function",
"updateWorklog",
"(",
"$",
"idOrKey",
",",
"$",
"worklogId",
",",
"array",
"$",
"data",
",",
"$",
"adjustEstimate",
"=",
"null",
",",
"$",
"newEstimate",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"http_build_query",
"(",
"[",
"... | Updates worklog for the issue by issue id or key and worklog id
@link https://docs.atlassian.com/jira/REST/latest/#d2e1843
@param integer|string $idOrKey
@param integer $worklogId
@param array $data
@param string $adjustEstimate
@param string $newEstimate
@return \GuzzleHttp\Mes... | [
"Updates",
"worklog",
"for",
"the",
"issue",
"by",
"issue",
"id",
"or",
"key",
"and",
"worklog",
"id"
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L269-L283 |
201,269 | AlexKovalevych/jira-api | src/Clients/IssueClient.php | IssueClient.deleteWorklog | public function deleteWorklog($idOrKey, $worklogId, $adjustEstimate = null, $newEstimate = null, $increaseBy = null)
{
$parameters = http_build_query(
[
'adjustEstimate' => $adjustEstimate,
'newEstimate' => $newEstimate,
'increaseBy' => $inc... | php | public function deleteWorklog($idOrKey, $worklogId, $adjustEstimate = null, $newEstimate = null, $increaseBy = null)
{
$parameters = http_build_query(
[
'adjustEstimate' => $adjustEstimate,
'newEstimate' => $newEstimate,
'increaseBy' => $inc... | [
"public",
"function",
"deleteWorklog",
"(",
"$",
"idOrKey",
",",
"$",
"worklogId",
",",
"$",
"adjustEstimate",
"=",
"null",
",",
"$",
"newEstimate",
"=",
"null",
",",
"$",
"increaseBy",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"http_build_query",
"("... | Deletes worklog for the issue by issue id or key and worklog id
@link https://docs.atlassian.com/jira/REST/latest/#d2e1878
@param integer|string $idOrKey
@param integer $worklogId
@param string $adjustEstimate
@param string $newEstimate
@param string $increaseBy
@return \GuzzleHt... | [
"Deletes",
"worklog",
"for",
"the",
"issue",
"by",
"issue",
"id",
"or",
"key",
"and",
"worklog",
"id"
] | 29f1ac3239f49d7e3ad658c1360c6ae582370a5d | https://github.com/AlexKovalevych/jira-api/blob/29f1ac3239f49d7e3ad658c1360c6ae582370a5d/src/Clients/IssueClient.php#L298-L313 |
201,270 | congraphcms/core | Events/EventDispatcher.php | EventDispatcher.getListeners | public function getListeners($event)
{
$parentListeners = [];
$wildcards = [];
if( is_object($event) )
{
$eventName = get_class($event);
$parentListeners = $this->getParentListeners($event);
}
else
{
$eventName = $event;
... | php | public function getListeners($event)
{
$parentListeners = [];
$wildcards = [];
if( is_object($event) )
{
$eventName = get_class($event);
$parentListeners = $this->getParentListeners($event);
}
else
{
$eventName = $event;
... | [
"public",
"function",
"getListeners",
"(",
"$",
"event",
")",
"{",
"$",
"parentListeners",
"=",
"[",
"]",
";",
"$",
"wildcards",
"=",
"[",
"]",
";",
"if",
"(",
"is_object",
"(",
"$",
"event",
")",
")",
"{",
"$",
"eventName",
"=",
"get_class",
"(",
... | Get all of the listeners for a given event.
@param mixed $event
@return array | [
"Get",
"all",
"of",
"the",
"listeners",
"for",
"a",
"given",
"event",
"."
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Events/EventDispatcher.php#L130-L151 |
201,271 | congraphcms/core | Events/EventDispatcher.php | EventDispatcher.getParentListeners | protected function getParentListeners($event)
{
$parentListeners = [];
foreach ($this->listeners as $key => $listeners)
{
if ($event instanceof $key)
{
$parentListeners = array_merge($parentListeners, $listeners);
}
}
retu... | php | protected function getParentListeners($event)
{
$parentListeners = [];
foreach ($this->listeners as $key => $listeners)
{
if ($event instanceof $key)
{
$parentListeners = array_merge($parentListeners, $listeners);
}
}
retu... | [
"protected",
"function",
"getParentListeners",
"(",
"$",
"event",
")",
"{",
"$",
"parentListeners",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"listeners",
"as",
"$",
"key",
"=>",
"$",
"listeners",
")",
"{",
"if",
"(",
"$",
"event",
"instan... | Get the parent class or interface listeners for the event.
@param object $event
@return array | [
"Get",
"the",
"parent",
"class",
"or",
"interface",
"listeners",
"for",
"the",
"event",
"."
] | d017d3951b446fb2ac93b8fcee120549bb125b17 | https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Events/EventDispatcher.php#L159-L172 |
201,272 | lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/Traits/LockedFields.php | LockedFields.unlockMyRecords | public function unlockMyRecords($tableName)
{
$results = $this->lockedRecordsByUser($tableName, Auth::user()->id);
foreach($results as $result)
{
$this->unpopulateLockFields($result->id);
}
} | php | public function unlockMyRecords($tableName)
{
$results = $this->lockedRecordsByUser($tableName, Auth::user()->id);
foreach($results as $result)
{
$this->unpopulateLockFields($result->id);
}
} | [
"public",
"function",
"unlockMyRecords",
"(",
"$",
"tableName",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"lockedRecordsByUser",
"(",
"$",
"tableName",
",",
"Auth",
"::",
"user",
"(",
")",
"->",
"id",
")",
";",
"foreach",
"(",
"$",
"results",
"... | Unlock records belonging to the current user.
@param string $tableName
@return bool | [
"Unlock",
"records",
"belonging",
"to",
"the",
"current",
"user",
"."
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/Traits/LockedFields.php#L52-L60 |
201,273 | lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/Traits/LockedFields.php | LockedFields.isLocked | public function isLocked($id)
{
$record = $this->model->findOrFail($id);
if ($record->locked_by > 0) return true;
return false;
} | php | public function isLocked($id)
{
$record = $this->model->findOrFail($id);
if ($record->locked_by > 0) return true;
return false;
} | [
"public",
"function",
"isLocked",
"(",
"$",
"id",
")",
"{",
"$",
"record",
"=",
"$",
"this",
"->",
"model",
"->",
"findOrFail",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"record",
"->",
"locked_by",
">",
"0",
")",
"return",
"true",
";",
"return",
... | Is the record locked?
"Locked" is defined as the 'locked_by' field being populated; that is,> 0
@param int $id
@return bool | [
"Is",
"the",
"record",
"locked?",
"Locked",
"is",
"defined",
"as",
"the",
"locked_by",
"field",
"being",
"populated",
";",
"that",
"is",
">",
"0"
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/Traits/LockedFields.php#L83-L90 |
201,274 | lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/Traits/LockedFields.php | LockedFields.populateLockFields | public function populateLockFields($id)
{
// $this->getSave($data); --> creates new record ;-(
// $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or
// update a parent row: a foreign key constraint fails ;-(
// use the m... | php | public function populateLockFields($id)
{
// $this->getSave($data); --> creates new record ;-(
// $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or
// update a parent row: a foreign key constraint fails ;-(
// use the m... | [
"public",
"function",
"populateLockFields",
"(",
"$",
"id",
")",
"{",
"// $this->getSave($data); --> creates new record ;-(",
"// $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or",
"// update a parent row: a foreign key constraint ... | Populate the locked_at and locked_by fields.
By definition, this must be an UPDATE
All that is needed is the ID
@param int $id
@return bool | [
"Populate",
"the",
"locked_at",
"and",
"locked_by",
"fields",
".",
"By",
"definition",
"this",
"must",
"be",
"an",
"UPDATE"
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/Traits/LockedFields.php#L102-L114 |
201,275 | lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/Traits/LockedFields.php | LockedFields.unpopulateLockFields | public function unpopulateLockFields($id)
{
// $this->getSave($data); --> creates new record ;-(
// $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or
// update a parent row: a foreign key constraint fails ;-(
// use the... | php | public function unpopulateLockFields($id)
{
// $this->getSave($data); --> creates new record ;-(
// $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or
// update a parent row: a foreign key constraint fails ;-(
// use the... | [
"public",
"function",
"unpopulateLockFields",
"(",
"$",
"id",
")",
"{",
"// $this->getSave($data); --> creates new record ;-(",
"// $this->getUpdate($data); --> integrity constraint violation: 1451 Cannot delete or",
"// update a parent row: a foreign key constrain... | Un-populate the locked_at and locked_by fields.
By definition, this must be an UPDATE
All that is needed is the ID
@param int $id
@return mixed(?) | [
"Un",
"-",
"populate",
"the",
"locked_at",
"and",
"locked_by",
"fields",
".",
"By",
"definition",
"this",
"must",
"be",
"an",
"UPDATE"
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/Traits/LockedFields.php#L126-L139 |
201,276 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.to | public static function to( $model, $target, $position )
{
$instance = new static( $model, $target, $position );
return $instance->perform();
} | php | public static function to( $model, $target, $position )
{
$instance = new static( $model, $target, $position );
return $instance->perform();
} | [
"public",
"static",
"function",
"to",
"(",
"$",
"model",
",",
"$",
"target",
",",
"$",
"position",
")",
"{",
"$",
"instance",
"=",
"new",
"static",
"(",
"$",
"model",
",",
"$",
"target",
",",
"$",
"position",
")",
";",
"return",
"$",
"instance",
"-... | Easy static accessor for performing a move operation.
@param NestedModel $model
@param NestedModel|int $target
@param string $position
@return NestedModel | [
"Easy",
"static",
"accessor",
"for",
"performing",
"a",
"move",
"operation",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L73-L78 |
201,277 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.perform | public function perform()
{
$this->guardAgainstImpossibleMove();
if ( $this->fireMoveEvent( 'moving' ) === false )
return $this->model;
if ( $this->hasChange() )
{
$self = $this;
$this->model->getConnection()->transaction( function () use ( $self )
{
$self->updateStructure();
} );
$th... | php | public function perform()
{
$this->guardAgainstImpossibleMove();
if ( $this->fireMoveEvent( 'moving' ) === false )
return $this->model;
if ( $this->hasChange() )
{
$self = $this;
$this->model->getConnection()->transaction( function () use ( $self )
{
$self->updateStructure();
} );
$th... | [
"public",
"function",
"perform",
"(",
")",
"{",
"$",
"this",
"->",
"guardAgainstImpossibleMove",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"fireMoveEvent",
"(",
"'moving'",
")",
"===",
"false",
")",
"return",
"$",
"this",
"->",
"model",
";",
"if",
"... | Perform the move operation.
@return NestedModel | [
"Perform",
"the",
"move",
"operation",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L85-L111 |
201,278 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.resolveNode | protected function resolveNode( $model )
{
if ( $model instanceof NestedModel )
return $model->reload();
return $this->model->newNestedSetQuery()->find( $model );
} | php | protected function resolveNode( $model )
{
if ( $model instanceof NestedModel )
return $model->reload();
return $this->model->newNestedSetQuery()->find( $model );
} | [
"protected",
"function",
"resolveNode",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"$",
"model",
"instanceof",
"NestedModel",
")",
"return",
"$",
"model",
"->",
"reload",
"(",
")",
";",
"return",
"$",
"this",
"->",
"model",
"->",
"newNestedSetQuery",
"(",
"... | Resolves suplied node. Basically returns the node unchanged if
supplied parameter is an instance of NestedModel. Otherwise it will try
to find the node in the database.
@param NestedModel|int
@return NestedModel | [
"Resolves",
"suplied",
"node",
".",
"Basically",
"returns",
"the",
"node",
"unchanged",
"if",
"supplied",
"parameter",
"is",
"an",
"instance",
"of",
"NestedModel",
".",
"Otherwise",
"it",
"will",
"try",
"to",
"find",
"the",
"node",
"in",
"the",
"database",
"... | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L176-L182 |
201,279 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.guardAgainstImpossibleMove | protected function guardAgainstImpossibleMove()
{
if ( !$this->model->exists )
throw new MoveNotPossibleException( 'A new node cannot be moved.' );
if ( array_search( $this->position, ['child', 'left', 'right', 'root'] ) === false )
throw new MoveNotPossibleException( "Position should be one of ['child', 'l... | php | protected function guardAgainstImpossibleMove()
{
if ( !$this->model->exists )
throw new MoveNotPossibleException( 'A new node cannot be moved.' );
if ( array_search( $this->position, ['child', 'left', 'right', 'root'] ) === false )
throw new MoveNotPossibleException( "Position should be one of ['child', 'l... | [
"protected",
"function",
"guardAgainstImpossibleMove",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"model",
"->",
"exists",
")",
"throw",
"new",
"MoveNotPossibleException",
"(",
"'A new node cannot be moved.'",
")",
";",
"if",
"(",
"array_search",
"(",
"$"... | Check wether the current move is possible and if not, rais an exception.
@return void | [
"Check",
"wether",
"the",
"current",
"move",
"is",
"possible",
"and",
"if",
"not",
"rais",
"an",
"exception",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L189-L216 |
201,280 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.bound1 | protected function bound1()
{
if ( !is_null( $this->_bound1 ) )
return $this->_bound1;
switch ( $this->position )
{
case 'child':
$this->_bound1 = $this->target->getRight();
break;
case 'left':
$this->_bound1 = $this->target->getLeft();
break;
case 'right':
$this->_bound1 = $th... | php | protected function bound1()
{
if ( !is_null( $this->_bound1 ) )
return $this->_bound1;
switch ( $this->position )
{
case 'child':
$this->_bound1 = $this->target->getRight();
break;
case 'left':
$this->_bound1 = $this->target->getLeft();
break;
case 'right':
$this->_bound1 = $th... | [
"protected",
"function",
"bound1",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"_bound1",
")",
")",
"return",
"$",
"this",
"->",
"_bound1",
";",
"switch",
"(",
"$",
"this",
"->",
"position",
")",
"{",
"case",
"'child'",
":",
"... | Computes the boundary.
@return int | [
"Computes",
"the",
"boundary",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L223-L250 |
201,281 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.boundaries | protected function boundaries()
{
if ( !is_null( $this->_boundaries ) )
return $this->_boundaries;
// we have defined the boundaries of two non-overlapping intervals,
// so sorting puts both the intervals and their boundaries in order
$this->_boundaries = [
$this->model->getLeft(),
$this->model->getR... | php | protected function boundaries()
{
if ( !is_null( $this->_boundaries ) )
return $this->_boundaries;
// we have defined the boundaries of two non-overlapping intervals,
// so sorting puts both the intervals and their boundaries in order
$this->_boundaries = [
$this->model->getLeft(),
$this->model->getR... | [
"protected",
"function",
"boundaries",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"_boundaries",
")",
")",
"return",
"$",
"this",
"->",
"_boundaries",
";",
"// we have defined the boundaries of two non-overlapping intervals,",
"// so sorting put... | Computes the boundaries array.
@return array | [
"Computes",
"the",
"boundaries",
"array",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L273-L289 |
201,282 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.parentId | protected function parentId()
{
switch ( $this->position )
{
case 'root':
return null;
case 'child':
return $this->target->getKey();
default:
return $this->target->getParentId();
}
} | php | protected function parentId()
{
switch ( $this->position )
{
case 'root':
return null;
case 'child':
return $this->target->getKey();
default:
return $this->target->getParentId();
}
} | [
"protected",
"function",
"parentId",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"position",
")",
"{",
"case",
"'root'",
":",
"return",
"null",
";",
"case",
"'child'",
":",
"return",
"$",
"this",
"->",
"target",
"->",
"getKey",
"(",
")",
";",
"d... | Computes the new parent id for the node being moved.
@return int | [
"Computes",
"the",
"new",
"parent",
"id",
"for",
"the",
"node",
"being",
"moved",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L296-L309 |
201,283 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.hasChange | protected function hasChange()
{
return !( $this->bound1() == $this->model->getRight() || $this->bound1() == $this->model->getLeft() );
} | php | protected function hasChange()
{
return !( $this->bound1() == $this->model->getRight() || $this->bound1() == $this->model->getLeft() );
} | [
"protected",
"function",
"hasChange",
"(",
")",
"{",
"return",
"!",
"(",
"$",
"this",
"->",
"bound1",
"(",
")",
"==",
"$",
"this",
"->",
"model",
"->",
"getRight",
"(",
")",
"||",
"$",
"this",
"->",
"bound1",
"(",
")",
"==",
"$",
"this",
"->",
"m... | Check wether there should be changes in the downward tree structure.
@return boolean | [
"Check",
"wether",
"there",
"should",
"be",
"changes",
"in",
"the",
"downward",
"tree",
"structure",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L316-L319 |
201,284 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.fireMoveEvent | protected function fireMoveEvent( $event, $halt = true )
{
// Basically the same as \Illuminate\Database\Eloquent\Model->fireModelEvent
// but we relay the event into the node instance.
$event = "eloquent.{$event}: " . get_class( $this->model );
$method = $halt ? 'until' : 'fire';
Hooks::trigger( $event, [... | php | protected function fireMoveEvent( $event, $halt = true )
{
// Basically the same as \Illuminate\Database\Eloquent\Model->fireModelEvent
// but we relay the event into the node instance.
$event = "eloquent.{$event}: " . get_class( $this->model );
$method = $halt ? 'until' : 'fire';
Hooks::trigger( $event, [... | [
"protected",
"function",
"fireMoveEvent",
"(",
"$",
"event",
",",
"$",
"halt",
"=",
"true",
")",
"{",
"// Basically the same as \\Illuminate\\Database\\Eloquent\\Model->fireModelEvent",
"// but we relay the event into the node instance.",
"$",
"event",
"=",
"\"eloquent.{$event}: ... | Fire the given move event for the model.
@param string $event
@param bool $halt
@return mixed | [
"Fire",
"the",
"given",
"move",
"event",
"for",
"the",
"model",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L338-L347 |
201,285 | PenoaksDev/Milky-Framework | src/Milky/Database/Eloquent/Nested/Move.php | Move.applyLockBetween | protected function applyLockBetween( $lft, $rgt )
{
$this->model->newQuery()->where( $this->model->getLeftColumnName(), '>=', $lft )->where( $this->model->getRightColumnName(), '<=', $rgt )->select( $this->model->getKeyName() )->lockForUpdate()->get();
} | php | protected function applyLockBetween( $lft, $rgt )
{
$this->model->newQuery()->where( $this->model->getLeftColumnName(), '>=', $lft )->where( $this->model->getRightColumnName(), '<=', $rgt )->select( $this->model->getKeyName() )->lockForUpdate()->get();
} | [
"protected",
"function",
"applyLockBetween",
"(",
"$",
"lft",
",",
"$",
"rgt",
")",
"{",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
"->",
"where",
"(",
"$",
"this",
"->",
"model",
"->",
"getLeftColumnName",
"(",
")",
",",
"'>='",
",",
"$... | Applies a lock to the rows between the supplied index boundaries.
@param int $lft
@param int $rgt
@return void | [
"Applies",
"a",
"lock",
"to",
"the",
"rows",
"between",
"the",
"supplied",
"index",
"boundaries",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Eloquent/Nested/Move.php#L374-L377 |
201,286 | CampaignChain/security-authentication-client-oauth | EntityService/TokenService.php | TokenService.cleanUpUnassignedTokens | public function cleanUpUnassignedTokens(array $tokens)
{
$this->em->clear();
foreach ($tokens as $token) {
$token = $this->em->merge($token);
$this->em->remove($token);
}
$this->em->flush();
} | php | public function cleanUpUnassignedTokens(array $tokens)
{
$this->em->clear();
foreach ($tokens as $token) {
$token = $this->em->merge($token);
$this->em->remove($token);
}
$this->em->flush();
} | [
"public",
"function",
"cleanUpUnassignedTokens",
"(",
"array",
"$",
"tokens",
")",
"{",
"$",
"this",
"->",
"em",
"->",
"clear",
"(",
")",
";",
"foreach",
"(",
"$",
"tokens",
"as",
"$",
"token",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"em",
... | Removes the not assigned tokens.
@param Token[] $tokens | [
"Removes",
"the",
"not",
"assigned",
"tokens",
"."
] | 06800ccd0ee6b5ca9f53b85146228467ff6a7529 | https://github.com/CampaignChain/security-authentication-client-oauth/blob/06800ccd0ee6b5ca9f53b85146228467ff6a7529/EntityService/TokenService.php#L199-L208 |
201,287 | danielgp/common-lib | source/DomBasicComponentsByDanielGP.php | DomBasicComponentsByDanielGP.setCleanUrl | protected function setCleanUrl($urlString)
{
$arrayToReplace = [
'&' => '&',
'&' => '&',
'&amp;' => '&',
' ' => '%20',
];
$kys = array_keys($arrayToReplace);
$vls = array_val... | php | protected function setCleanUrl($urlString)
{
$arrayToReplace = [
'&' => '&',
'&' => '&',
'&amp;' => '&',
' ' => '%20',
];
$kys = array_keys($arrayToReplace);
$vls = array_val... | [
"protected",
"function",
"setCleanUrl",
"(",
"$",
"urlString",
")",
"{",
"$",
"arrayToReplace",
"=",
"[",
"'&'",
"=>",
"'&'",
",",
"'&'",
"=>",
"'&'",
",",
"'&amp;'",
"=>",
"'&'",
",",
"' '",
"=>",
"'%20'",
",",
"]",
";",
"$",
"kys",... | Cleans a string for certain internal rules
@param string $urlString
@return string | [
"Cleans",
"a",
"string",
"for",
"certain",
"internal",
"rules"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomBasicComponentsByDanielGP.php#L85-L96 |
201,288 | danielgp/common-lib | source/DomBasicComponentsByDanielGP.php | DomBasicComponentsByDanielGP.setFeedbackModern | protected function setFeedbackModern($sType, $sTitle, $sMsg, $skipBr = false)
{
if ($sTitle == 'light') {
return $sMsg;
}
$legend = $this->setStringIntoTag($sTitle, 'legend', ['style' => $this->setFeedbackStyle($sType)]);
return implode('', [
($skipBr ? '' : '... | php | protected function setFeedbackModern($sType, $sTitle, $sMsg, $skipBr = false)
{
if ($sTitle == 'light') {
return $sMsg;
}
$legend = $this->setStringIntoTag($sTitle, 'legend', ['style' => $this->setFeedbackStyle($sType)]);
return implode('', [
($skipBr ? '' : '... | [
"protected",
"function",
"setFeedbackModern",
"(",
"$",
"sType",
",",
"$",
"sTitle",
",",
"$",
"sMsg",
",",
"$",
"skipBr",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"sTitle",
"==",
"'light'",
")",
"{",
"return",
"$",
"sMsg",
";",
"}",
"$",
"legend",
... | Builds a structured modern message
@param string $sType
@param string $sTitle
@param string $sMsg
@param boolean $skipBr | [
"Builds",
"a",
"structured",
"modern",
"message"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomBasicComponentsByDanielGP.php#L123-L133 |
201,289 | danielgp/common-lib | source/DomBasicComponentsByDanielGP.php | DomBasicComponentsByDanielGP.setHeaderNoCache | protected function setHeaderNoCache($contentType = 'application/json')
{
header("Content-Type: " . $contentType . "; charset=utf-8");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: po... | php | protected function setHeaderNoCache($contentType = 'application/json')
{
header("Content-Type: " . $contentType . "; charset=utf-8");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: po... | [
"protected",
"function",
"setHeaderNoCache",
"(",
"$",
"contentType",
"=",
"'application/json'",
")",
"{",
"header",
"(",
"\"Content-Type: \"",
".",
"$",
"contentType",
".",
"\"; charset=utf-8\"",
")",
";",
"header",
"(",
"\"Last-Modified: \"",
".",
"gmdate",
"(",
... | Sets the no-cache header | [
"Sets",
"the",
"no",
"-",
"cache",
"header"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomBasicComponentsByDanielGP.php#L206-L213 |
201,290 | danielgp/common-lib | source/DomBasicComponentsByDanielGP.php | DomBasicComponentsByDanielGP.setStringIntoShortTag | protected function setStringIntoShortTag($sTag, $features = null)
{
return '<' . $sTag . $this->buildAttributesForTag($features)
. (isset($features['dont_close']) ? '' : '/') . '>';
} | php | protected function setStringIntoShortTag($sTag, $features = null)
{
return '<' . $sTag . $this->buildAttributesForTag($features)
. (isset($features['dont_close']) ? '' : '/') . '>';
} | [
"protected",
"function",
"setStringIntoShortTag",
"(",
"$",
"sTag",
",",
"$",
"features",
"=",
"null",
")",
"{",
"return",
"'<'",
".",
"$",
"sTag",
".",
"$",
"this",
"->",
"buildAttributesForTag",
"(",
"$",
"features",
")",
".",
"(",
"isset",
"(",
"$",
... | Puts a given string into a specific short tag
@param string $sTag
@param array $features
@return string | [
"Puts",
"a",
"given",
"string",
"into",
"a",
"specific",
"short",
"tag"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomBasicComponentsByDanielGP.php#L222-L226 |
201,291 | danielgp/common-lib | source/DomBasicComponentsByDanielGP.php | DomBasicComponentsByDanielGP.setStringIntoTag | protected function setStringIntoTag($sString, $sTag, $features = null)
{
return '<' . $sTag . $this->buildAttributesForTag($features) . '>' . $sString . '</' . $sTag . '>';
} | php | protected function setStringIntoTag($sString, $sTag, $features = null)
{
return '<' . $sTag . $this->buildAttributesForTag($features) . '>' . $sString . '</' . $sTag . '>';
} | [
"protected",
"function",
"setStringIntoTag",
"(",
"$",
"sString",
",",
"$",
"sTag",
",",
"$",
"features",
"=",
"null",
")",
"{",
"return",
"'<'",
".",
"$",
"sTag",
".",
"$",
"this",
"->",
"buildAttributesForTag",
"(",
"$",
"features",
")",
".",
"'>'",
... | Puts a given string into a specific tag
@param string $sString
@param string $sTag
@param array $features
@return string | [
"Puts",
"a",
"given",
"string",
"into",
"a",
"specific",
"tag"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomBasicComponentsByDanielGP.php#L236-L239 |
201,292 | SugiPHP/Filter | Filter.php | Filter.int | public function int($value, $min = false, $max = false, $default = false)
{
$options = array("options" => array());
if (isset($default)) {
$options["options"]["default"] = $default;
}
if (is_numeric($min)) {
$options["options"]["min_range"] = $min;
}
if (is_numeric($max)) {
$options["options"]["ma... | php | public function int($value, $min = false, $max = false, $default = false)
{
$options = array("options" => array());
if (isset($default)) {
$options["options"]["default"] = $default;
}
if (is_numeric($min)) {
$options["options"]["min_range"] = $min;
}
if (is_numeric($max)) {
$options["options"]["ma... | [
"public",
"function",
"int",
"(",
"$",
"value",
",",
"$",
"min",
"=",
"false",
",",
"$",
"max",
"=",
"false",
",",
"$",
"default",
"=",
"false",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"\"options\"",
"=>",
"array",
"(",
")",
")",
";",
"if",
... | Validates integer value.
@param mixed $value Integer or string
@param integer $min
@param integer $max
@param mixed $default What to be returned if the filter fails
@return mixed | [
"Validates",
"integer",
"value",
"."
] | 1fc455efc5e3405c4186c2c997aee81eeb1eb59c | https://github.com/SugiPHP/Filter/blob/1fc455efc5e3405c4186c2c997aee81eeb1eb59c/Filter.php#L35-L55 |
201,293 | SugiPHP/Filter | Filter.php | Filter.str | public function str($value, $minLength = 0, $maxLength = false, $default = false)
{
$value = trim($value);
if ((!empty($minLength) && (mb_strlen($value, $this->encoding) < $minLength)) ||
(!empty($maxLength) && (mb_strlen($value, $this->encoding) > $maxLength))
) {
return $default;
}
return (string) $... | php | public function str($value, $minLength = 0, $maxLength = false, $default = false)
{
$value = trim($value);
if ((!empty($minLength) && (mb_strlen($value, $this->encoding) < $minLength)) ||
(!empty($maxLength) && (mb_strlen($value, $this->encoding) > $maxLength))
) {
return $default;
}
return (string) $... | [
"public",
"function",
"str",
"(",
"$",
"value",
",",
"$",
"minLength",
"=",
"0",
",",
"$",
"maxLength",
"=",
"false",
",",
"$",
"default",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"trim",
"(",
"$",
"value",
")",
";",
"if",
"(",
"(",
"!",
"emp... | Validates string value.
@param string $value
@param integer $minLength
@param mixed $maxLength
@param mixed $default
@return mixed | [
"Validates",
"string",
"value",
"."
] | 1fc455efc5e3405c4186c2c997aee81eeb1eb59c | https://github.com/SugiPHP/Filter/blob/1fc455efc5e3405c4186c2c997aee81eeb1eb59c/Filter.php#L67-L77 |
201,294 | SugiPHP/Filter | Filter.php | Filter.plain | public function plain($value, $minLength = 0, $maxLength = false, $default = false)
{
$value = strip_tags($value);
return $this->str($value, $minLength, $maxLength, $default);
} | php | public function plain($value, $minLength = 0, $maxLength = false, $default = false)
{
$value = strip_tags($value);
return $this->str($value, $minLength, $maxLength, $default);
} | [
"public",
"function",
"plain",
"(",
"$",
"value",
",",
"$",
"minLength",
"=",
"0",
",",
"$",
"maxLength",
"=",
"false",
",",
"$",
"default",
"=",
"false",
")",
"{",
"$",
"value",
"=",
"strip_tags",
"(",
"$",
"value",
")",
";",
"return",
"$",
"this"... | Validates string and is removing tags from it.
@param string $value
@param integer $minLength
@param mixed $maxLength
@param mixed $default
@return mixed | [
"Validates",
"string",
"and",
"is",
"removing",
"tags",
"from",
"it",
"."
] | 1fc455efc5e3405c4186c2c997aee81eeb1eb59c | https://github.com/SugiPHP/Filter/blob/1fc455efc5e3405c4186c2c997aee81eeb1eb59c/Filter.php#L89-L94 |
201,295 | SugiPHP/Filter | Filter.php | Filter.email | public function email($value, $default = false, $checkMxRecord = false)
{
if (!$value = filter_var($value, FILTER_VALIDATE_EMAIL)) {
return $default;
}
$dom = explode("@", $value);
$dom = array_pop($dom);
if (!$this->url("http://$dom")) {
return $default;
}
return (!$checkMxRecord || checkdnsrr($d... | php | public function email($value, $default = false, $checkMxRecord = false)
{
if (!$value = filter_var($value, FILTER_VALIDATE_EMAIL)) {
return $default;
}
$dom = explode("@", $value);
$dom = array_pop($dom);
if (!$this->url("http://$dom")) {
return $default;
}
return (!$checkMxRecord || checkdnsrr($d... | [
"public",
"function",
"email",
"(",
"$",
"value",
",",
"$",
"default",
"=",
"false",
",",
"$",
"checkMxRecord",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"value",
"=",
"filter_var",
"(",
"$",
"value",
",",
"FILTER_VALIDATE_EMAIL",
")",
")",
"{",
"... | Validates email.
@param string $value
@param mixed $default - default value to return on validation failure
@param boolean $checkMxRecord - check existence of MX record. If check fails default value will be returned.
@return mixed | [
"Validates",
"email",
"."
] | 1fc455efc5e3405c4186c2c997aee81eeb1eb59c | https://github.com/SugiPHP/Filter/blob/1fc455efc5e3405c4186c2c997aee81eeb1eb59c/Filter.php#L132-L144 |
201,296 | railken/lem | src/Attributes/TextAttribute.php | TextAttribute.setRequired | public function setRequired(bool $required): BaseAttribute
{
parent::setRequired($required);
if ($this->getMinLength() === 0) {
$this->setMinLength(1);
}
return $this;
} | php | public function setRequired(bool $required): BaseAttribute
{
parent::setRequired($required);
if ($this->getMinLength() === 0) {
$this->setMinLength(1);
}
return $this;
} | [
"public",
"function",
"setRequired",
"(",
"bool",
"$",
"required",
")",
":",
"BaseAttribute",
"{",
"parent",
"::",
"setRequired",
"(",
"$",
"required",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getMinLength",
"(",
")",
"===",
"0",
")",
"{",
"$",
"this",... | Set Required.
@param bool $required
@return $this | [
"Set",
"Required",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Attributes/TextAttribute.php#L99-L108 |
201,297 | fridge-project/dbal | src/Fridge/DBAL/Schema/ForeignKey.php | ForeignKey.setLocalColumnNames | public function setLocalColumnNames(array $localColumnNames)
{
$this->localColumnNames = array();
foreach ($localColumnNames as $localColumnName) {
$this->addLocalColumnName($localColumnName);
}
} | php | public function setLocalColumnNames(array $localColumnNames)
{
$this->localColumnNames = array();
foreach ($localColumnNames as $localColumnName) {
$this->addLocalColumnName($localColumnName);
}
} | [
"public",
"function",
"setLocalColumnNames",
"(",
"array",
"$",
"localColumnNames",
")",
"{",
"$",
"this",
"->",
"localColumnNames",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"localColumnNames",
"as",
"$",
"localColumnName",
")",
"{",
"$",
"this",
"-... | Sets the local column names.
@param array $localColumnNames The local column names. | [
"Sets",
"the",
"local",
"column",
"names",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/ForeignKey.php#L96-L103 |
201,298 | fridge-project/dbal | src/Fridge/DBAL/Schema/ForeignKey.php | ForeignKey.addLocalColumnName | public function addLocalColumnName($localColumnName)
{
if (!is_string($localColumnName) || (strlen($localColumnName) <= 0)) {
throw SchemaException::invalidForeignKeyLocalColumnName($this->getName());
}
$this->localColumnNames[] = $localColumnName;
} | php | public function addLocalColumnName($localColumnName)
{
if (!is_string($localColumnName) || (strlen($localColumnName) <= 0)) {
throw SchemaException::invalidForeignKeyLocalColumnName($this->getName());
}
$this->localColumnNames[] = $localColumnName;
} | [
"public",
"function",
"addLocalColumnName",
"(",
"$",
"localColumnName",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"localColumnName",
")",
"||",
"(",
"strlen",
"(",
"$",
"localColumnName",
")",
"<=",
"0",
")",
")",
"{",
"throw",
"SchemaException",
"... | Adds a local column name to the foreign key.
@param string $localColumnName The local column name to add.
@throws \Fridge\DBAL\Exception\SchemaException If the local column name is not a valid string. | [
"Adds",
"a",
"local",
"column",
"name",
"to",
"the",
"foreign",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/ForeignKey.php#L112-L119 |
201,299 | fridge-project/dbal | src/Fridge/DBAL/Schema/ForeignKey.php | ForeignKey.setForeignTableName | public function setForeignTableName($foreignTableName)
{
if (!is_string($foreignTableName) || (strlen($foreignTableName) <= 0)) {
throw SchemaException::invalidForeignKeyForeignTableName($this->getName());
}
$this->foreignTableName = $foreignTableName;
} | php | public function setForeignTableName($foreignTableName)
{
if (!is_string($foreignTableName) || (strlen($foreignTableName) <= 0)) {
throw SchemaException::invalidForeignKeyForeignTableName($this->getName());
}
$this->foreignTableName = $foreignTableName;
} | [
"public",
"function",
"setForeignTableName",
"(",
"$",
"foreignTableName",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"foreignTableName",
")",
"||",
"(",
"strlen",
"(",
"$",
"foreignTableName",
")",
"<=",
"0",
")",
")",
"{",
"throw",
"SchemaException",... | Sets the foreign table name.
@param string $foreignTableName The foreign table name.
@throws \Fridge\DBAL\Exception\SchemaException If the foreign table name is not a valid string. | [
"Sets",
"the",
"foreign",
"table",
"name",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/ForeignKey.php#L138-L145 |
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.