id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
32,400 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php | TShopPaymentHandlerIPaymentEndPoint.GetResultFormResponse | protected function GetResultFormResponse($response)
{
$aNeededResponseParameterToCheck = array('ret_status' => '', 'ret_errormsg' => '', 'trxuser_id' => '', 'trx_amount' => '', 'trx_currency' => '', 'ret_authcode' => '', 'ret_trx_number' => '', 'ret_param_checksum' => '');
preg_match('/<a href=".*'.... | php | protected function GetResultFormResponse($response)
{
$aNeededResponseParameterToCheck = array('ret_status' => '', 'ret_errormsg' => '', 'trxuser_id' => '', 'trx_amount' => '', 'trx_currency' => '', 'ret_authcode' => '', 'ret_trx_number' => '', 'ret_param_checksum' => '');
preg_match('/<a href=".*'.... | [
"protected",
"function",
"GetResultFormResponse",
"(",
"$",
"response",
")",
"{",
"$",
"aNeededResponseParameterToCheck",
"=",
"array",
"(",
"'ret_status'",
"=>",
"''",
",",
"'ret_errormsg'",
"=>",
"''",
",",
"'trxuser_id'",
"=>",
"''",
",",
"'trx_amount'",
"=>",
... | Get parameter from IPayment response which are needed to check if payment request was successful.
@param string $response
@return array $aNeededResponseParameterToCheck | [
"Get",
"parameter",
"from",
"IPayment",
"response",
"which",
"are",
"needed",
"to",
"check",
"if",
"payment",
"request",
"was",
"successful",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php#L593-L608 |
32,401 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php | TShopPaymentHandlerIPaymentEndPoint.GetNeedeResponsePostParameterForSecurityCheck | protected function GetNeedeResponsePostParameterForSecurityCheck()
{
$aParameter = array();
$oGlobal = TGlobal::instance();
$aParameter['trxuser_id'] = $oGlobal->GetUserData('trxuser_id');
$aParameter['trx_amount'] = $oGlobal->GetUserData('trx_amount');
$aParameter['trx_curre... | php | protected function GetNeedeResponsePostParameterForSecurityCheck()
{
$aParameter = array();
$oGlobal = TGlobal::instance();
$aParameter['trxuser_id'] = $oGlobal->GetUserData('trxuser_id');
$aParameter['trx_amount'] = $oGlobal->GetUserData('trx_amount');
$aParameter['trx_curre... | [
"protected",
"function",
"GetNeedeResponsePostParameterForSecurityCheck",
"(",
")",
"{",
"$",
"aParameter",
"=",
"array",
"(",
")",
";",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"$",
"aParameter",
"[",
"'trxuser_id'",
"]",
"=",
"$",
"... | Get response parameter from IPayment which are needed to make a security hash check.
@return array $aParameter | [
"Get",
"response",
"parameter",
"from",
"IPayment",
"which",
"are",
"needed",
"to",
"make",
"a",
"security",
"hash",
"check",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php#L615-L627 |
32,402 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php | TShopPaymentHandlerIPaymentEndPoint.bIsCorrectIPaymentType | protected function bIsCorrectIPaymentType()
{
$bIsCorrectIPaymentType = false;
$aParameter = $this->GetPaymentTypeSpecifivParameter();
$oGlobal = TGlobal::instance();
$sResponsePaymentType = $oGlobal->GetUserData('trx_paymenttyp');
if (!empty($sResponsePaymentType) && array_k... | php | protected function bIsCorrectIPaymentType()
{
$bIsCorrectIPaymentType = false;
$aParameter = $this->GetPaymentTypeSpecifivParameter();
$oGlobal = TGlobal::instance();
$sResponsePaymentType = $oGlobal->GetUserData('trx_paymenttyp');
if (!empty($sResponsePaymentType) && array_k... | [
"protected",
"function",
"bIsCorrectIPaymentType",
"(",
")",
"{",
"$",
"bIsCorrectIPaymentType",
"=",
"false",
";",
"$",
"aParameter",
"=",
"$",
"this",
"->",
"GetPaymentTypeSpecifivParameter",
"(",
")",
";",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"("... | Check after response from IPayment if the paymenthandler is the one which sent request to IPayment.
@return bool $bIsCorrectIPaymentType | [
"Check",
"after",
"response",
"from",
"IPayment",
"if",
"the",
"paymenthandler",
"is",
"the",
"one",
"which",
"sent",
"request",
"to",
"IPayment",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php#L634-L645 |
32,403 | sylingd/Yesf | src/Event/Listener.php | Listener.on | public function on($event, $callback) {
if (!is_callable($callback)) {
throw new ListenException(var_export($callback, true) . " is not callback");
}
$this->callback[$event] = $callback;
} | php | public function on($event, $callback) {
if (!is_callable($callback)) {
throw new ListenException(var_export($callback, true) . " is not callback");
}
$this->callback[$event] = $callback;
} | [
"public",
"function",
"on",
"(",
"$",
"event",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"throw",
"new",
"ListenException",
"(",
"var_export",
"(",
"$",
"callback",
",",
"true",
")",
".",
"\" ... | Set event handler
@access public
@param string $event
@param callable $callback | [
"Set",
"event",
"handler"
] | 0fc2b42903bb3519c54c596270c890c826aeb1df | https://github.com/sylingd/Yesf/blob/0fc2b42903bb3519c54c596270c890c826aeb1df/src/Event/Listener.php#L190-L195 |
32,404 | edmondscommerce/doctrine-static-meta | src/Entity/Embeddable/Objects/AbstractEmbeddableObject.php | AbstractEmbeddableObject.notifyEmbeddablePrefixedProperties | protected function notifyEmbeddablePrefixedProperties(
?string $propName = null,
$oldValue = null,
$newValue = null
): void {
if (null === $this->owningEntity) {
return;
}
$this->owningEntity->notifyEmbeddablePrefixedProperties(
$this->getPrefi... | php | protected function notifyEmbeddablePrefixedProperties(
?string $propName = null,
$oldValue = null,
$newValue = null
): void {
if (null === $this->owningEntity) {
return;
}
$this->owningEntity->notifyEmbeddablePrefixedProperties(
$this->getPrefi... | [
"protected",
"function",
"notifyEmbeddablePrefixedProperties",
"(",
"?",
"string",
"$",
"propName",
"=",
"null",
",",
"$",
"oldValue",
"=",
"null",
",",
"$",
"newValue",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"ow... | If we are attached to an owning Entity, then we need to use it to Notify the Unit of Work about changes
If we are not attached, then do nothing. When we are attached, this should be triggered automatically
@param null|string $propName
@param null|mixed $oldValue
@param null|mixed $newValue | [
"If",
"we",
"are",
"attached",
"to",
"an",
"owning",
"Entity",
"then",
"we",
"need",
"to",
"use",
"it",
"to",
"Notify",
"the",
"Unit",
"of",
"Work",
"about",
"changes"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/Entity/Embeddable/Objects/AbstractEmbeddableObject.php#L41-L55 |
32,405 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.GetNumberOfArticlesInCategory | public function GetNumberOfArticlesInCategory($bIncludeSubcategoriesInCount = false)
{
if ($bIncludeSubcategoriesInCount) {
$oArticleList = $this->GetArticleListIncludingSubcategories();
} else {
$oArticleList = $this->GetArticleList();
}
return $oArticleList... | php | public function GetNumberOfArticlesInCategory($bIncludeSubcategoriesInCount = false)
{
if ($bIncludeSubcategoriesInCount) {
$oArticleList = $this->GetArticleListIncludingSubcategories();
} else {
$oArticleList = $this->GetArticleList();
}
return $oArticleList... | [
"public",
"function",
"GetNumberOfArticlesInCategory",
"(",
"$",
"bIncludeSubcategoriesInCount",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"bIncludeSubcategoriesInCount",
")",
"{",
"$",
"oArticleList",
"=",
"$",
"this",
"->",
"GetArticleListIncludingSubcategories",
"(",
... | returns a count of the number of articles in the category. the method caches
the data since a count is expensive.
@param bool $bIncludeSubcategoriesInCount
@return int | [
"returns",
"a",
"count",
"of",
"the",
"number",
"of",
"articles",
"in",
"the",
"category",
".",
"the",
"method",
"caches",
"the",
"data",
"since",
"a",
"count",
"is",
"expensive",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L162-L171 |
32,406 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.& | public function &GetParent()
{
$oParent = null;
if (!empty($this->fieldShopCategoryId)) {
$oParent = TdbShopCategory::GetNewInstance();
$oParent->SetLanguage($this->iLanguageId);
if (!$oParent->Load($this->fieldShopCategoryId)) {
$oParent = null;
... | php | public function &GetParent()
{
$oParent = null;
if (!empty($this->fieldShopCategoryId)) {
$oParent = TdbShopCategory::GetNewInstance();
$oParent->SetLanguage($this->iLanguageId);
if (!$oParent->Load($this->fieldShopCategoryId)) {
$oParent = null;
... | [
"public",
"function",
"&",
"GetParent",
"(",
")",
"{",
"$",
"oParent",
"=",
"null",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"fieldShopCategoryId",
")",
")",
"{",
"$",
"oParent",
"=",
"TdbShopCategory",
"::",
"GetNewInstance",
"(",
")",
";... | return the parent category, or null if no parent is found.
@return TdbShopCategory | [
"return",
"the",
"parent",
"category",
"or",
"null",
"if",
"no",
"parent",
"is",
"found",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L226-L238 |
32,407 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.IsInCategoryPath | public function IsInCategoryPath($sCategoryId)
{
$oBreadCrumb = $this->GetBreadcrumb();
$oMatchingNode = $oBreadCrumb->FindItemWithProperty('id', $sCategoryId);
if ($oMatchingNode) {
return true;
} else {
return false;
}
} | php | public function IsInCategoryPath($sCategoryId)
{
$oBreadCrumb = $this->GetBreadcrumb();
$oMatchingNode = $oBreadCrumb->FindItemWithProperty('id', $sCategoryId);
if ($oMatchingNode) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"IsInCategoryPath",
"(",
"$",
"sCategoryId",
")",
"{",
"$",
"oBreadCrumb",
"=",
"$",
"this",
"->",
"GetBreadcrumb",
"(",
")",
";",
"$",
"oMatchingNode",
"=",
"$",
"oBreadCrumb",
"->",
"FindItemWithProperty",
"(",
"'id'",
",",
"$",
"sCat... | return true if the category id passed is in the path to this category.
@param string $sCategoryId
@return bool | [
"return",
"true",
"if",
"the",
"category",
"id",
"passed",
"is",
"in",
"the",
"path",
"to",
"this",
"category",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L267-L276 |
32,408 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.GetCategoryPathAsString | public function GetCategoryPathAsString($sSeparator = '/')
{
$sKey = 'sCatPathCache'.$sSeparator;
$sPath = $this->GetFromInternalCache($sKey);
if (is_null($sPath)) {
$sPath = '';
$oParent = &$this->GetParent();
if ($oParent) {
$sPath = $oP... | php | public function GetCategoryPathAsString($sSeparator = '/')
{
$sKey = 'sCatPathCache'.$sSeparator;
$sPath = $this->GetFromInternalCache($sKey);
if (is_null($sPath)) {
$sPath = '';
$oParent = &$this->GetParent();
if ($oParent) {
$sPath = $oP... | [
"public",
"function",
"GetCategoryPathAsString",
"(",
"$",
"sSeparator",
"=",
"'/'",
")",
"{",
"$",
"sKey",
"=",
"'sCatPathCache'",
".",
"$",
"sSeparator",
";",
"$",
"sPath",
"=",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"$",
"sKey",
")",
";",
"if",... | return the category path as a string, each node separated by the sSeparator.
@param string $sSeparator
@return string | [
"return",
"the",
"category",
"path",
"as",
"a",
"string",
"each",
"node",
"separated",
"by",
"the",
"sSeparator",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L285-L304 |
32,409 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.& | public function &GetRootCategory()
{
$oRootCategory = &$this->GetFromInternalCache('oRootCategory');
if (is_null($oRootCategory)) {
$oRootCategory = clone $this;
while (!empty($oRootCategory->fieldShopCategoryId)) {
$oRootCategory = &$oRootCategory->GetParent(... | php | public function &GetRootCategory()
{
$oRootCategory = &$this->GetFromInternalCache('oRootCategory');
if (is_null($oRootCategory)) {
$oRootCategory = clone $this;
while (!empty($oRootCategory->fieldShopCategoryId)) {
$oRootCategory = &$oRootCategory->GetParent(... | [
"public",
"function",
"&",
"GetRootCategory",
"(",
")",
"{",
"$",
"oRootCategory",
"=",
"&",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oRootCategory'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oRootCategory",
")",
")",
"{",
"$",
"oRootCategory",
... | return the currents category root category.
@return TdbShopCategory | [
"return",
"the",
"currents",
"category",
"root",
"category",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L311-L323 |
32,410 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.& | public function &GetBreadcrumb()
{
$oBreadCrumb = &$this->GetFromInternalCache('oCategoryBreadcrumb');
if (is_null($oBreadCrumb)) {
$oBreadCrumb = &TdbShopCategoryList::GetCategoryPath($this->id, null, $this->GetLanguage());
$this->SetInternalCache('oCategoryBreadcrumb', $oBr... | php | public function &GetBreadcrumb()
{
$oBreadCrumb = &$this->GetFromInternalCache('oCategoryBreadcrumb');
if (is_null($oBreadCrumb)) {
$oBreadCrumb = &TdbShopCategoryList::GetCategoryPath($this->id, null, $this->GetLanguage());
$this->SetInternalCache('oCategoryBreadcrumb', $oBr... | [
"public",
"function",
"&",
"GetBreadcrumb",
"(",
")",
"{",
"$",
"oBreadCrumb",
"=",
"&",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oCategoryBreadcrumb'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oBreadCrumb",
")",
")",
"{",
"$",
"oBreadCrumb",
"=... | return a list of all categories to the current category.
@return TIterator | [
"return",
"a",
"list",
"of",
"all",
"categories",
"to",
"the",
"current",
"category",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L330-L341 |
32,411 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.AllowDisplayInShop | public function AllowDisplayInShop()
{
$bShowCat = false;
$oShop = TdbShop::GetInstance();
if (!is_null($oShop) && !$oShop->fieldShowEmptyCategories) {
$bShowCat = ($this->GetNumberOfArticlesInCategory(true) > 0);
} else {
$bShowCat = true;
}
... | php | public function AllowDisplayInShop()
{
$bShowCat = false;
$oShop = TdbShop::GetInstance();
if (!is_null($oShop) && !$oShop->fieldShowEmptyCategories) {
$bShowCat = ($this->GetNumberOfArticlesInCategory(true) > 0);
} else {
$bShowCat = true;
}
... | [
"public",
"function",
"AllowDisplayInShop",
"(",
")",
"{",
"$",
"bShowCat",
"=",
"false",
";",
"$",
"oShop",
"=",
"TdbShop",
"::",
"GetInstance",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"oShop",
")",
"&&",
"!",
"$",
"oShop",
"->",
"fieldS... | Hook for implementing category display logic.
@return bool | [
"Hook",
"for",
"implementing",
"category",
"display",
"logic",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L435-L460 |
32,412 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.GetSeoPattern | public function GetSeoPattern(&$sPaternIn)
{
//$sPaternIn = "[{PORTAL_NAME}] - [{CATEGORY_NAME}]"; //default
$aPatRepl = null;
if (!empty($this->sqlData['seo_pattern'])) {
$sPaternIn = $this->sqlData['seo_pattern'];
}
$aPatRepl = array();
$activePage = $... | php | public function GetSeoPattern(&$sPaternIn)
{
//$sPaternIn = "[{PORTAL_NAME}] - [{CATEGORY_NAME}]"; //default
$aPatRepl = null;
if (!empty($this->sqlData['seo_pattern'])) {
$sPaternIn = $this->sqlData['seo_pattern'];
}
$aPatRepl = array();
$activePage = $... | [
"public",
"function",
"GetSeoPattern",
"(",
"&",
"$",
"sPaternIn",
")",
"{",
"//$sPaternIn = \"[{PORTAL_NAME}] - [{CATEGORY_NAME}]\"; //default",
"$",
"aPatRepl",
"=",
"null",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"sqlData",
"[",
"'seo_pattern'",
"... | Get SEO pattern of actual article.
@param string $sPaternIn
@return array | [
"Get",
"SEO",
"pattern",
"of",
"actual",
"article",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L469-L485 |
32,413 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.GetProductNameExtensions | public function GetProductNameExtensions()
{
$sName = trim($this->fieldNameProduct);
if (empty($sName)) {
$sName = $this->fieldName;
}
return $sName;
} | php | public function GetProductNameExtensions()
{
$sName = trim($this->fieldNameProduct);
if (empty($sName)) {
$sName = $this->fieldName;
}
return $sName;
} | [
"public",
"function",
"GetProductNameExtensions",
"(",
")",
"{",
"$",
"sName",
"=",
"trim",
"(",
"$",
"this",
"->",
"fieldNameProduct",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"sName",
")",
")",
"{",
"$",
"sName",
"=",
"$",
"this",
"->",
"fieldName",
... | return the part of the category that should be used as part of the product name.
@return string | [
"return",
"the",
"part",
"of",
"the",
"category",
"that",
"should",
"be",
"used",
"as",
"part",
"of",
"the",
"product",
"name",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L500-L508 |
32,414 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.GetCurrentColorCode | public function GetCurrentColorCode($sDefaultColor = '000000')
{
$oRootCat = $this->GetRootCategory();
/** @var $oRootCat TdbShopCategory */
$sColorcode = $oRootCat->fieldColorcode;
if ('' == $sColorcode) {
$sColorcode = $sDefaultColor;
}
return $sColorco... | php | public function GetCurrentColorCode($sDefaultColor = '000000')
{
$oRootCat = $this->GetRootCategory();
/** @var $oRootCat TdbShopCategory */
$sColorcode = $oRootCat->fieldColorcode;
if ('' == $sColorcode) {
$sColorcode = $sDefaultColor;
}
return $sColorco... | [
"public",
"function",
"GetCurrentColorCode",
"(",
"$",
"sDefaultColor",
"=",
"'000000'",
")",
"{",
"$",
"oRootCat",
"=",
"$",
"this",
"->",
"GetRootCategory",
"(",
")",
";",
"/** @var $oRootCat TdbShopCategory */",
"$",
"sColorcode",
"=",
"$",
"oRootCat",
"->",
... | returns the category color.
@param string $sDefaultColor - default color = black;
@return string | [
"returns",
"the",
"category",
"color",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L517-L527 |
32,415 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopCategory.class.php | TShopCategory.parentCategoriesAreActive | public function parentCategoriesAreActive()
{
$treeIsActive = true;
$parentCategoryList = $this->getParentCategories();
while ($category = $parentCategoryList->Next()) {
if (false === $category->fieldActive) {
$treeIsActive = false;
break;
... | php | public function parentCategoriesAreActive()
{
$treeIsActive = true;
$parentCategoryList = $this->getParentCategories();
while ($category = $parentCategoryList->Next()) {
if (false === $category->fieldActive) {
$treeIsActive = false;
break;
... | [
"public",
"function",
"parentCategoriesAreActive",
"(",
")",
"{",
"$",
"treeIsActive",
"=",
"true",
";",
"$",
"parentCategoryList",
"=",
"$",
"this",
"->",
"getParentCategories",
"(",
")",
";",
"while",
"(",
"$",
"category",
"=",
"$",
"parentCategoryList",
"->... | return true if the tree until this category is active.
@return bool | [
"return",
"true",
"if",
"the",
"tree",
"until",
"this",
"category",
"is",
"active",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopCategory.class.php#L542-L554 |
32,416 | edmondscommerce/doctrine-static-meta | codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php | TemplateEntityUpserter.getUpsertDtoByCriteria | public function getUpsertDtoByCriteria(
array $criteria,
NewUpsertDtoDataModifierInterface $modifier
): TemplateEntityDto {
$entity = $this->repository->findOneBy($criteria);
if ($entity === null) {
$dto = $this->dtoFactory->create();
$modifier->addDataToNewly... | php | public function getUpsertDtoByCriteria(
array $criteria,
NewUpsertDtoDataModifierInterface $modifier
): TemplateEntityDto {
$entity = $this->repository->findOneBy($criteria);
if ($entity === null) {
$dto = $this->dtoFactory->create();
$modifier->addDataToNewly... | [
"public",
"function",
"getUpsertDtoByCriteria",
"(",
"array",
"$",
"criteria",
",",
"NewUpsertDtoDataModifierInterface",
"$",
"modifier",
")",
":",
"TemplateEntityDto",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"repository",
"->",
"findOneBy",
"(",
"$",
"criteri... | This method is used to get a DTO using search criteria, when you are not certain if the entity exists or not.
The criteria is passed through to the repository findOneBy method, if an entity is found then a DTO will be
created from it and returned.
If an entity is not found then a new empty DTO will be created and retu... | [
"This",
"method",
"is",
"used",
"to",
"get",
"a",
"DTO",
"using",
"search",
"criteria",
"when",
"you",
"are",
"not",
"certain",
"if",
"the",
"entity",
"exists",
"or",
"not",
".",
"The",
"criteria",
"is",
"passed",
"through",
"to",
"the",
"repository",
"f... | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php#L92-L105 |
32,417 | edmondscommerce/doctrine-static-meta | codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php | TemplateEntityUpserter.persistUpsertDto | public function persistUpsertDto(TemplateEntityDto $dto): TemplateEntityInterface
{
$entity = $this->convertUpsertDtoToEntity($dto);
$this->saver->save($entity);
return $entity;
} | php | public function persistUpsertDto(TemplateEntityDto $dto): TemplateEntityInterface
{
$entity = $this->convertUpsertDtoToEntity($dto);
$this->saver->save($entity);
return $entity;
} | [
"public",
"function",
"persistUpsertDto",
"(",
"TemplateEntityDto",
"$",
"dto",
")",
":",
"TemplateEntityInterface",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"convertUpsertDtoToEntity",
"(",
"$",
"dto",
")",
";",
"$",
"this",
"->",
"saver",
"->",
"save",
... | This is used to persist the DTO to the database. If the DTO is for a new entity then it will be created, if it
is for an existing Entity then it will be updated.
Be aware that this method should __only__ be used with DTOs that have been created using the
self::getUpsertDtoByCriteria method, as if they come from elsewh... | [
"This",
"is",
"used",
"to",
"persist",
"the",
"DTO",
"to",
"the",
"database",
".",
"If",
"the",
"DTO",
"is",
"for",
"a",
"new",
"entity",
"then",
"it",
"will",
"be",
"created",
"if",
"it",
"is",
"for",
"an",
"existing",
"Entity",
"then",
"it",
"will"... | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php#L127-L133 |
32,418 | edmondscommerce/doctrine-static-meta | codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php | TemplateEntityUpserter.convertUpsertDtoToEntity | public function convertUpsertDtoToEntity(TemplateEntityDto $dto): TemplateEntityInterface
{
if ($this->unitOfWorkHelper->hasRecordOfDto($dto) === false) {
$entity = $this->entityFactory->create($dto);
return $entity;
}
$entity = $this->unitOfWorkHelper->getEntityFrom... | php | public function convertUpsertDtoToEntity(TemplateEntityDto $dto): TemplateEntityInterface
{
if ($this->unitOfWorkHelper->hasRecordOfDto($dto) === false) {
$entity = $this->entityFactory->create($dto);
return $entity;
}
$entity = $this->unitOfWorkHelper->getEntityFrom... | [
"public",
"function",
"convertUpsertDtoToEntity",
"(",
"TemplateEntityDto",
"$",
"dto",
")",
":",
"TemplateEntityInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"unitOfWorkHelper",
"->",
"hasRecordOfDto",
"(",
"$",
"dto",
")",
"===",
"false",
")",
"{",
"$",
"en... | This method will convert the DTO into an entity, but will not save it. This is useful if you want to bulk create
or update entities
@param TemplateEntityDto $dto
@return TemplateEntityInterface | [
"This",
"method",
"will",
"convert",
"the",
"DTO",
"into",
"an",
"entity",
"but",
"will",
"not",
"save",
"it",
".",
"This",
"is",
"useful",
"if",
"you",
"want",
"to",
"bulk",
"create",
"or",
"update",
"entities"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php#L143-L154 |
32,419 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.AddArticle | public function AddArticle($sArticleId, $dAmount = 1, $sComment = null)
{
$dNewAmount = 0;
$aItemData = array();
$oItem = TdbPkgShopWishlistArticle::GetNewInstance();
/** @var $oItem TdbPkgShopWishlistArticle */
if ($oItem->LoadFromFields(array('pkg_shop_wishlist_id' => $this... | php | public function AddArticle($sArticleId, $dAmount = 1, $sComment = null)
{
$dNewAmount = 0;
$aItemData = array();
$oItem = TdbPkgShopWishlistArticle::GetNewInstance();
/** @var $oItem TdbPkgShopWishlistArticle */
if ($oItem->LoadFromFields(array('pkg_shop_wishlist_id' => $this... | [
"public",
"function",
"AddArticle",
"(",
"$",
"sArticleId",
",",
"$",
"dAmount",
"=",
"1",
",",
"$",
"sComment",
"=",
"null",
")",
"{",
"$",
"dNewAmount",
"=",
"0",
";",
"$",
"aItemData",
"=",
"array",
"(",
")",
";",
"$",
"oItem",
"=",
"TdbPkgShopWis... | adds an article to the wishlist - returns the new amount of that article on the list.
@param string $sArticleId
@param float $dAmount
@param string $sComment - optional comment
@return float | [
"adds",
"an",
"article",
"to",
"the",
"wishlist",
"-",
"returns",
"the",
"new",
"amount",
"of",
"that",
"article",
"on",
"the",
"list",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L27-L51 |
32,420 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.GetLink | public function GetLink($sMode = '', $aAdditionalParameter = array())
{
if (!empty($sMode)) {
$aAdditionalParameter[MTPkgShopWishlistCore::URL_MODE_PARAMETER_NAME] = $sMode;
}
$oShopConfig = TdbShop::GetInstance();
return $oShopConfig->GetLinkToSystemPage('wishlist', $aA... | php | public function GetLink($sMode = '', $aAdditionalParameter = array())
{
if (!empty($sMode)) {
$aAdditionalParameter[MTPkgShopWishlistCore::URL_MODE_PARAMETER_NAME] = $sMode;
}
$oShopConfig = TdbShop::GetInstance();
return $oShopConfig->GetLinkToSystemPage('wishlist', $aA... | [
"public",
"function",
"GetLink",
"(",
"$",
"sMode",
"=",
"''",
",",
"$",
"aAdditionalParameter",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"sMode",
")",
")",
"{",
"$",
"aAdditionalParameter",
"[",
"MTPkgShopWishlistCore",
"::",... | return link to the private view of the wishlist.
@param string $sMode - select a mode of the wishlist (such as SendForm)
@param array $aAdditionalParameter
@return string | [
"return",
"link",
"to",
"the",
"private",
"view",
"of",
"the",
"wishlist",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L95-L103 |
32,421 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.GetPublicLink | public function GetPublicLink($aAdditionalParameter = array())
{
$oShopConfig = TdbShop::GetInstance();
$aAdditionalParameter[MTPkgShopWishlistPublicCore::URL_PARAMETER_NAME] = array('id' => $this->id);
return $oShopConfig->GetLinkToSystemPage('wishlist-public', $aAdditionalParameter, true)... | php | public function GetPublicLink($aAdditionalParameter = array())
{
$oShopConfig = TdbShop::GetInstance();
$aAdditionalParameter[MTPkgShopWishlistPublicCore::URL_PARAMETER_NAME] = array('id' => $this->id);
return $oShopConfig->GetLinkToSystemPage('wishlist-public', $aAdditionalParameter, true)... | [
"public",
"function",
"GetPublicLink",
"(",
"$",
"aAdditionalParameter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"oShopConfig",
"=",
"TdbShop",
"::",
"GetInstance",
"(",
")",
";",
"$",
"aAdditionalParameter",
"[",
"MTPkgShopWishlistPublicCore",
"::",
"URL_PARAMETER... | return the public link to the wishlist.
@param array $aAdditionalParameter
@return string | [
"return",
"the",
"public",
"link",
"to",
"the",
"wishlist",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L112-L118 |
32,422 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.& | public function &GetFieldPkgShopWishlistArticleList()
{
$oWishlistItems = $this->GetFromInternalCache('oPkgShopWishlistArticleList');
if (is_null($oWishlistItems)) {
$oWishlistItems = TdbPkgShopWishlistArticleList::GetListForPkgShopWishlistId($this->id, $this->iLanguageId);
$... | php | public function &GetFieldPkgShopWishlistArticleList()
{
$oWishlistItems = $this->GetFromInternalCache('oPkgShopWishlistArticleList');
if (is_null($oWishlistItems)) {
$oWishlistItems = TdbPkgShopWishlistArticleList::GetListForPkgShopWishlistId($this->id, $this->iLanguageId);
$... | [
"public",
"function",
"&",
"GetFieldPkgShopWishlistArticleList",
"(",
")",
"{",
"$",
"oWishlistItems",
"=",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oPkgShopWishlistArticleList'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oWishlistItems",
")",
")",
"{",
... | Artikel der Wunschliste.
@return TdbPkgShopWishlistArticleList | [
"Artikel",
"der",
"Wunschliste",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L137-L148 |
32,423 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.& | public function &GetFieldPkgShopWishlistMailHistoryList()
{
$oWishlistHistoryItems = $this->GetFromInternalCache('oPkgShopWishlistMailHistoryList');
if (is_null($oWishlistHistoryItems)) {
$oWishlistHistoryItems = TdbPkgShopWishlistMailHistoryList::GetListForPkgShopWishlistId($this->id, $... | php | public function &GetFieldPkgShopWishlistMailHistoryList()
{
$oWishlistHistoryItems = $this->GetFromInternalCache('oPkgShopWishlistMailHistoryList');
if (is_null($oWishlistHistoryItems)) {
$oWishlistHistoryItems = TdbPkgShopWishlistMailHistoryList::GetListForPkgShopWishlistId($this->id, $... | [
"public",
"function",
"&",
"GetFieldPkgShopWishlistMailHistoryList",
"(",
")",
"{",
"$",
"oWishlistHistoryItems",
"=",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oPkgShopWishlistMailHistoryList'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oWishlistHistoryItems",... | Wunschslisten Mailhistory.
@return TdbPkgShopWishlistMailHistoryList | [
"Wunschslisten",
"Mailhistory",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L155-L165 |
32,424 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.GetDescriptionAsHTML | public function GetDescriptionAsHTML()
{
$sText = trim($this->fieldDescription);
$sText = TGlobal::OutHTML($sText);
$sText = nl2br($sText);
return $sText;
} | php | public function GetDescriptionAsHTML()
{
$sText = trim($this->fieldDescription);
$sText = TGlobal::OutHTML($sText);
$sText = nl2br($sText);
return $sText;
} | [
"public",
"function",
"GetDescriptionAsHTML",
"(",
")",
"{",
"$",
"sText",
"=",
"trim",
"(",
"$",
"this",
"->",
"fieldDescription",
")",
";",
"$",
"sText",
"=",
"TGlobal",
"::",
"OutHTML",
"(",
"$",
"sText",
")",
";",
"$",
"sText",
"=",
"nl2br",
"(",
... | return description text as html.
@return string | [
"return",
"description",
"text",
"as",
"html",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L186-L193 |
32,425 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php | TPkgShopWishlist.SendPerMail | public function SendPerMail($sToMail, $sToName, $sComment)
{
$bSendSuccess = false;
$oOwner = $this->GetFieldDataExtranetUser();
$oMail = TdbDataMailProfile::GetProfile('SendWishlist');
$aMailData = array('to_name' => $sToName, 'to_mail' => $sToMail, 'comment' => $sComment, 'sWishlis... | php | public function SendPerMail($sToMail, $sToName, $sComment)
{
$bSendSuccess = false;
$oOwner = $this->GetFieldDataExtranetUser();
$oMail = TdbDataMailProfile::GetProfile('SendWishlist');
$aMailData = array('to_name' => $sToName, 'to_mail' => $sToMail, 'comment' => $sComment, 'sWishlis... | [
"public",
"function",
"SendPerMail",
"(",
"$",
"sToMail",
",",
"$",
"sToName",
",",
"$",
"sComment",
")",
"{",
"$",
"bSendSuccess",
"=",
"false",
";",
"$",
"oOwner",
"=",
"$",
"this",
"->",
"GetFieldDataExtranetUser",
"(",
")",
";",
"$",
"oMail",
"=",
... | send the wishlist per mail to a user.
@param string $sToMail
@param string $sToName
@param string $sComment
@return bool | [
"send",
"the",
"wishlist",
"per",
"mail",
"to",
"a",
"user",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlist.class.php#L204-L226 |
32,426 | Erebot/Erebot | src/Event/Match/Source.php | Source.setSource | public function setSource($source)
{
if ($source !== null && !\Erebot\Utils::stringifiable($source)) {
throw new \Erebot\InvalidValueException('Not a valid nickname');
}
$this->source = $source;
} | php | public function setSource($source)
{
if ($source !== null && !\Erebot\Utils::stringifiable($source)) {
throw new \Erebot\InvalidValueException('Not a valid nickname');
}
$this->source = $source;
} | [
"public",
"function",
"setSource",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"$",
"source",
"!==",
"null",
"&&",
"!",
"\\",
"Erebot",
"\\",
"Utils",
"::",
"stringifiable",
"(",
"$",
"source",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"Inval... | Sets the source used in comparisons.
\param $source string|object
Source to match incoming events against.
\throw Erebot::InvalidValueException
The given source is invalid. | [
"Sets",
"the",
"source",
"used",
"in",
"comparisons",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Event/Match/Source.php#L70-L77 |
32,427 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.GetAdditionalViewVariables | protected function GetAdditionalViewVariables($sViewName, $sViewType)
{
$aViewVariables = parent::GetAdditionalViewVariables($sViewName, $sViewType);
if (!is_array($aViewVariables)) {
$aViewVariables = array();
}
$aViewVariables['PaymentHiddenInput'] = $this->GetPaymentPa... | php | protected function GetAdditionalViewVariables($sViewName, $sViewType)
{
$aViewVariables = parent::GetAdditionalViewVariables($sViewName, $sViewType);
if (!is_array($aViewVariables)) {
$aViewVariables = array();
}
$aViewVariables['PaymentHiddenInput'] = $this->GetPaymentPa... | [
"protected",
"function",
"GetAdditionalViewVariables",
"(",
"$",
"sViewName",
",",
"$",
"sViewType",
")",
"{",
"$",
"aViewVariables",
"=",
"parent",
"::",
"GetAdditionalViewVariables",
"(",
"$",
"sViewName",
",",
"$",
"sViewType",
")",
";",
"if",
"(",
"!",
"is... | added all needed parameter for a request to IPayment
use this method to add any variables to the render method that you may
require for some view.
@param string $sViewName - the view being requested
@param string $sViewType - the location of the view (Core, Custom-Core, Customer)
@return array | [
"added",
"all",
"needed",
"parameter",
"for",
"a",
"request",
"to",
"IPayment",
"use",
"this",
"method",
"to",
"add",
"any",
"variables",
"to",
"the",
"render",
"method",
"that",
"you",
"may",
"require",
"for",
"some",
"view",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L71-L83 |
32,428 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.GetPaymentParameter | protected function GetPaymentParameter()
{
$aParameter = array();
$sCurrency = $this->GetCurrencyIdentifier();
$oLocal = &TCMSLocal::GetActive();
$oShopBasket = TShopBasket::GetInstance();
$aParameter['merchantId'] = $this->GetTestLiveModeParameter('merchantId');
$aPa... | php | protected function GetPaymentParameter()
{
$aParameter = array();
$sCurrency = $this->GetCurrencyIdentifier();
$oLocal = &TCMSLocal::GetActive();
$oShopBasket = TShopBasket::GetInstance();
$aParameter['merchantId'] = $this->GetTestLiveModeParameter('merchantId');
$aPa... | [
"protected",
"function",
"GetPaymentParameter",
"(",
")",
"{",
"$",
"aParameter",
"=",
"array",
"(",
")",
";",
"$",
"sCurrency",
"=",
"$",
"this",
"->",
"GetCurrencyIdentifier",
"(",
")",
";",
"$",
"oLocal",
"=",
"&",
"TCMSLocal",
"::",
"GetActive",
"(",
... | Get hidden field parameter needed for payment.
@return array | [
"Get",
"hidden",
"field",
"parameter",
"needed",
"for",
"payment",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L191-L209 |
32,429 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.CheckAuthorisationResponse | protected function CheckAuthorisationResponse($sMessageConsumer = '')
{
$bResponseSuccessful = false;
if (empty($sMessageConsumer)) {
$sMessageConsumer = $this->GetMsgManagerName();
}
$sReturnMessage = $this->GetErrorCodesFromResponse();
if (!empty($sReturnMessage... | php | protected function CheckAuthorisationResponse($sMessageConsumer = '')
{
$bResponseSuccessful = false;
if (empty($sMessageConsumer)) {
$sMessageConsumer = $this->GetMsgManagerName();
}
$sReturnMessage = $this->GetErrorCodesFromResponse();
if (!empty($sReturnMessage... | [
"protected",
"function",
"CheckAuthorisationResponse",
"(",
"$",
"sMessageConsumer",
"=",
"''",
")",
"{",
"$",
"bResponseSuccessful",
"=",
"false",
";",
"if",
"(",
"empty",
"(",
"$",
"sMessageConsumer",
")",
")",
"{",
"$",
"sMessageConsumer",
"=",
"$",
"this",... | if request to DataTrans was not successfully create a error message.
@param string $sMessageConsumer
@return bool | [
"if",
"request",
"to",
"DataTrans",
"was",
"not",
"successfully",
"create",
"a",
"error",
"message",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L239-L254 |
32,430 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.ExecuteDataTransPaymentCall | protected function ExecuteDataTransPaymentCall(TdbShopOrder &$oOrder)
{
$sXMLSettlement = $this->GetXMLSettlement();
$ch = curl_init();
$settlementurl = trim($this->GetTestLiveModeParameter('settlementurl'));
curl_setopt($ch, CURLOPT_URL, $settlementurl);
curl_setopt($ch, CUR... | php | protected function ExecuteDataTransPaymentCall(TdbShopOrder &$oOrder)
{
$sXMLSettlement = $this->GetXMLSettlement();
$ch = curl_init();
$settlementurl = trim($this->GetTestLiveModeParameter('settlementurl'));
curl_setopt($ch, CURLOPT_URL, $settlementurl);
curl_setopt($ch, CUR... | [
"protected",
"function",
"ExecuteDataTransPaymentCall",
"(",
"TdbShopOrder",
"&",
"$",
"oOrder",
")",
"{",
"$",
"sXMLSettlement",
"=",
"$",
"this",
"->",
"GetXMLSettlement",
"(",
")",
";",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"$",
"settlementurl",
"="... | Send settlement for authorised transaction.
@param \TdbShopOrder $oOrder
@return bool | [
"Send",
"settlement",
"for",
"authorised",
"transaction",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L478-L510 |
32,431 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.SendFailureSettlementMail | protected function SendFailureSettlementMail(TdbShopOrder &$oOrder)
{
$bSendMail = false;
$oMail = TdbDataMailProfile::GetProfile('payment_datatrans_error_settlement');
if (!is_null($oMail)) {
$sInfo = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.payment_data_trans.... | php | protected function SendFailureSettlementMail(TdbShopOrder &$oOrder)
{
$bSendMail = false;
$oMail = TdbDataMailProfile::GetProfile('payment_datatrans_error_settlement');
if (!is_null($oMail)) {
$sInfo = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.payment_data_trans.... | [
"protected",
"function",
"SendFailureSettlementMail",
"(",
"TdbShopOrder",
"&",
"$",
"oOrder",
")",
"{",
"$",
"bSendMail",
"=",
"false",
";",
"$",
"oMail",
"=",
"TdbDataMailProfile",
"::",
"GetProfile",
"(",
"'payment_datatrans_error_settlement'",
")",
";",
"if",
... | Sends email to shop owner to settle transaction manually.
@param TdbShopOrder $oOrder
@return bool | [
"Sends",
"email",
"to",
"shop",
"owner",
"to",
"settle",
"transaction",
"manually",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L519-L535 |
32,432 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.SettlementResponseSuccess | protected function SettlementResponseSuccess($sResponse)
{
$bSettlementResponseSuccess = true;
$sRefNo = $this->GetRefNoParameter(false);
$oXML = simplexml_load_string($sResponse);
if (isset($oXML->body->transaction->response)) {
TTools::WriteLogEntrySimple('Payment DataT... | php | protected function SettlementResponseSuccess($sResponse)
{
$bSettlementResponseSuccess = true;
$sRefNo = $this->GetRefNoParameter(false);
$oXML = simplexml_load_string($sResponse);
if (isset($oXML->body->transaction->response)) {
TTools::WriteLogEntrySimple('Payment DataT... | [
"protected",
"function",
"SettlementResponseSuccess",
"(",
"$",
"sResponse",
")",
"{",
"$",
"bSettlementResponseSuccess",
"=",
"true",
";",
"$",
"sRefNo",
"=",
"$",
"this",
"->",
"GetRefNoParameter",
"(",
"false",
")",
";",
"$",
"oXML",
"=",
"simplexml_load_stri... | Checks the response from settlement request.
No sign check on settlement response because DataTrans do not send sign in settlement response.
@param $sResponse
@return bool | [
"Checks",
"the",
"response",
"from",
"settlement",
"request",
".",
"No",
"sign",
"check",
"on",
"settlement",
"response",
"because",
"DataTrans",
"do",
"not",
"send",
"sign",
"in",
"settlement",
"response",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L545-L573 |
32,433 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.GetXMLSettlement | protected function GetXMLSettlement()
{
$oShopBasket = TShopBasket::GetInstance();
$sMerchantId = $this->GetTestLiveModeParameter('merchantId');
$sRefNo = $this->GetRefNoParameter(false);
$sCurrency = $this->GetCurrencyIdentifier();
$oLocal = &TCMSLocal::GetActive();
... | php | protected function GetXMLSettlement()
{
$oShopBasket = TShopBasket::GetInstance();
$sMerchantId = $this->GetTestLiveModeParameter('merchantId');
$sRefNo = $this->GetRefNoParameter(false);
$sCurrency = $this->GetCurrencyIdentifier();
$oLocal = &TCMSLocal::GetActive();
... | [
"protected",
"function",
"GetXMLSettlement",
"(",
")",
"{",
"$",
"oShopBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"sMerchantId",
"=",
"$",
"this",
"->",
"GetTestLiveModeParameter",
"(",
"'merchantId'",
")",
";",
"$",
"sRefNo",
"=",
... | Returns the xml request valeu for settlement.
@return string | [
"Returns",
"the",
"xml",
"request",
"valeu",
"for",
"settlement",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L580-L604 |
32,434 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php | TShopPaymentHandlerDataTrans.hexstr | protected function hexstr($hex)
{
$string = '';
for ($i = 0; $i < strlen($hex) - 1; $i += 2) {
$string .= chr(hexdec($hex[$i].$hex[$i + 1]));
}
return $string;
} | php | protected function hexstr($hex)
{
$string = '';
for ($i = 0; $i < strlen($hex) - 1; $i += 2) {
$string .= chr(hexdec($hex[$i].$hex[$i + 1]));
}
return $string;
} | [
"protected",
"function",
"hexstr",
"(",
"$",
"hex",
")",
"{",
"$",
"string",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"strlen",
"(",
"$",
"hex",
")",
"-",
"1",
";",
"$",
"i",
"+=",
"2",
")",
"{",
"$",
"string",
... | Converts hex to string. Was needed for the sign check.
@param $hex
@return string | [
"Converts",
"hex",
"to",
"string",
".",
"Was",
"needed",
"for",
"the",
"sign",
"check",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans.class.php#L631-L639 |
32,435 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php | TShopStepShippingCore.ChangeShippingGroup | public function ChangeShippingGroup()
{
$oBasket = TShopBasket::GetInstance();
$this->oActiveShippingGroup = $oBasket->GetActiveShippingGroup();
// check if the group is still valid. if not, reload using default
if (!$this->oActiveShippingGroup || false == $this->oActiveShippingGroup... | php | public function ChangeShippingGroup()
{
$oBasket = TShopBasket::GetInstance();
$this->oActiveShippingGroup = $oBasket->GetActiveShippingGroup();
// check if the group is still valid. if not, reload using default
if (!$this->oActiveShippingGroup || false == $this->oActiveShippingGroup... | [
"public",
"function",
"ChangeShippingGroup",
"(",
")",
"{",
"$",
"oBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"this",
"->",
"oActiveShippingGroup",
"=",
"$",
"oBasket",
"->",
"GetActiveShippingGroup",
"(",
")",
";",
"// check if the gr... | changes the shipping group to the one passed via post or get in
shippinggroupid=id. | [
"changes",
"the",
"shipping",
"group",
"to",
"the",
"one",
"passed",
"via",
"post",
"or",
"get",
"in",
"shippinggroupid",
"=",
"id",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php#L221-L246 |
32,436 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php | TShopStepShippingCore.LoadActivePaymentMethod | protected function LoadActivePaymentMethod()
{
$oBasket = TShopBasket::GetInstance();
$this->oActivePaymentMethod = &$oBasket->GetActivePaymentMethod();
if (!is_null($this->oActiveShippingGroup)) {
$iPaymentId = null;
$bSelectionValid = true;
if (array_key... | php | protected function LoadActivePaymentMethod()
{
$oBasket = TShopBasket::GetInstance();
$this->oActivePaymentMethod = &$oBasket->GetActivePaymentMethod();
if (!is_null($this->oActiveShippingGroup)) {
$iPaymentId = null;
$bSelectionValid = true;
if (array_key... | [
"protected",
"function",
"LoadActivePaymentMethod",
"(",
")",
"{",
"$",
"oBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"this",
"->",
"oActivePaymentMethod",
"=",
"&",
"$",
"oBasket",
"->",
"GetActivePaymentMethod",
"(",
")",
";",
"if",... | loads the active payment method. | [
"loads",
"the",
"active",
"payment",
"method",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php#L251-L296 |
32,437 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php | TShopStepShippingCore.GetHtmlHeadIncludes | public function GetHtmlHeadIncludes()
{
$aIncludes = parent::GetHtmlHeadIncludes();
if (isset($this->oActiveShippingGroup)) {
$oPaymentMethodList = TShopBasket::GetInstance()->GetAvailablePaymentMethods();
if ($oPaymentMethodList) {
while ($oPaymentMethod = $... | php | public function GetHtmlHeadIncludes()
{
$aIncludes = parent::GetHtmlHeadIncludes();
if (isset($this->oActiveShippingGroup)) {
$oPaymentMethodList = TShopBasket::GetInstance()->GetAvailablePaymentMethods();
if ($oPaymentMethodList) {
while ($oPaymentMethod = $... | [
"public",
"function",
"GetHtmlHeadIncludes",
"(",
")",
"{",
"$",
"aIncludes",
"=",
"parent",
"::",
"GetHtmlHeadIncludes",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"oActiveShippingGroup",
")",
")",
"{",
"$",
"oPaymentMethodList",
"=",
"TShop... | define any head includes the step needs
loads includes from payment handlers.
@return array | [
"define",
"any",
"head",
"includes",
"the",
"step",
"needs",
"loads",
"includes",
"from",
"payment",
"handlers",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopOrderStep/TShopStepShippingCore.class.php#L321-L342 |
32,438 | chameleon-system/chameleon-shop | src/ShopBundle/pkgExtranet/objects/db/TShopDataExtranetCore.class.php | TShopDataExtranetCore.GetLinkLogout | public function GetLinkLogout($sSpotName)
{
$oGlobal = TGlobal::instance();
// if we are on the last page of checkout process we can't use the active page url for logout
// so we redirect to the home url with logout method as parameter
if ($oGlobal->UserDataExists(MTShopOrderWizardCo... | php | public function GetLinkLogout($sSpotName)
{
$oGlobal = TGlobal::instance();
// if we are on the last page of checkout process we can't use the active page url for logout
// so we redirect to the home url with logout method as parameter
if ($oGlobal->UserDataExists(MTShopOrderWizardCo... | [
"public",
"function",
"GetLinkLogout",
"(",
"$",
"sSpotName",
")",
"{",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"// if we are on the last page of checkout process we can't use the active page url for logout",
"// so we redirect to the home url with logout... | returns link to current page with logout method as parameter for given spotname of extranet module if not on "thank you" page of order process
otherwise it would return link to home page with logout method as parameter for given spotname.
@param $sSpotName
@return string | [
"returns",
"link",
"to",
"current",
"page",
"with",
"logout",
"method",
"as",
"parameter",
"for",
"given",
"spotname",
"of",
"extranet",
"module",
"if",
"not",
"on",
"thank",
"you",
"page",
"of",
"order",
"process",
"otherwise",
"it",
"would",
"return",
"lin... | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/pkgExtranet/objects/db/TShopDataExtranetCore.class.php#L22-L32 |
32,439 | PGB-LIV/php-ms | src/Utility/Fragment/AbstractFragment.php | AbstractFragment.getChargedIon | protected function getChargedIon($mass, $charge)
{
$chargedMass = $mass + (PhysicalConstants::PROTON_MASS * $charge);
return $chargedMass / $charge;
} | php | protected function getChargedIon($mass, $charge)
{
$chargedMass = $mass + (PhysicalConstants::PROTON_MASS * $charge);
return $chargedMass / $charge;
} | [
"protected",
"function",
"getChargedIon",
"(",
"$",
"mass",
",",
"$",
"charge",
")",
"{",
"$",
"chargedMass",
"=",
"$",
"mass",
"+",
"(",
"PhysicalConstants",
"::",
"PROTON_MASS",
"*",
"$",
"charge",
")",
";",
"return",
"$",
"chargedMass",
"/",
"$",
"cha... | Charges the mass to the specified charge
@param double $mass
The neutral mass to charge
@param int $charge
The integer charge value to charge too
@return double | [
"Charges",
"the",
"mass",
"to",
"the",
"specified",
"charge"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Utility/Fragment/AbstractFragment.php#L177-L181 |
32,440 | Erebot/Erebot | src/Proxy/SOCKS.php | SOCKS.userpass | protected function userpass(\Erebot\URIInterface $proxyURI)
{
$username = $proxyURI->asParsedURL(PHP_URL_USER);
$password = $proxyURI->asParsedURL(PHP_URL_PASS);
if ($username === null || $password === null) {
throw new \Erebot\InvalidValueException(
'No username... | php | protected function userpass(\Erebot\URIInterface $proxyURI)
{
$username = $proxyURI->asParsedURL(PHP_URL_USER);
$password = $proxyURI->asParsedURL(PHP_URL_PASS);
if ($username === null || $password === null) {
throw new \Erebot\InvalidValueException(
'No username... | [
"protected",
"function",
"userpass",
"(",
"\\",
"Erebot",
"\\",
"URIInterface",
"$",
"proxyURI",
")",
"{",
"$",
"username",
"=",
"$",
"proxyURI",
"->",
"asParsedURL",
"(",
"PHP_URL_USER",
")",
";",
"$",
"password",
"=",
"$",
"proxyURI",
"->",
"asParsedURL",
... | Does the authentication step.
\param Erebot::URIInterface $proxyURI
An object representing the URI of this SOCKS proxy server,
containing the credentials that will be sent during the
authentication step. | [
"Does",
"the",
"authentication",
"step",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Proxy/SOCKS.php#L123-L168 |
32,441 | Erebot/Erebot | src/Proxy/SOCKS.php | SOCKS.write | protected function write($line)
{
for ($written = 0, $len = strlen($line); $written < $len; $written += $fwrite) {
$fwrite = fwrite($this->socket, substr($line, $written));
if ($fwrite === false) {
throw new \Erebot\Exception('Connection closed by proxy');
... | php | protected function write($line)
{
for ($written = 0, $len = strlen($line); $written < $len; $written += $fwrite) {
$fwrite = fwrite($this->socket, substr($line, $written));
if ($fwrite === false) {
throw new \Erebot\Exception('Connection closed by proxy');
... | [
"protected",
"function",
"write",
"(",
"$",
"line",
")",
"{",
"for",
"(",
"$",
"written",
"=",
"0",
",",
"$",
"len",
"=",
"strlen",
"(",
"$",
"line",
")",
";",
"$",
"written",
"<",
"$",
"len",
";",
"$",
"written",
"+=",
"$",
"fwrite",
")",
"{",... | Passes some data to the proxy server.
\param string $line
Data to send.
\retval int
Number of bytes actually sent (this may be lower
that the length of the initial $line if some bytes
could not be sent). | [
"Passes",
"some",
"data",
"to",
"the",
"proxy",
"server",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Proxy/SOCKS.php#L181-L190 |
32,442 | Erebot/Erebot | src/Proxy/SOCKS.php | SOCKS.read | protected function read($len)
{
$contents = "";
$clen = 0;
while (!feof($this->socket) && $clen < $len) {
$read = fread($this->socket, $len - $clen);
if ($read === false) {
throw new \Erebot\Exception('Connection closed by proxy');
... | php | protected function read($len)
{
$contents = "";
$clen = 0;
while (!feof($this->socket) && $clen < $len) {
$read = fread($this->socket, $len - $clen);
if ($read === false) {
throw new \Erebot\Exception('Connection closed by proxy');
... | [
"protected",
"function",
"read",
"(",
"$",
"len",
")",
"{",
"$",
"contents",
"=",
"\"\"",
";",
"$",
"clen",
"=",
"0",
";",
"while",
"(",
"!",
"feof",
"(",
"$",
"this",
"->",
"socket",
")",
"&&",
"$",
"clen",
"<",
"$",
"len",
")",
"{",
"$",
"r... | Reads some data from the proxy server.
\param int $len
Number of bytes to read from the proxy server.
\retval string
Actual data read. | [
"Reads",
"some",
"data",
"from",
"the",
"proxy",
"server",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Proxy/SOCKS.php#L201-L214 |
32,443 | chameleon-system/chameleon-shop | src/ShopBundle/objects/ArticleList/State.php | State.getStateString | public function getStateString(array $varyingStateParameter = null)
{
$stateInput = $this->getStateArrayWithoutQueryParameter();
$parts = array();
foreach ($stateInput as $key => $value) {
if (null !== $varyingStateParameter && in_array($key, $varyingStateParameter)) {
... | php | public function getStateString(array $varyingStateParameter = null)
{
$stateInput = $this->getStateArrayWithoutQueryParameter();
$parts = array();
foreach ($stateInput as $key => $value) {
if (null !== $varyingStateParameter && in_array($key, $varyingStateParameter)) {
... | [
"public",
"function",
"getStateString",
"(",
"array",
"$",
"varyingStateParameter",
"=",
"null",
")",
"{",
"$",
"stateInput",
"=",
"$",
"this",
"->",
"getStateArrayWithoutQueryParameter",
"(",
")",
";",
"$",
"parts",
"=",
"array",
"(",
")",
";",
"foreach",
"... | returns a string representation of the state, excluding the parameter specified by varyingStateParameter.
@param array|null $varyingStateParameter
@return string | [
"returns",
"a",
"string",
"representation",
"of",
"the",
"state",
"excluding",
"the",
"parameter",
"specified",
"by",
"varyingStateParameter",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/ArticleList/State.php#L79-L95 |
32,444 | chameleon-system/chameleon-shop | src/ShopBundle/objects/ArticleList/State.php | State.setUnsetStatesOnly | public function setUnsetStatesOnly(array $stateValues)
{
foreach ($stateValues as $key => $value) {
if (null === $this->getState($key, null)) {
$this->setState($key, $value);
}
}
} | php | public function setUnsetStatesOnly(array $stateValues)
{
foreach ($stateValues as $key => $value) {
if (null === $this->getState($key, null)) {
$this->setState($key, $value);
}
}
} | [
"public",
"function",
"setUnsetStatesOnly",
"(",
"array",
"$",
"stateValues",
")",
"{",
"foreach",
"(",
"$",
"stateValues",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getState",
"(",
"$",
"key",
",",
... | sets values in stateValues that have no value in the current state. ignores all others.
@param array $stateValues | [
"sets",
"values",
"in",
"stateValues",
"that",
"have",
"no",
"value",
"in",
"the",
"current",
"state",
".",
"ignores",
"all",
"others",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/ArticleList/State.php#L171-L178 |
32,445 | flash-global/mailer-common | src/Entity/Attachment.php | Attachment.getId | public function getId()
{
if (is_null($this->id)) {
$this->id = md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true)) . '@mailer.generated';
}
return $this->id;
} | php | public function getId()
{
if (is_null($this->id)) {
$this->id = md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true)) . '@mailer.generated';
}
return $this->id;
} | [
"public",
"function",
"getId",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"id",
")",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"md5",
"(",
"getmypid",
"(",
")",
".",
"'.'",
".",
"time",
"(",
")",
".",
"'.'",
".",
"uniqid",
"("... | Get attachment ID
@return string | [
"Get",
"attachment",
"ID"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Attachment.php#L90-L97 |
32,446 | flash-global/mailer-common | src/Entity/Attachment.php | Attachment.getMimeType | public function getMimeType()
{
if (empty($this->mimeType)) {
$resource = finfo_open(FILEINFO_MIME_TYPE);
$this->mimeType = finfo_file($resource, $this->getRealPath());
}
return $this->mimeType;
} | php | public function getMimeType()
{
if (empty($this->mimeType)) {
$resource = finfo_open(FILEINFO_MIME_TYPE);
$this->mimeType = finfo_file($resource, $this->getRealPath());
}
return $this->mimeType;
} | [
"public",
"function",
"getMimeType",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mimeType",
")",
")",
"{",
"$",
"resource",
"=",
"finfo_open",
"(",
"FILEINFO_MIME_TYPE",
")",
";",
"$",
"this",
"->",
"mimeType",
"=",
"finfo_file",
"(",
"... | Get Mime Type
@return string | [
"Get",
"Mime",
"Type"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Attachment.php#L128-L136 |
32,447 | flash-global/mailer-common | src/Validator/MailValidator.php | MailValidator.validateAddress | public function validateAddress($address, $field, $isRequired = true)
{
if ($isRequired && empty($address)) {
$this->addError($field, sprintf('%s is empty', ucfirst($field)));
return false;
}
$validator = new EmailValidator();
$validation = new RFCValidation(... | php | public function validateAddress($address, $field, $isRequired = true)
{
if ($isRequired && empty($address)) {
$this->addError($field, sprintf('%s is empty', ucfirst($field)));
return false;
}
$validator = new EmailValidator();
$validation = new RFCValidation(... | [
"public",
"function",
"validateAddress",
"(",
"$",
"address",
",",
"$",
"field",
",",
"$",
"isRequired",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"isRequired",
"&&",
"empty",
"(",
"$",
"address",
")",
")",
"{",
"$",
"this",
"->",
"addError",
"(",
"$",
... | Validate address fields
@param array $address
@param string $field
@param bool $isRequired
@return bool | [
"Validate",
"address",
"fields"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Validator/MailValidator.php#L93-L124 |
32,448 | flash-global/mailer-common | src/Entity/Mail.php | Mail.getContext | public function getContext()
{
return array_filter(array(
'subject' => $this->getSubject(),
'from' => $this->addressToString((array) $this->getSender()),
'to' => $this->addressToString((array) $this->getRecipients()),
'cc' => $this->addressToString((array) $th... | php | public function getContext()
{
return array_filter(array(
'subject' => $this->getSubject(),
'from' => $this->addressToString((array) $this->getSender()),
'to' => $this->addressToString((array) $this->getRecipients()),
'cc' => $this->addressToString((array) $th... | [
"public",
"function",
"getContext",
"(",
")",
"{",
"return",
"array_filter",
"(",
"array",
"(",
"'subject'",
"=>",
"$",
"this",
"->",
"getSubject",
"(",
")",
",",
"'from'",
"=>",
"$",
"this",
"->",
"addressToString",
"(",
"(",
"array",
")",
"$",
"this",
... | Get mail context
@return array | [
"Get",
"mail",
"context"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Mail.php#L420-L429 |
32,449 | flash-global/mailer-common | src/Entity/Mail.php | Mail.initAddress | protected function initAddress(array $address, $field)
{
$this->{$this->methodName('clear', $field)}();
foreach ($address as $email => $label) {
if (is_int($email)) {
$email = $label;
}
$this->{$this->methodName('add', $field)}($email, $label);
... | php | protected function initAddress(array $address, $field)
{
$this->{$this->methodName('clear', $field)}();
foreach ($address as $email => $label) {
if (is_int($email)) {
$email = $label;
}
$this->{$this->methodName('add', $field)}($email, $label);
... | [
"protected",
"function",
"initAddress",
"(",
"array",
"$",
"address",
",",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"{",
"$",
"this",
"->",
"methodName",
"(",
"'clear'",
",",
"$",
"field",
")",
"}",
"(",
")",
";",
"foreach",
"(",
"$",
"address",
... | Set address purpose property
@param array $address
@param string $field | [
"Set",
"address",
"purpose",
"property"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Mail.php#L437-L448 |
32,450 | flash-global/mailer-common | src/Entity/Mail.php | Mail.addAddress | protected function addAddress($address, $label, $field)
{
$label = is_string($label) ? trim($label) : $label;
$address = is_string($address) ? trim($address) : $label;
$label = $label ?: $address;
if (!empty($address)) {
$this->{$field}[$address] = $label;
}
... | php | protected function addAddress($address, $label, $field)
{
$label = is_string($label) ? trim($label) : $label;
$address = is_string($address) ? trim($address) : $label;
$label = $label ?: $address;
if (!empty($address)) {
$this->{$field}[$address] = $label;
}
... | [
"protected",
"function",
"addAddress",
"(",
"$",
"address",
",",
"$",
"label",
",",
"$",
"field",
")",
"{",
"$",
"label",
"=",
"is_string",
"(",
"$",
"label",
")",
"?",
"trim",
"(",
"$",
"label",
")",
":",
"$",
"label",
";",
"$",
"address",
"=",
... | Add a address in a array property
@param string $address
@param string $label
@param string $field | [
"Add",
"a",
"address",
"in",
"a",
"array",
"property"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Mail.php#L457-L467 |
32,451 | flash-global/mailer-common | src/Entity/Mail.php | Mail.formatAddress | protected function formatAddress($address)
{
if (is_array($address)) {
$email = is_int(key($address)) ? current($address) : key($address);
return array($email => current($address));
}
return array($address => $address);
} | php | protected function formatAddress($address)
{
if (is_array($address)) {
$email = is_int(key($address)) ? current($address) : key($address);
return array($email => current($address));
}
return array($address => $address);
} | [
"protected",
"function",
"formatAddress",
"(",
"$",
"address",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"address",
")",
")",
"{",
"$",
"email",
"=",
"is_int",
"(",
"key",
"(",
"$",
"address",
")",
")",
"?",
"current",
"(",
"$",
"address",
")",
":... | Format a address
@param string|array $address
@return array | [
"Format",
"a",
"address"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Mail.php#L476-L484 |
32,452 | flash-global/mailer-common | src/Entity/Mail.php | Mail.addressToString | protected function addressToString(array $field)
{
$address = array();
foreach ($field as $key => $value) {
$address[] = $key == $value ? $value : sprintf('%s <%s>', $value, $key);
}
return empty($address) ? null : implode(', ', $address);
} | php | protected function addressToString(array $field)
{
$address = array();
foreach ($field as $key => $value) {
$address[] = $key == $value ? $value : sprintf('%s <%s>', $value, $key);
}
return empty($address) ? null : implode(', ', $address);
} | [
"protected",
"function",
"addressToString",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"address",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"field",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"address",
"[",
"]",
"=",
"$",
"key",
... | Convert address container to a string representation
@param array $field
@return string | [
"Convert",
"address",
"container",
"to",
"a",
"string",
"representation"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Mail.php#L493-L501 |
32,453 | flash-global/mailer-common | src/Entity/Mail.php | Mail.methodName | protected function methodName($action, $field)
{
if (substr($field, -1, 1) === 's' && $action != 'clear') {
$field = substr($field, 0, -1);
}
return $action . ucfirst(strtolower($field));
} | php | protected function methodName($action, $field)
{
if (substr($field, -1, 1) === 's' && $action != 'clear') {
$field = substr($field, 0, -1);
}
return $action . ucfirst(strtolower($field));
} | [
"protected",
"function",
"methodName",
"(",
"$",
"action",
",",
"$",
"field",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"field",
",",
"-",
"1",
",",
"1",
")",
"===",
"'s'",
"&&",
"$",
"action",
"!=",
"'clear'",
")",
"{",
"$",
"field",
"=",
"substr... | Returns the method name given a action and a field name
@param $action
@param $field
@return string | [
"Returns",
"the",
"method",
"name",
"given",
"a",
"action",
"and",
"a",
"field",
"name"
] | 3240ca53570d9b346af8087c9b32d4883f3383ce | https://github.com/flash-global/mailer-common/blob/3240ca53570d9b346af8087c9b32d4883f3383ce/src/Entity/Mail.php#L511-L518 |
32,454 | widop/WidopHttpAdapterBundle | DependencyInjection/WidopHttpAdapterExtension.php | WidopHttpAdapterExtension.loadMaxRedirects | private function loadMaxRedirects(array $config, ContainerBuilder $container)
{
$services = array('buzz', 'curl', 'guzzle', 'stream', 'zend');
foreach ($services as $service) {
$container
->getDefinition(sprintf('widop_http_adapter.%s', $service))
->addMe... | php | private function loadMaxRedirects(array $config, ContainerBuilder $container)
{
$services = array('buzz', 'curl', 'guzzle', 'stream', 'zend');
foreach ($services as $service) {
$container
->getDefinition(sprintf('widop_http_adapter.%s', $service))
->addMe... | [
"private",
"function",
"loadMaxRedirects",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"services",
"=",
"array",
"(",
"'buzz'",
",",
"'curl'",
",",
"'guzzle'",
",",
"'stream'",
",",
"'zend'",
")",
";",
"foreach",
... | Loads the max redirects in all http adapters.
@param array $config The configuration.
@param \Symfony\Component\DependencyInjection\ContainerBuilder $container The container. | [
"Loads",
"the",
"max",
"redirects",
"in",
"all",
"http",
"adapters",
"."
] | f8ff24f423ee8db7ba0a72eecafcf53dcb453d79 | https://github.com/widop/WidopHttpAdapterBundle/blob/f8ff24f423ee8db7ba0a72eecafcf53dcb453d79/DependencyInjection/WidopHttpAdapterExtension.php#L44-L53 |
32,455 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/ListenerPattern.php | ListenerPattern.bind | public function bind(EventDispatcherInterface $dispatcher, $eventName)
{
if (isset($this->events[$eventName])) {
return;
}
$dispatcher->addListener($eventName, $this->getListener(), $this->priority);
$this->events[$eventName] = true;
} | php | public function bind(EventDispatcherInterface $dispatcher, $eventName)
{
if (isset($this->events[$eventName])) {
return;
}
$dispatcher->addListener($eventName, $this->getListener(), $this->priority);
$this->events[$eventName] = true;
} | [
"public",
"function",
"bind",
"(",
"EventDispatcherInterface",
"$",
"dispatcher",
",",
"$",
"eventName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"events",
"[",
"$",
"eventName",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"dispatcher",
"... | Adds this pattern's listener to an event.
@param EventDispatcherInterface $dispatcher
@param string $eventName | [
"Adds",
"this",
"pattern",
"s",
"listener",
"to",
"an",
"event",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/ListenerPattern.php#L58-L66 |
32,456 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/ListenerPattern.php | ListenerPattern.unbind | public function unbind(EventDispatcherInterface $dispatcher)
{
foreach ($this->events as $eventName => $_) {
$dispatcher->removeListener($eventName, $this->getListener());
}
$this->events = array();
} | php | public function unbind(EventDispatcherInterface $dispatcher)
{
foreach ($this->events as $eventName => $_) {
$dispatcher->removeListener($eventName, $this->getListener());
}
$this->events = array();
} | [
"public",
"function",
"unbind",
"(",
"EventDispatcherInterface",
"$",
"dispatcher",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"events",
"as",
"$",
"eventName",
"=>",
"$",
"_",
")",
"{",
"$",
"dispatcher",
"->",
"removeListener",
"(",
"$",
"eventName",
"... | Removes this pattern's listener from all events to which it was
previously added.
@param EventDispatcherInterface $dispatcher | [
"Removes",
"this",
"pattern",
"s",
"listener",
"from",
"all",
"events",
"to",
"which",
"it",
"was",
"previously",
"added",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/ListenerPattern.php#L74-L81 |
32,457 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/ListenerPattern.php | ListenerPattern.createRegex | private function createRegex($eventPattern)
{
$replacements = self::getReplacements();
return sprintf('/^%s$/', preg_replace(
array_keys($replacements),
array_values($replacements),
preg_quote($eventPattern, '/')
));
} | php | private function createRegex($eventPattern)
{
$replacements = self::getReplacements();
return sprintf('/^%s$/', preg_replace(
array_keys($replacements),
array_values($replacements),
preg_quote($eventPattern, '/')
));
} | [
"private",
"function",
"createRegex",
"(",
"$",
"eventPattern",
")",
"{",
"$",
"replacements",
"=",
"self",
"::",
"getReplacements",
"(",
")",
";",
"return",
"sprintf",
"(",
"'/^%s$/'",
",",
"preg_replace",
"(",
"array_keys",
"(",
"$",
"replacements",
")",
"... | Transforms an event pattern into a regular expression.
@param string $eventPattern
@return string | [
"Transforms",
"an",
"event",
"pattern",
"into",
"a",
"regular",
"expression",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/ListenerPattern.php#L100-L109 |
32,458 | flipboxfactory/craft-ember | src/modules/LoggerTrait.php | LoggerTrait.loggerCategory | protected static function loggerCategory($category): string
{
/** @noinspection PhpUndefinedFieldInspection */
$prefix = static::$category ?? '';
if (empty($category)) {
return $prefix;
}
return ($prefix ? $prefix . ':' : '') . $category;
} | php | protected static function loggerCategory($category): string
{
/** @noinspection PhpUndefinedFieldInspection */
$prefix = static::$category ?? '';
if (empty($category)) {
return $prefix;
}
return ($prefix ? $prefix . ':' : '') . $category;
} | [
"protected",
"static",
"function",
"loggerCategory",
"(",
"$",
"category",
")",
":",
"string",
"{",
"/** @noinspection PhpUndefinedFieldInspection */",
"$",
"prefix",
"=",
"static",
"::",
"$",
"category",
"??",
"''",
";",
"if",
"(",
"empty",
"(",
"$",
"category"... | The log categories
@param $category
@return string | [
"The",
"log",
"categories"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/modules/LoggerTrait.php#L66-L76 |
32,459 | flipboxfactory/craft-ember | src/modules/LoggerTrait.php | LoggerTrait.debug | public static function debug($message, $category = 'general')
{
Craft::getLogger()->log($message, Logger::LEVEL_TRACE, static::loggerCategory($category));
} | php | public static function debug($message, $category = 'general')
{
Craft::getLogger()->log($message, Logger::LEVEL_TRACE, static::loggerCategory($category));
} | [
"public",
"static",
"function",
"debug",
"(",
"$",
"message",
",",
"$",
"category",
"=",
"'general'",
")",
"{",
"Craft",
"::",
"getLogger",
"(",
")",
"->",
"log",
"(",
"$",
"message",
",",
"Logger",
"::",
"LEVEL_TRACE",
",",
"static",
"::",
"loggerCatego... | Logs a debug message.
Trace messages are logged mainly for development purpose to see
the execution work flow of some code. This method will only log
a message when the application is in debug mode.
@param string|array $message the message to be logged. This can be a simple string or a more
complex data structure, such... | [
"Logs",
"a",
"debug",
"message",
".",
"Trace",
"messages",
"are",
"logged",
"mainly",
"for",
"development",
"purpose",
"to",
"see",
"the",
"execution",
"work",
"flow",
"of",
"some",
"code",
".",
"This",
"method",
"will",
"only",
"log",
"a",
"message",
"whe... | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/modules/LoggerTrait.php#L88-L91 |
32,460 | firebrandhq/silverstripe-hail | src/Tasks/FetchRecurringTask.php | FetchRecurringTask.sendException | public static function sendException($exception)
{
$emails = Config::inst()->get(self::class, 'Emails');
if ($emails) {
$emails = explode(",", $emails);
$email = new Email();
$email
->setTo($emails)
->setSubject('SilverStrip... | php | public static function sendException($exception)
{
$emails = Config::inst()->get(self::class, 'Emails');
if ($emails) {
$emails = explode(",", $emails);
$email = new Email();
$email
->setTo($emails)
->setSubject('SilverStrip... | [
"public",
"static",
"function",
"sendException",
"(",
"$",
"exception",
")",
"{",
"$",
"emails",
"=",
"Config",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"self",
"::",
"class",
",",
"'Emails'",
")",
";",
"if",
"(",
"$",
"emails",
")",
"{",
"$",
"em... | Send exception to configured emails
@param \Exception $exception | [
"Send",
"exception",
"to",
"configured",
"emails"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Tasks/FetchRecurringTask.php#L119-L131 |
32,461 | czim/laravel-processor | src/Contexts/ContextRepositoryTrait.php | ContextRepositoryTrait.repository | public function repository($name, $method, array $parameters = [])
{
return call_user_func_array(
[ $this->getRepository($name), $method ],
$parameters
);
} | php | public function repository($name, $method, array $parameters = [])
{
return call_user_func_array(
[ $this->getRepository($name), $method ],
$parameters
);
} | [
"public",
"function",
"repository",
"(",
"$",
"name",
",",
"$",
"method",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"return",
"call_user_func_array",
"(",
"[",
"$",
"this",
"->",
"getRepository",
"(",
"$",
"name",
")",
",",
"$",
"method... | Perform a method on a repository
@param string $name
@param string $method
@param array $parameters
@return mixed
@throws ContextRepositoryException if repository name not found | [
"Perform",
"a",
"method",
"on",
"a",
"repository"
] | 3d0025cd463653b7a8981ff52cebdafbe978f000 | https://github.com/czim/laravel-processor/blob/3d0025cd463653b7a8981ff52cebdafbe978f000/src/Contexts/ContextRepositoryTrait.php#L54-L60 |
32,462 | davidecesarano/Embryo-Http | Embryo/Http/Factory/UploadedFileFactory.php | UploadedFileFactory.createUploadedFile | public function createUploadedFile(
StreamInterface $file,
int $size = null,
int $error = \UPLOAD_ERR_OK,
string $clientFilename = null,
string $clientMediaType = null
): UploadedFileInterface
{
if (!$file->isReadable()) {
... | php | public function createUploadedFile(
StreamInterface $file,
int $size = null,
int $error = \UPLOAD_ERR_OK,
string $clientFilename = null,
string $clientMediaType = null
): UploadedFileInterface
{
if (!$file->isReadable()) {
... | [
"public",
"function",
"createUploadedFile",
"(",
"StreamInterface",
"$",
"file",
",",
"int",
"$",
"size",
"=",
"null",
",",
"int",
"$",
"error",
"=",
"\\",
"UPLOAD_ERR_OK",
",",
"string",
"$",
"clientFilename",
"=",
"null",
",",
"string",
"$",
"clientMediaTy... | Creates a new uploaded file.
If a string is used to create the file, a temporary resource will be
created with the content of the string.
If a size is not provided it will be determined by checking the size of
the file.
@param StreamInterface $file
@param int|null $size
@param int $error
@param string|null $clientFi... | [
"Creates",
"a",
"new",
"uploaded",
"file",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Factory/UploadedFileFactory.php#L38-L51 |
32,463 | davidecesarano/Embryo-Http | Embryo/Http/Factory/UploadedFileFactory.php | UploadedFileFactory.createUploadedFileFromServer | public function createUploadedFileFromServer(array $files)
{
$normalized = [];
foreach ($files as $key => $value) {
if (!isset($value['error'])) {
if (is_array($value)) {
$normalized[$key] = $this->createUploade... | php | public function createUploadedFileFromServer(array $files)
{
$normalized = [];
foreach ($files as $key => $value) {
if (!isset($value['error'])) {
if (is_array($value)) {
$normalized[$key] = $this->createUploade... | [
"public",
"function",
"createUploadedFileFromServer",
"(",
"array",
"$",
"files",
")",
"{",
"$",
"normalized",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"files",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"value... | Creates a new uploaded file from server.
@param array $files
@return array | [
"Creates",
"a",
"new",
"uploaded",
"file",
"from",
"server",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Factory/UploadedFileFactory.php#L59-L107 |
32,464 | davidecesarano/Embryo-Http | Embryo/Http/Message/Uri.php | Uri.withHost | public function withHost($host)
{
if(!is_string($host)){
throw new InvalidArgumentException('Uri host must be a string');
}
$clone = clone $this;
$clone->host = $this->removePortFromHost($host);
return $clone;
} | php | public function withHost($host)
{
if(!is_string($host)){
throw new InvalidArgumentException('Uri host must be a string');
}
$clone = clone $this;
$clone->host = $this->removePortFromHost($host);
return $clone;
} | [
"public",
"function",
"withHost",
"(",
"$",
"host",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"host",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Uri host must be a string'",
")",
";",
"}",
"$",
"clone",
"=",
"clone",
"$",
"t... | Returns an instance with the specified host.
@param string $host
@return static
@throws InvalidArgumentException | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"host",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Uri.php#L219-L228 |
32,465 | CradlePHP/cradle-system | src/Schema/Service/SqlService.php | SqlService.remove | public function remove($restorable = true)
{
//translate model data to sql data
if (is_null($this->schema)) {
throw Exception::forNoSchema();
}
$data = $this->schema->toSql();
//queries to run
$queries = [];
// check if table is already archived... | php | public function remove($restorable = true)
{
//translate model data to sql data
if (is_null($this->schema)) {
throw Exception::forNoSchema();
}
$data = $this->schema->toSql();
//queries to run
$queries = [];
// check if table is already archived... | [
"public",
"function",
"remove",
"(",
"$",
"restorable",
"=",
"true",
")",
"{",
"//translate model data to sql data",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"Exception",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
... | Removes a table
@param array $data
@return array | [
"Removes",
"a",
"table"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Service/SqlService.php#L172-L220 |
32,466 | CradlePHP/cradle-system | src/Schema/Service/SqlService.php | SqlService.restore | public function restore()
{
//translate model data to sql data
if (is_null($this->schema)) {
throw Exception::forNoSchema();
}
$data = $this->schema->toSql();
//queries to run
$queries = [];
// check if table is already archived
if ($thi... | php | public function restore()
{
//translate model data to sql data
if (is_null($this->schema)) {
throw Exception::forNoSchema();
}
$data = $this->schema->toSql();
//queries to run
$queries = [];
// check if table is already archived
if ($thi... | [
"public",
"function",
"restore",
"(",
")",
"{",
"//translate model data to sql data",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"Exception",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
"data",
"=",
"$",
"this",
"->... | Restores a table
@param array $data
@return array | [
"Restores",
"a",
"table"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Service/SqlService.php#L229-L269 |
32,467 | CradlePHP/cradle-system | src/Schema/Service/SqlService.php | SqlService.getSchemaTableRecordCount | public function getSchemaTableRecordCount($schema = null)
{
// information schema query
$query = sprintf(
'SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = "%s"',
$schema
);
// send query
return $this->resource->query(... | php | public function getSchemaTableRecordCount($schema = null)
{
// information schema query
$query = sprintf(
'SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = "%s"',
$schema
);
// send query
return $this->resource->query(... | [
"public",
"function",
"getSchemaTableRecordCount",
"(",
"$",
"schema",
"=",
"null",
")",
"{",
"// information schema query",
"$",
"query",
"=",
"sprintf",
"(",
"'SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = \"%s\"'",
",",
"$",
"schema",
")... | Returns all the table record count
@return array | [
"Returns",
"all",
"the",
"table",
"record",
"count"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Service/SqlService.php#L484-L494 |
32,468 | flipboxfactory/craft-ember | src/queries/CacheableQuery.php | CacheableQuery.nth | public function nth(int $n, Connection $db = null)
{
// Cached?
if (($cachedResult = $this->getCachedResult()) !== null) {
return $cachedResult[$n] ?? false;
}
return parent::nth($n, $db);
} | php | public function nth(int $n, Connection $db = null)
{
// Cached?
if (($cachedResult = $this->getCachedResult()) !== null) {
return $cachedResult[$n] ?? false;
}
return parent::nth($n, $db);
} | [
"public",
"function",
"nth",
"(",
"int",
"$",
"n",
",",
"Connection",
"$",
"db",
"=",
"null",
")",
"{",
"// Cached?",
"if",
"(",
"(",
"$",
"cachedResult",
"=",
"$",
"this",
"->",
"getCachedResult",
"(",
")",
")",
"!==",
"null",
")",
"{",
"return",
... | Executes the query and returns a single row of result at a given offset.
@param int $n The offset of the row to return. If [[offset]] is set, $offset will be added to it.
@param Connection|null $db The database connection used to generate the SQL statement.
If this parameter is not given, the `db` application componen... | [
"Executes",
"the",
"query",
"and",
"returns",
"a",
"single",
"row",
"of",
"result",
"at",
"a",
"given",
"offset",
"."
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/queries/CacheableQuery.php#L81-L89 |
32,469 | flipboxfactory/craft-ember | src/records/FieldLayoutAttributeTrait.php | FieldLayoutAttributeTrait.getFieldLayoutId | public function getFieldLayoutId()
{
$fieldLayoutId = $this->getAttribute('fieldLayoutId');
if (null === $fieldLayoutId && null !== $this->fieldLayout) {
$fieldLayoutId = $this->fieldLayoutId = $this->fieldLayout->id;
}
return $fieldLayoutId;
} | php | public function getFieldLayoutId()
{
$fieldLayoutId = $this->getAttribute('fieldLayoutId');
if (null === $fieldLayoutId && null !== $this->fieldLayout) {
$fieldLayoutId = $this->fieldLayoutId = $this->fieldLayout->id;
}
return $fieldLayoutId;
} | [
"public",
"function",
"getFieldLayoutId",
"(",
")",
"{",
"$",
"fieldLayoutId",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
"'fieldLayoutId'",
")",
";",
"if",
"(",
"null",
"===",
"$",
"fieldLayoutId",
"&&",
"null",
"!==",
"$",
"this",
"->",
"fieldLayout",
... | Get associated fieldLayoutId
@return int|null | [
"Get",
"associated",
"fieldLayoutId"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/records/FieldLayoutAttributeTrait.php#L53-L61 |
32,470 | CradlePHP/cradle-system | src/Model/Service/ElasticService.php | ElasticService.create | public function create($id)
{
$exists = false;
try {
// check if index exist
$exists = $this->resource->indices()->exists(['index' => $this->schema->getName()]);
} catch (\Throwable $e) {
// return false if something went wrong
return false;
... | php | public function create($id)
{
$exists = false;
try {
// check if index exist
$exists = $this->resource->indices()->exists(['index' => $this->schema->getName()]);
} catch (\Throwable $e) {
// return false if something went wrong
return false;
... | [
"public",
"function",
"create",
"(",
"$",
"id",
")",
"{",
"$",
"exists",
"=",
"false",
";",
"try",
"{",
"// check if index exist",
"$",
"exists",
"=",
"$",
"this",
"->",
"resource",
"->",
"indices",
"(",
")",
"->",
"exists",
"(",
"[",
"'index'",
"=>",
... | Create in index
@param *int $id
@return array | [
"Create",
"in",
"index"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/ElasticService.php#L59-L101 |
32,471 | CradlePHP/cradle-system | src/Model/Service/ElasticService.php | ElasticService.remove | public function remove($id)
{
try {
return $this->resource->delete([
'index' => $this->schema->getName(),
'type' => static::INDEX_TYPE,
'id' => $id
]);
} catch (NoNodesAvailableException $e) {
return false;
}... | php | public function remove($id)
{
try {
return $this->resource->delete([
'index' => $this->schema->getName(),
'type' => static::INDEX_TYPE,
'id' => $id
]);
} catch (NoNodesAvailableException $e) {
return false;
}... | [
"public",
"function",
"remove",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"resource",
"->",
"delete",
"(",
"[",
"'index'",
"=>",
"$",
"this",
"->",
"schema",
"->",
"getName",
"(",
")",
",",
"'type'",
"=>",
"static",
"::",
"... | Remove from index
@param *int $id | [
"Remove",
"from",
"index"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/ElasticService.php#L245-L256 |
32,472 | CradlePHP/cradle-system | src/Model/Service/ElasticService.php | ElasticService.update | public function update($id)
{
// set schema to sql
$this->sql->setSchema($this->schema);
// get data from sql
$body = $this->sql->get($this->schema->getPrimaryFieldName(), $id);
if (!is_array($body) || empty($body)) {
return false;
}
try {
... | php | public function update($id)
{
// set schema to sql
$this->sql->setSchema($this->schema);
// get data from sql
$body = $this->sql->get($this->schema->getPrimaryFieldName(), $id);
if (!is_array($body) || empty($body)) {
return false;
}
try {
... | [
"public",
"function",
"update",
"(",
"$",
"id",
")",
"{",
"// set schema to sql",
"$",
"this",
"->",
"sql",
"->",
"setSchema",
"(",
"$",
"this",
"->",
"schema",
")",
";",
"// get data from sql",
"$",
"body",
"=",
"$",
"this",
"->",
"sql",
"->",
"get",
... | Update to index
@param *int $id
@return array | [
"Update",
"to",
"index"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Model/Service/ElasticService.php#L265-L296 |
32,473 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.isOutdated | public function isOutdated()
{
if ($this->Fetched) {
$fetched = new \DateTime($this->Fetched);
$now = new \DateTime("now");
$diff = $now->getTimestamp() - $fetched->getTimestamp();
if ($diff > Client::getRefreshRate()) {
return true;
... | php | public function isOutdated()
{
if ($this->Fetched) {
$fetched = new \DateTime($this->Fetched);
$now = new \DateTime("now");
$diff = $now->getTimestamp() - $fetched->getTimestamp();
if ($diff > Client::getRefreshRate()) {
return true;
... | [
"public",
"function",
"isOutdated",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"Fetched",
")",
"{",
"$",
"fetched",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"this",
"->",
"Fetched",
")",
";",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
"\"now\"... | Determines if the object is outdated
@return boolean | [
"Determines",
"if",
"the",
"object",
"is",
"outdated"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L116-L129 |
32,474 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.refresh | public function refresh()
{
if ($this->ID && $this->HailID) {
try {
$api_client = new Client();
$data = $api_client->getOne($this);
} catch (\Exception $ex) {
return $this;
}
if (count($data) > 0) {
... | php | public function refresh()
{
if ($this->ID && $this->HailID) {
try {
$api_client = new Client();
$data = $api_client->getOne($this);
} catch (\Exception $ex) {
return $this;
}
if (count($data) > 0) {
... | [
"public",
"function",
"refresh",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ID",
"&&",
"$",
"this",
"->",
"HailID",
")",
"{",
"try",
"{",
"$",
"api_client",
"=",
"new",
"Client",
"(",
")",
";",
"$",
"data",
"=",
"$",
"api_client",
"->",
"getOn... | Retrieves the latest version of this object from the Hail API
@return ApiObject | [
"Retrieves",
"the",
"latest",
"version",
"of",
"this",
"object",
"from",
"the",
"Hail",
"API"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L147-L162 |
32,475 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.importHailData | protected function importHailData($data)
{
if ($this->excluded($data)) {
return false;
}
$dataMap = array_merge(
['HailID' => 'id'],
static::$api_map
);
foreach ($dataMap as $ssKey => $hailKey) {
$value = (isset($data[$hailKe... | php | protected function importHailData($data)
{
if ($this->excluded($data)) {
return false;
}
$dataMap = array_merge(
['HailID' => 'id'],
static::$api_map
);
foreach ($dataMap as $ssKey => $hailKey) {
$value = (isset($data[$hailKe... | [
"protected",
"function",
"importHailData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"excluded",
"(",
"$",
"data",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"dataMap",
"=",
"array_merge",
"(",
"[",
"'HailID'",
"=>",
"'id'",
"]"... | Process the json data from Hail API and writes to SS db
Return true if the value should be saved to the database. False if it has been excluded.
@param array $data JSON data from Hail
@return boolean
@throws | [
"Process",
"the",
"json",
"data",
"from",
"Hail",
"API",
"and",
"writes",
"to",
"SS",
"db"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L173-L202 |
32,476 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.fetchAll | public static function fetchAll()
{
//Hail Api Client
$hail_api_client = new Client();
$config = SiteConfig::current_site_config();
$orgs_ids = json_decode($config->HailOrgsIDs);
if (!$orgs_ids) {
//No organisations configured
$hail_api_client->handle... | php | public static function fetchAll()
{
//Hail Api Client
$hail_api_client = new Client();
$config = SiteConfig::current_site_config();
$orgs_ids = json_decode($config->HailOrgsIDs);
if (!$orgs_ids) {
//No organisations configured
$hail_api_client->handle... | [
"public",
"static",
"function",
"fetchAll",
"(",
")",
"{",
"//Hail Api Client",
"$",
"hail_api_client",
"=",
"new",
"Client",
"(",
")",
";",
"$",
"config",
"=",
"SiteConfig",
"::",
"current_site_config",
"(",
")",
";",
"$",
"orgs_ids",
"=",
"json_decode",
"(... | Fetch from Hail API for all configured organisations
@throws | [
"Fetch",
"from",
"Hail",
"API",
"for",
"all",
"configured",
"organisations"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L355-L372 |
32,477 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.makeRecordViewer | protected function makeRecordViewer($fields, $name, $relation, $viewComponent = 'Firebrand\Hail\Forms\GridFieldViewButton')
{
$config = GridFieldConfig_RecordViewer::create();
// Remove the standard GridFieldView button and replace it with our
// custom button that will link to our the righ... | php | protected function makeRecordViewer($fields, $name, $relation, $viewComponent = 'Firebrand\Hail\Forms\GridFieldViewButton')
{
$config = GridFieldConfig_RecordViewer::create();
// Remove the standard GridFieldView button and replace it with our
// custom button that will link to our the righ... | [
"protected",
"function",
"makeRecordViewer",
"(",
"$",
"fields",
",",
"$",
"name",
",",
"$",
"relation",
",",
"$",
"viewComponent",
"=",
"'Firebrand\\Hail\\Forms\\GridFieldViewButton'",
")",
"{",
"$",
"config",
"=",
"GridFieldConfig_RecordViewer",
"::",
"create",
"(... | Helper function to add a ReadOnly gridfield for a relation
@param FieldList $fields
@param string $name Name that should be given to the GridField
@param ManyManyList $relation Relation to display
@param string $viewComponent Full class name of the view Component to add (button) | [
"Helper",
"function",
"to",
"add",
"a",
"ReadOnly",
"gridfield",
"for",
"a",
"relation"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L421-L434 |
32,478 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.processPublicTags | protected function processPublicTags($data)
{
$tagIdList = [];
// Clean tags before importing the new ones
// but have not been returned this time around
$this->PublicTags()->removeAll();
foreach ($data as $tagData) {
$tagIdList[] = $tagData['id'];
//... | php | protected function processPublicTags($data)
{
$tagIdList = [];
// Clean tags before importing the new ones
// but have not been returned this time around
$this->PublicTags()->removeAll();
foreach ($data as $tagData) {
$tagIdList[] = $tagData['id'];
//... | [
"protected",
"function",
"processPublicTags",
"(",
"$",
"data",
")",
"{",
"$",
"tagIdList",
"=",
"[",
"]",
";",
"// Clean tags before importing the new ones",
"// but have not been returned this time around",
"$",
"this",
"->",
"PublicTags",
"(",
")",
"->",
"removeAll",... | Go through the list of public tags and assign them to this object.
@param array $data JSON data from Hail | [
"Go",
"through",
"the",
"list",
"of",
"public",
"tags",
"and",
"assign",
"them",
"to",
"this",
"object",
"."
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L441-L468 |
32,479 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.processPrivateTags | protected function processPrivateTags($data)
{
$tagIdList = [];
$this->PrivateTags()->removeAll();
foreach ($data as $tagData) {
$tagIdList[] = $tagData['id'];
// Find a matching PrivateTag or create an new one
$tag = PrivateTag::get()->filter(['HailID' =... | php | protected function processPrivateTags($data)
{
$tagIdList = [];
$this->PrivateTags()->removeAll();
foreach ($data as $tagData) {
$tagIdList[] = $tagData['id'];
// Find a matching PrivateTag or create an new one
$tag = PrivateTag::get()->filter(['HailID' =... | [
"protected",
"function",
"processPrivateTags",
"(",
"$",
"data",
")",
"{",
"$",
"tagIdList",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"PrivateTags",
"(",
")",
"->",
"removeAll",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"tagData",
")",
"{"... | Go through the list of private tags and assign them to this object.
@param array $data JSON data from Hail | [
"Go",
"through",
"the",
"list",
"of",
"private",
"tags",
"and",
"assign",
"them",
"to",
"this",
"object",
"."
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L475-L499 |
32,480 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.processHeroImage | protected function processHeroImage($heroImgData)
{
if ($heroImgData) {
$hero = Image::get()->filter(['HailID' => $heroImgData['id']])->first();
if (!$hero) {
$hero = new Image();
}
$hero->OrganisationID = $this->OrganisationID;
$he... | php | protected function processHeroImage($heroImgData)
{
if ($heroImgData) {
$hero = Image::get()->filter(['HailID' => $heroImgData['id']])->first();
if (!$hero) {
$hero = new Image();
}
$hero->OrganisationID = $this->OrganisationID;
$he... | [
"protected",
"function",
"processHeroImage",
"(",
"$",
"heroImgData",
")",
"{",
"if",
"(",
"$",
"heroImgData",
")",
"{",
"$",
"hero",
"=",
"Image",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"[",
"'HailID'",
"=>",
"$",
"heroImgData",
"[",
"'id'",
"]",... | Match the hero image if there's one and assign it to this object
@param array $heroImgData JSON data from Hail | [
"Match",
"the",
"hero",
"image",
"if",
"there",
"s",
"one",
"and",
"assign",
"it",
"to",
"this",
"object"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L506-L524 |
32,481 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.processHeroVideo | protected function processHeroVideo($heroVidData)
{
if ($heroVidData) {
$hero = Video::get()->filter(['HailID' => $heroVidData['id']])->first();
if (!$hero) {
$hero = new Video();
}
$hero->OrganisationID = $this->OrganisationID;
$he... | php | protected function processHeroVideo($heroVidData)
{
if ($heroVidData) {
$hero = Video::get()->filter(['HailID' => $heroVidData['id']])->first();
if (!$hero) {
$hero = new Video();
}
$hero->OrganisationID = $this->OrganisationID;
$he... | [
"protected",
"function",
"processHeroVideo",
"(",
"$",
"heroVidData",
")",
"{",
"if",
"(",
"$",
"heroVidData",
")",
"{",
"$",
"hero",
"=",
"Video",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"[",
"'HailID'",
"=>",
"$",
"heroVidData",
"[",
"'id'",
"]",... | Match the hero video if there's one and assign it to this object
@param array $heroVidData JSON data from Hail | [
"Match",
"the",
"hero",
"video",
"if",
"there",
"s",
"one",
"and",
"assign",
"it",
"to",
"this",
"object"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L531-L549 |
32,482 | firebrandhq/silverstripe-hail | src/Models/ApiObject.php | ApiObject.processAttachments | protected function processAttachments($data)
{
$idList = [];
foreach ($data as $attachmentData) {
$idList[] = $attachmentData['id'];
// Find a matching attachment or create it
$attachment = Attachment::get()->filter(['HailID' => $attachmentData['id']])->first();
... | php | protected function processAttachments($data)
{
$idList = [];
foreach ($data as $attachmentData) {
$idList[] = $attachmentData['id'];
// Find a matching attachment or create it
$attachment = Attachment::get()->filter(['HailID' => $attachmentData['id']])->first();
... | [
"protected",
"function",
"processAttachments",
"(",
"$",
"data",
")",
"{",
"$",
"idList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"attachmentData",
")",
"{",
"$",
"idList",
"[",
"]",
"=",
"$",
"attachmentData",
"[",
"'id'",
"]",
"... | Go through the attachments and assign them to this object.
@param array $data JSON data from Hail | [
"Go",
"through",
"the",
"attachments",
"and",
"assign",
"them",
"to",
"this",
"object",
"."
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/ApiObject.php#L556-L588 |
32,483 | firebrandhq/silverstripe-hail | src/Pages/HailPageController.php | HailPageController.article | public function article(HTTPRequest $request)
{
$params = $request->params();
if ($params['ID']) {
$article = Article::get()->filter(['HailID' => $params['ID']])->first();
//Try to find the article with the database ID field, to be backward compatible with old Hail modul... | php | public function article(HTTPRequest $request)
{
$params = $request->params();
if ($params['ID']) {
$article = Article::get()->filter(['HailID' => $params['ID']])->first();
//Try to find the article with the database ID field, to be backward compatible with old Hail modul... | [
"public",
"function",
"article",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"$",
"params",
"=",
"$",
"request",
"->",
"params",
"(",
")",
";",
"if",
"(",
"$",
"params",
"[",
"'ID'",
"]",
")",
"{",
"$",
"article",
"=",
"Article",
"::",
"get",
"("... | Render a Hail Article
@param HTTPRequest $request
@return array
@throws HTTPResponse_Exception | [
"Render",
"a",
"Hail",
"Article"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Pages/HailPageController.php#L85-L119 |
32,484 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php | WildcardEventDispatcher.bindPatterns | protected function bindPatterns($eventName)
{
if (isset($this->syncedEvents[$eventName])) {
return;
}
foreach ($this->patterns as $eventPattern => $patterns) {
foreach ($patterns as $pattern) {
if ($pattern->test($eventName)) {
$pa... | php | protected function bindPatterns($eventName)
{
if (isset($this->syncedEvents[$eventName])) {
return;
}
foreach ($this->patterns as $eventPattern => $patterns) {
foreach ($patterns as $pattern) {
if ($pattern->test($eventName)) {
$pa... | [
"protected",
"function",
"bindPatterns",
"(",
"$",
"eventName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"syncedEvents",
"[",
"$",
"eventName",
"]",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"patterns",
"as",
... | Binds all patterns that match the specified event name.
@param string $eventName | [
"Binds",
"all",
"patterns",
"that",
"match",
"the",
"specified",
"event",
"name",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php#L139-L154 |
32,485 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php | WildcardEventDispatcher.addListenerPattern | protected function addListenerPattern(ListenerPattern $pattern)
{
$this->patterns[$pattern->getEventPattern()][] = $pattern;
foreach ($this->syncedEvents as $eventName => $_) {
if ($pattern->test($eventName)) {
unset($this->syncedEvents[$eventName]);
}
... | php | protected function addListenerPattern(ListenerPattern $pattern)
{
$this->patterns[$pattern->getEventPattern()][] = $pattern;
foreach ($this->syncedEvents as $eventName => $_) {
if ($pattern->test($eventName)) {
unset($this->syncedEvents[$eventName]);
}
... | [
"protected",
"function",
"addListenerPattern",
"(",
"ListenerPattern",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"patterns",
"[",
"$",
"pattern",
"->",
"getEventPattern",
"(",
")",
"]",
"[",
"]",
"=",
"$",
"pattern",
";",
"foreach",
"(",
"$",
"this",
... | Adds an event listener for all events matching the specified pattern.
This method will lazily register the listener when a matching event is
dispatched.
@param ListenerPattern $pattern | [
"Adds",
"an",
"event",
"listener",
"for",
"all",
"events",
"matching",
"the",
"specified",
"pattern",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php#L164-L173 |
32,486 | jmikola/WildcardEventDispatcher | src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php | WildcardEventDispatcher.removeListenerPattern | protected function removeListenerPattern($eventPattern, $listener)
{
if (!isset($this->patterns[$eventPattern])) {
return;
}
foreach ($this->patterns[$eventPattern] as $key => $pattern) {
if ($listener == $pattern->getListener()) {
$pattern->unbind($t... | php | protected function removeListenerPattern($eventPattern, $listener)
{
if (!isset($this->patterns[$eventPattern])) {
return;
}
foreach ($this->patterns[$eventPattern] as $key => $pattern) {
if ($listener == $pattern->getListener()) {
$pattern->unbind($t... | [
"protected",
"function",
"removeListenerPattern",
"(",
"$",
"eventPattern",
",",
"$",
"listener",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"patterns",
"[",
"$",
"eventPattern",
"]",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"... | Removes an event listener from any events to which it was applied due to
pattern matching.
This method cannot be used to remove a listener from a pattern that was
never registered.
@param string $eventPattern
@param callback $listener | [
"Removes",
"an",
"event",
"listener",
"from",
"any",
"events",
"to",
"which",
"it",
"was",
"applied",
"due",
"to",
"pattern",
"matching",
"."
] | cc3257181cfc25a025b049348c5f9053e83ec627 | https://github.com/jmikola/WildcardEventDispatcher/blob/cc3257181cfc25a025b049348c5f9053e83ec627/src/Jmikola/WildcardEventDispatcher/WildcardEventDispatcher.php#L185-L197 |
32,487 | CradlePHP/cradle-system | src/Schema/Service/ElasticService.php | ElasticService.createMap | public function createMap() {
if(is_null($this->schema)) {
throw SystemException::forNoSchema();
}
// translate data first to sql
$data = $this->schema->toSql();
// then translate it to elastic mapping
$mapping = $this->schema->toElastic($data);
// g... | php | public function createMap() {
if(is_null($this->schema)) {
throw SystemException::forNoSchema();
}
// translate data first to sql
$data = $this->schema->toSql();
// then translate it to elastic mapping
$mapping = $this->schema->toElastic($data);
// g... | [
"public",
"function",
"createMap",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"// translate data first to sql",
"$",
"data",
"=",
"$",
"this",
... | Create an elastic map
@return void | [
"Create",
"an",
"elastic",
"map"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Service/ElasticService.php#L57-L85 |
32,488 | CradlePHP/cradle-system | src/Schema/Service/ElasticService.php | ElasticService.map | public function map() {
// no schema validation
if(is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$table = $this->schema->getName();
$path = cradle()->package('global')->path('schema')
. sprintf('/elastic/%s/elastic.php', ucwords($tab... | php | public function map() {
// no schema validation
if(is_null($this->schema)) {
throw SystemException::forNoSchema();
}
$table = $this->schema->getName();
$path = cradle()->package('global')->path('schema')
. sprintf('/elastic/%s/elastic.php', ucwords($tab... | [
"public",
"function",
"map",
"(",
")",
"{",
"// no schema validation",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"$",
"table",
"=",
"$",
"this",
"->",
"sc... | Map Elastic Schema
@return bool | [
"Map",
"Elastic",
"Schema"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Service/ElasticService.php#L92-L135 |
32,489 | CradlePHP/cradle-system | src/Schema/Service/ElasticService.php | ElasticService.flush | public function flush() {
// no schema validation
if(is_null($this->schema)) {
throw SystemException::forNoSchema();
}
// flush elastic schema
try {
$this->resource
->indices()
->delete(
['index' => $thi... | php | public function flush() {
// no schema validation
if(is_null($this->schema)) {
throw SystemException::forNoSchema();
}
// flush elastic schema
try {
$this->resource
->indices()
->delete(
['index' => $thi... | [
"public",
"function",
"flush",
"(",
")",
"{",
"// no schema validation",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"throw",
"SystemException",
"::",
"forNoSchema",
"(",
")",
";",
"}",
"// flush elastic schema",
"try",
"{",
"$",
... | Flush Elastic Index
@return bool | [
"Flush",
"Elastic",
"Index"
] | 3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c | https://github.com/CradlePHP/cradle-system/blob/3dda31fbc7e4523fdcc87e18a7ab852116cbdc6c/src/Schema/Service/ElasticService.php#L240-L260 |
32,490 | oasmobile/php-http | src/ServiceProviders/Security/NullEntryPoint.php | NullEntryPoint.start | public function start(Request $request, AuthenticationException $authException = null)
{
$msg = $authException ? $authException->getMessage() : 'Access Denied';
throw new AccessDeniedHttpException($msg);
} | php | public function start(Request $request, AuthenticationException $authException = null)
{
$msg = $authException ? $authException->getMessage() : 'Access Denied';
throw new AccessDeniedHttpException($msg);
} | [
"public",
"function",
"start",
"(",
"Request",
"$",
"request",
",",
"AuthenticationException",
"$",
"authException",
"=",
"null",
")",
"{",
"$",
"msg",
"=",
"$",
"authException",
"?",
"$",
"authException",
"->",
"getMessage",
"(",
")",
":",
"'Access Denied'",
... | Returns a response that directs the user to authenticate.
This is called when an anonymous request accesses a resource that
requires authentication. The job of this method is to return some
response that "helps" the user start into the authentication process.
Examples:
A) For a form login, you might redirect to the l... | [
"Returns",
"a",
"response",
"that",
"directs",
"the",
"user",
"to",
"authenticate",
"."
] | a7570893742286c30222c393891aeb6857064f37 | https://github.com/oasmobile/php-http/blob/a7570893742286c30222c393891aeb6857064f37/src/ServiceProviders/Security/NullEntryPoint.php#L38-L42 |
32,491 | MetaModels/filter_text | src/FilterSetting/Text.php | Text.doSimpleSearch | private function doSimpleSearch($strTextSearch, $objFilter, $arrFilterUrl)
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$arrLanguages = $this->getAvailableLanguages($objMetaModel);
$strParamName = $this->getParam... | php | private function doSimpleSearch($strTextSearch, $objFilter, $arrFilterUrl)
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$arrLanguages = $this->getAvailableLanguages($objMetaModel);
$strParamName = $this->getParam... | [
"private",
"function",
"doSimpleSearch",
"(",
"$",
"strTextSearch",
",",
"$",
"objFilter",
",",
"$",
"arrFilterUrl",
")",
"{",
"$",
"objMetaModel",
"=",
"$",
"this",
"->",
"getMetaModel",
"(",
")",
";",
"$",
"objAttribute",
"=",
"$",
"objMetaModel",
"->",
... | Make a simple search with a like.
@param string $strTextSearch The mode for the search.
@param IFilter $objFilter The filter to append the rules to.
@param string[] $arrFilterUrl The parameters to evaluate.
@return void | [
"Make",
"a",
"simple",
"search",
"with",
"a",
"like",
"."
] | 7537cfba0c38c9b6da84398d6109122d2d090593 | https://github.com/MetaModels/filter_text/blob/7537cfba0c38c9b6da84398d6109122d2d090593/src/FilterSetting/Text.php#L103-L139 |
32,492 | MetaModels/filter_text | src/FilterSetting/Text.php | Text.doComplexSearch | private function doComplexSearch($strTextSearch, $objFilter, $arrFilterUrl)
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$arrLanguages = $this->getAvailableLanguages($objMetaModel);
$strParamName = $this->getPara... | php | private function doComplexSearch($strTextSearch, $objFilter, $arrFilterUrl)
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$arrLanguages = $this->getAvailableLanguages($objMetaModel);
$strParamName = $this->getPara... | [
"private",
"function",
"doComplexSearch",
"(",
"$",
"strTextSearch",
",",
"$",
"objFilter",
",",
"$",
"arrFilterUrl",
")",
"{",
"$",
"objMetaModel",
"=",
"$",
"this",
"->",
"getMetaModel",
"(",
")",
";",
"$",
"objAttribute",
"=",
"$",
"objMetaModel",
"->",
... | Do a complex search with each word. Search for all words or for any word.
@param string $strTextSearch The mode any or all.
@param IFilter $objFilter The filter to append the rules to.
@param string[] $arrFilterUrl The parameters to evaluate.
@return void | [
"Do",
"a",
"complex",
"search",
"with",
"each",
"word",
".",
"Search",
"for",
"all",
"words",
"or",
"for",
"any",
"word",
"."
] | 7537cfba0c38c9b6da84398d6109122d2d090593 | https://github.com/MetaModels/filter_text/blob/7537cfba0c38c9b6da84398d6109122d2d090593/src/FilterSetting/Text.php#L152-L191 |
32,493 | MetaModels/filter_text | src/FilterSetting/Text.php | Text.getWords | private function getWords($string)
{
$delimiter = $this->get('delimiter');
if (empty($delimiter)) {
$delimiter = ' ';
}
return trimsplit($delimiter, $string);
} | php | private function getWords($string)
{
$delimiter = $this->get('delimiter');
if (empty($delimiter)) {
$delimiter = ' ';
}
return trimsplit($delimiter, $string);
} | [
"private",
"function",
"getWords",
"(",
"$",
"string",
")",
"{",
"$",
"delimiter",
"=",
"$",
"this",
"->",
"get",
"(",
"'delimiter'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"delimiter",
")",
")",
"{",
"$",
"delimiter",
"=",
"' '",
";",
"}",
"retur... | Use the delimiter from the setting and make a list of words.
@param string $string The list of words as a single string.
@return array The list of word split on the delimiter. | [
"Use",
"the",
"delimiter",
"from",
"the",
"setting",
"and",
"make",
"a",
"list",
"of",
"words",
"."
] | 7537cfba0c38c9b6da84398d6109122d2d090593 | https://github.com/MetaModels/filter_text/blob/7537cfba0c38c9b6da84398d6109122d2d090593/src/FilterSetting/Text.php#L200-L208 |
32,494 | MetaModels/filter_text | src/FilterSetting/Text.php | Text.doRegexpSearch | private function doRegexpSearch($objFilter, $arrFilterUrl)
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$strParamName = $this->getParamName();
$strParamValue = $arrFilterUrl[$strParamName];
$strPattern ... | php | private function doRegexpSearch($objFilter, $arrFilterUrl)
{
$objMetaModel = $this->getMetaModel();
$objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
$strParamName = $this->getParamName();
$strParamValue = $arrFilterUrl[$strParamName];
$strPattern ... | [
"private",
"function",
"doRegexpSearch",
"(",
"$",
"objFilter",
",",
"$",
"arrFilterUrl",
")",
"{",
"$",
"objMetaModel",
"=",
"$",
"this",
"->",
"getMetaModel",
"(",
")",
";",
"$",
"objAttribute",
"=",
"$",
"objMetaModel",
"->",
"getAttributeById",
"(",
"$",... | Make a simple search with a regexp.
@param IFilter $objFilter The filter to append the rules to.
@param string[] $arrFilterUrl The parameters to evaluate.
@return void | [
"Make",
"a",
"simple",
"search",
"with",
"a",
"regexp",
"."
] | 7537cfba0c38c9b6da84398d6109122d2d090593 | https://github.com/MetaModels/filter_text/blob/7537cfba0c38c9b6da84398d6109122d2d090593/src/FilterSetting/Text.php#L219-L247 |
32,495 | flipboxfactory/craft-ember | src/helpers/LoggerHelper.php | LoggerHelper.targetConfigs | public static function targetConfigs(array $categories): array
{
$configs = [];
foreach ($categories as $category) {
$configs[$category] = static::targetConfig($category);
}
return array_filter($configs);
} | php | public static function targetConfigs(array $categories): array
{
$configs = [];
foreach ($categories as $category) {
$configs[$category] = static::targetConfig($category);
}
return array_filter($configs);
} | [
"public",
"static",
"function",
"targetConfigs",
"(",
"array",
"$",
"categories",
")",
":",
"array",
"{",
"$",
"configs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"categories",
"as",
"$",
"category",
")",
"{",
"$",
"configs",
"[",
"$",
"category",
"]",... | Takes an array of log categories and creates log target configs
@param array $categories
@return array | [
"Takes",
"an",
"array",
"of",
"log",
"categories",
"and",
"creates",
"log",
"target",
"configs"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/helpers/LoggerHelper.php#L28-L37 |
32,496 | flipboxfactory/craft-ember | src/helpers/LoggerHelper.php | LoggerHelper.targetConfig | public static function targetConfig(string $category): array
{
// Only log console requests and web requests that aren't getAuthTimeout requests
$isConsoleRequest = Craft::$app->getRequest()->getIsConsoleRequest();
if (!$isConsoleRequest && !Craft::$app->getUser()->enableSession) {
... | php | public static function targetConfig(string $category): array
{
// Only log console requests and web requests that aren't getAuthTimeout requests
$isConsoleRequest = Craft::$app->getRequest()->getIsConsoleRequest();
if (!$isConsoleRequest && !Craft::$app->getUser()->enableSession) {
... | [
"public",
"static",
"function",
"targetConfig",
"(",
"string",
"$",
"category",
")",
":",
"array",
"{",
"// Only log console requests and web requests that aren't getAuthTimeout requests",
"$",
"isConsoleRequest",
"=",
"Craft",
"::",
"$",
"app",
"->",
"getRequest",
"(",
... | Takes a log category and creates a log target config
@param string $category
@return array | [
"Takes",
"a",
"log",
"category",
"and",
"creates",
"a",
"log",
"target",
"config"
] | 9185b885b404b1cb272a0983023eb7c6c0df61c8 | https://github.com/flipboxfactory/craft-ember/blob/9185b885b404b1cb272a0983023eb7c6c0df61c8/src/helpers/LoggerHelper.php#L45-L75 |
32,497 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/HeadersTrait.php | HeadersTrait.setHeaderName | protected function setHeaderName(string $key)
{
$key = strtr(strtolower($key), '_', '-');
if (strpos($key, 'http-') === 0) {
$key = substr($key, 5);
}
return $key;
} | php | protected function setHeaderName(string $key)
{
$key = strtr(strtolower($key), '_', '-');
if (strpos($key, 'http-') === 0) {
$key = substr($key, 5);
}
return $key;
} | [
"protected",
"function",
"setHeaderName",
"(",
"string",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"strtr",
"(",
"strtolower",
"(",
"$",
"key",
")",
",",
"'_'",
",",
"'-'",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'http-'",
")",
"===",
... | Sets case-insensitive header name.
@param string $key
@return string | [
"Sets",
"case",
"-",
"insensitive",
"header",
"name",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/HeadersTrait.php#L68-L75 |
32,498 | davidecesarano/Embryo-Http | Embryo/Http/Message/Traits/HeadersTrait.php | HeadersTrait.setPreserveHost | protected function setPreserveHost(string $headerHost, string $host)
{
$header = [];
if ($host !== '' && $headerHost === '') {
$header = [
'original' => 'HTTP_HOST',
'values' => [$host]
];
}
... | php | protected function setPreserveHost(string $headerHost, string $host)
{
$header = [];
if ($host !== '' && $headerHost === '') {
$header = [
'original' => 'HTTP_HOST',
'values' => [$host]
];
}
... | [
"protected",
"function",
"setPreserveHost",
"(",
"string",
"$",
"headerHost",
",",
"string",
"$",
"host",
")",
"{",
"$",
"header",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"host",
"!==",
"''",
"&&",
"$",
"headerHost",
"===",
"''",
")",
"{",
"$",
"header",... | Sets Host header if preserve host is true.
@param string $headerHost
@param string $host
return string[][] | [
"Sets",
"Host",
"header",
"if",
"preserve",
"host",
"is",
"true",
"."
] | 5ff81c07fbff3abed051d710f0837544465887c8 | https://github.com/davidecesarano/Embryo-Http/blob/5ff81c07fbff3abed051d710f0837544465887c8/Embryo/Http/Message/Traits/HeadersTrait.php#L84-L94 |
32,499 | firebrandhq/silverstripe-hail | src/Models/Image.php | Image.getRelativeCenterX | public function getRelativeCenterX()
{
$pos = 50;
if ($this->FaceCentreX > 0 && $this->OriginalWidth > 0) {
$pos = $this->FaceCentreX / $this->OriginalWidth * 100;
$pos = ($pos > 100 || $pos < 0) ? 50 : $pos;
}
return $pos;
} | php | public function getRelativeCenterX()
{
$pos = 50;
if ($this->FaceCentreX > 0 && $this->OriginalWidth > 0) {
$pos = $this->FaceCentreX / $this->OriginalWidth * 100;
$pos = ($pos > 100 || $pos < 0) ? 50 : $pos;
}
return $pos;
} | [
"public",
"function",
"getRelativeCenterX",
"(",
")",
"{",
"$",
"pos",
"=",
"50",
";",
"if",
"(",
"$",
"this",
"->",
"FaceCentreX",
">",
"0",
"&&",
"$",
"this",
"->",
"OriginalWidth",
">",
"0",
")",
"{",
"$",
"pos",
"=",
"$",
"this",
"->",
"FaceCen... | Get the X axis for the relative center of this image
@return int | [
"Get",
"the",
"X",
"axis",
"for",
"the",
"relative",
"center",
"of",
"this",
"image"
] | fd655b7a568f8d5f6a8f888f39368618596f794e | https://github.com/firebrandhq/silverstripe-hail/blob/fd655b7a568f8d5f6a8f888f39368618596f794e/src/Models/Image.php#L193-L202 |
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.