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,100 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Model/CaptureNotification.php | OffAmazonPaymentsNotifications_Model_CaptureNotification.fromXML | public static function fromXML($xml)
{
$dom = new DOMDocument();
$dom->loadXML($xml);
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('a', self::getNamespace());
$response = $xpath->query('//a:CaptureNotification');
if ($response->length == 1) {
ret... | php | public static function fromXML($xml)
{
$dom = new DOMDocument();
$dom->loadXML($xml);
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('a', self::getNamespace());
$response = $xpath->query('//a:CaptureNotification');
if ($response->length == 1) {
ret... | [
"public",
"static",
"function",
"fromXML",
"(",
"$",
"xml",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"$",
"dom",
"->",
"loadXML",
"(",
"$",
"xml",
")",
";",
"$",
"xpath",
"=",
"new",
"DOMXPath",
"(",
"$",
"dom",
")",
";",
... | Construct OffAmazonPaymentsNotifications_Model_CaptureNotification
from XML string
@param string $xml XML string to construct from
@return OffAmazonPaymentsNotifications_Model_CaptureNotification | [
"Construct",
"OffAmazonPaymentsNotifications_Model_CaptureNotification",
"from",
"XML",
"string"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Model/CaptureNotification.php#L74-L94 |
32,101 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Model/CaptureNotification.php | OffAmazonPaymentsNotifications_Model_CaptureNotification.toXML | public function toXML()
{
$xml = "";
$xml .= "<CaptureNotification xmlns=\"";
$xml .= self::getNamespace();
$xml .= "\">";
$xml .= $this->_toXMLFragment();
$xml .= "</CaptureNotification>";
return $xml;
} | php | public function toXML()
{
$xml = "";
$xml .= "<CaptureNotification xmlns=\"";
$xml .= self::getNamespace();
$xml .= "\">";
$xml .= $this->_toXMLFragment();
$xml .= "</CaptureNotification>";
return $xml;
} | [
"public",
"function",
"toXML",
"(",
")",
"{",
"$",
"xml",
"=",
"\"\"",
";",
"$",
"xml",
".=",
"\"<CaptureNotification xmlns=\\\"\"",
";",
"$",
"xml",
".=",
"self",
"::",
"getNamespace",
"(",
")",
";",
"$",
"xml",
".=",
"\"\\\">\"",
";",
"$",
"xml",
".=... | XML Representation for this object
@return string XML for this object | [
"XML",
"Representation",
"for",
"this",
"object"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Model/CaptureNotification.php#L148-L157 |
32,102 | PGB-LIV/php-ms | src/Reader/MgfReader.php | MgfReader.getLine | private function getLine()
{
if ($this->filePeek == null) {
return fgets($this->fileHandle);
}
$ret = $this->filePeek;
$this->filePeek = null;
return $ret;
} | php | private function getLine()
{
if ($this->filePeek == null) {
return fgets($this->fileHandle);
}
$ret = $this->filePeek;
$this->filePeek = null;
return $ret;
} | [
"private",
"function",
"getLine",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"filePeek",
"==",
"null",
")",
"{",
"return",
"fgets",
"(",
"$",
"this",
"->",
"fileHandle",
")",
";",
"}",
"$",
"ret",
"=",
"$",
"this",
"->",
"filePeek",
";",
"$",
"... | Gets the next line and increments the file iterator
@return string The next line in the file | [
"Gets",
"the",
"next",
"line",
"and",
"increments",
"the",
"file",
"iterator"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Reader/MgfReader.php#L94-L104 |
32,103 | PGB-LIV/php-ms | src/Reader/MgfReader.php | MgfReader.peekLine | private function peekLine()
{
if ($this->filePeek == null) {
$this->filePeek = fgets($this->fileHandle);
}
return $this->filePeek;
} | php | private function peekLine()
{
if ($this->filePeek == null) {
$this->filePeek = fgets($this->fileHandle);
}
return $this->filePeek;
} | [
"private",
"function",
"peekLine",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"filePeek",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"filePeek",
"=",
"fgets",
"(",
"$",
"this",
"->",
"fileHandle",
")",
";",
"}",
"return",
"$",
"this",
"->",
"file... | Gets the next line, though does not move the file iterator
@return string The next line in the file | [
"Gets",
"the",
"next",
"line",
"though",
"does",
"not",
"move",
"the",
"file",
"iterator"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Reader/MgfReader.php#L111-L118 |
32,104 | PGB-LIV/php-ms | src/Reader/MgfReader.php | MgfReader.parseMeta | private function parseMeta(PrecursorIon $precursor)
{
$line = trim($this->getLine());
$pair = explode('=', $line, 2);
$value = $pair[1];
if (is_numeric($value)) {
$value += 0;
}
if ($pair[0] == 'TITLE') {
$precursor->setTitle($pair[1]);
... | php | private function parseMeta(PrecursorIon $precursor)
{
$line = trim($this->getLine());
$pair = explode('=', $line, 2);
$value = $pair[1];
if (is_numeric($value)) {
$value += 0;
}
if ($pair[0] == 'TITLE') {
$precursor->setTitle($pair[1]);
... | [
"private",
"function",
"parseMeta",
"(",
"PrecursorIon",
"$",
"precursor",
")",
"{",
"$",
"line",
"=",
"trim",
"(",
"$",
"this",
"->",
"getLine",
"(",
")",
")",
";",
"$",
"pair",
"=",
"explode",
"(",
"'='",
",",
"$",
"line",
",",
"2",
")",
";",
"... | Parses the meta information from the scan and writes it to the precursor entry
@param PrecursorIon $precursor
The precursor to append to | [
"Parses",
"the",
"meta",
"information",
"from",
"the",
"scan",
"and",
"writes",
"it",
"to",
"the",
"precursor",
"entry"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Reader/MgfReader.php#L179-L210 |
32,105 | PGB-LIV/php-ms | src/Reader/MgfReader.php | MgfReader.parseFragments | private function parseFragments(PrecursorIon $precursor)
{
$line = trim($this->getLine());
if (strlen($line) == 0) {
return;
}
$pair = preg_split('/\\s/', $line, 3);
$ion = new FragmentIon();
$fragmentMz = (float) $pair[0];
$fragmentCharge = 1;
... | php | private function parseFragments(PrecursorIon $precursor)
{
$line = trim($this->getLine());
if (strlen($line) == 0) {
return;
}
$pair = preg_split('/\\s/', $line, 3);
$ion = new FragmentIon();
$fragmentMz = (float) $pair[0];
$fragmentCharge = 1;
... | [
"private",
"function",
"parseFragments",
"(",
"PrecursorIon",
"$",
"precursor",
")",
"{",
"$",
"line",
"=",
"trim",
"(",
"$",
"this",
"->",
"getLine",
"(",
")",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"line",
")",
"==",
"0",
")",
"{",
"return",
";... | Parses the fragment information from the scan and writes it to the precursor entry
@param PrecursorIon $precursor
The precursor to append to | [
"Parses",
"the",
"fragment",
"information",
"from",
"the",
"scan",
"and",
"writes",
"it",
"to",
"the",
"precursor",
"entry"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Reader/MgfReader.php#L218-L243 |
32,106 | comporu/compo-core | src/Compo/FaqBundle/Controller/FaqController.php | FaqController.indexAction | public function indexAction(Request $request)
{
$manager = $this->get('compo_faq.manager.faq');
$page = $request->get('page', 1);
$pager = $manager->getPager([], $page);
$totalPages = $pager->getPageCount();
$seoPage = $this->get('sonata.seo.page');
$seoPage->setCo... | php | public function indexAction(Request $request)
{
$manager = $this->get('compo_faq.manager.faq');
$page = $request->get('page', 1);
$pager = $manager->getPager([], $page);
$totalPages = $pager->getPageCount();
$seoPage = $this->get('sonata.seo.page');
$seoPage->setCo... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"manager",
"=",
"$",
"this",
"->",
"get",
"(",
"'compo_faq.manager.faq'",
")",
";",
"$",
"page",
"=",
"$",
"request",
"->",
"get",
"(",
"'page'",
",",
"1",
")",
";",
... | Lists all article entities.
@param Request $request
@throws \Throwable
@return \Symfony\Component\HttpFoundation\Response | [
"Lists",
"all",
"article",
"entities",
"."
] | ebaa9fe8a4b831506c78fdf637da6b4deadec1e2 | https://github.com/comporu/compo-core/blob/ebaa9fe8a4b831506c78fdf637da6b4deadec1e2/src/Compo/FaqBundle/Controller/FaqController.php#L29-L68 |
32,107 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopOrderStep/TShopStepOrderCompletedCore.class.php | TShopStepOrderCompletedCore.GetDescriptionVariables | protected function GetDescriptionVariables()
{
$aParameter = parent::GetDescriptionVariables();
// add some data about the order so that we can display the details on the closing page
$oUserOrder = &TShopBasket::GetLastCreatedOrder();
if (!is_null($oUserOrder)) {
foreach... | php | protected function GetDescriptionVariables()
{
$aParameter = parent::GetDescriptionVariables();
// add some data about the order so that we can display the details on the closing page
$oUserOrder = &TShopBasket::GetLastCreatedOrder();
if (!is_null($oUserOrder)) {
foreach... | [
"protected",
"function",
"GetDescriptionVariables",
"(",
")",
"{",
"$",
"aParameter",
"=",
"parent",
"::",
"GetDescriptionVariables",
"(",
")",
";",
"// add some data about the order so that we can display the details on the closing page",
"$",
"oUserOrder",
"=",
"&",
"TShopB... | method should return any variables that should be replaced in the description field.
@return array | [
"method",
"should",
"return",
"any",
"variables",
"that",
"should",
"be",
"replaced",
"in",
"the",
"description",
"field",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopOrderStep/TShopStepOrderCompletedCore.class.php#L50-L72 |
32,108 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopOrderStep/TShopStepOrderCompletedCore.class.php | TShopStepOrderCompletedCore.Render | public function Render($sSpotName = null, $aCallTimeVars = array())
{
$oUser = TdbDataExtranetUser::GetInstance();
if (!is_null($oUser->fieldName) && !$oUser->IsLoggedIn()) {
$this->SetLastUserBoughtToSession($oUser);
}
$sHTML = parent::Render($sSpotName, $aCallTimeVars);... | php | public function Render($sSpotName = null, $aCallTimeVars = array())
{
$oUser = TdbDataExtranetUser::GetInstance();
if (!is_null($oUser->fieldName) && !$oUser->IsLoggedIn()) {
$this->SetLastUserBoughtToSession($oUser);
}
$sHTML = parent::Render($sSpotName, $aCallTimeVars);... | [
"public",
"function",
"Render",
"(",
"$",
"sSpotName",
"=",
"null",
",",
"$",
"aCallTimeVars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"oUser",
"=",
"TdbDataExtranetUser",
"::",
"GetInstance",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"oUser",... | used to display the step.
@param array $aCallTimeVars - place any custom vars that you want to pass through the call here
@return string | [
"used",
"to",
"display",
"the",
"step",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopOrderStep/TShopStepOrderCompletedCore.class.php#L81-L96 |
32,109 | edmondscommerce/doctrine-static-meta | src/EntityManager/RetryConnection/Statement.php | Statement.createStatement | private function createStatement()
{
$this->wrappedStatement = $this->connection->prepareUnwrapped($this->sql);
foreach ($this->params as $params) {
$this->bindParam(...$params);
}
$this->params = [];
foreach ($this->values as $values) {
$this->bindVal... | php | private function createStatement()
{
$this->wrappedStatement = $this->connection->prepareUnwrapped($this->sql);
foreach ($this->params as $params) {
$this->bindParam(...$params);
}
$this->params = [];
foreach ($this->values as $values) {
$this->bindVal... | [
"private",
"function",
"createStatement",
"(",
")",
"{",
"$",
"this",
"->",
"wrappedStatement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepareUnwrapped",
"(",
"$",
"this",
"->",
"sql",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"params",
"as",
"$... | Create Statement. | [
"Create",
"Statement",
"."
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/EntityManager/RetryConnection/Statement.php#L52-L63 |
32,110 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroupList.class.php | TShopShippingGroupList.& | public static function &GetAvailableShippingGroups()
{
$oList = &TdbShopShippingGroupList::GetList();
$oList->bAllowItemCache = true;
$oList->RemoveInvalidItems();
$oList->GoToStart();
return $oList;
} | php | public static function &GetAvailableShippingGroups()
{
$oList = &TdbShopShippingGroupList::GetList();
$oList->bAllowItemCache = true;
$oList->RemoveInvalidItems();
$oList->GoToStart();
return $oList;
} | [
"public",
"static",
"function",
"&",
"GetAvailableShippingGroups",
"(",
")",
"{",
"$",
"oList",
"=",
"&",
"TdbShopShippingGroupList",
"::",
"GetList",
"(",
")",
";",
"$",
"oList",
"->",
"bAllowItemCache",
"=",
"true",
";",
"$",
"oList",
"->",
"RemoveInvalidIte... | return all shipping groups available to the current user with the current basket.
@return TdbShopShippingGroupList | [
"return",
"all",
"shipping",
"groups",
"available",
"to",
"the",
"current",
"user",
"with",
"the",
"current",
"basket",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroupList.class.php#L19-L27 |
32,111 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroupList.class.php | TShopShippingGroupList.& | public static function &GetShippingGroupsThatAllowPaymentWith($sPaymentInternalName)
{
$oList = &TdbShopShippingGroupList::GetAvailableShippingGroups();
$bFound = false;
$oShippingGroup = null;
while (!$bFound && ($oShippingGroup = &$oList->Next())) {
$oPaymentMethods = &... | php | public static function &GetShippingGroupsThatAllowPaymentWith($sPaymentInternalName)
{
$oList = &TdbShopShippingGroupList::GetAvailableShippingGroups();
$bFound = false;
$oShippingGroup = null;
while (!$bFound && ($oShippingGroup = &$oList->Next())) {
$oPaymentMethods = &... | [
"public",
"static",
"function",
"&",
"GetShippingGroupsThatAllowPaymentWith",
"(",
"$",
"sPaymentInternalName",
")",
"{",
"$",
"oList",
"=",
"&",
"TdbShopShippingGroupList",
"::",
"GetAvailableShippingGroups",
"(",
")",
";",
"$",
"bFound",
"=",
"false",
";",
"$",
... | search for a shipping group that supports the given payment type
returns false if nothing is found.
@param string $sPaymentInternalName
@return bool | [
"search",
"for",
"a",
"shipping",
"group",
"that",
"supports",
"the",
"given",
"payment",
"type",
"returns",
"false",
"if",
"nothing",
"is",
"found",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroupList.class.php#L37-L55 |
32,112 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroupList.class.php | TShopShippingGroupList.& | public static function &GetPublicShippingGroups()
{
$oList = &TdbShopShippingGroupList::GetList();
$oList->bAllowItemCache = true;
$oList->RemoveRestrictedItems();
return $oList;
} | php | public static function &GetPublicShippingGroups()
{
$oList = &TdbShopShippingGroupList::GetList();
$oList->bAllowItemCache = true;
$oList->RemoveRestrictedItems();
return $oList;
} | [
"public",
"static",
"function",
"&",
"GetPublicShippingGroups",
"(",
")",
"{",
"$",
"oList",
"=",
"&",
"TdbShopShippingGroupList",
"::",
"GetList",
"(",
")",
";",
"$",
"oList",
"->",
"bAllowItemCache",
"=",
"true",
";",
"$",
"oList",
"->",
"RemoveRestrictedIte... | return all shipping groups that have no user restriction.
@return TdbShopShippingGroupList | [
"return",
"all",
"shipping",
"groups",
"that",
"have",
"no",
"user",
"restriction",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroupList.class.php#L62-L69 |
32,113 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroupList.class.php | TShopShippingGroupList.RemoveInvalidItems | public function RemoveInvalidItems()
{
// since this is a tcmsrecord list, we need to collect all valid ids, and the reload the list with them
$oBasket = TShopBasket::GetInstance();
$aValidIds = array();
$this->GoToStart();
$aValidShippingGroupItems = array();
while (... | php | public function RemoveInvalidItems()
{
// since this is a tcmsrecord list, we need to collect all valid ids, and the reload the list with them
$oBasket = TShopBasket::GetInstance();
$aValidIds = array();
$this->GoToStart();
$aValidShippingGroupItems = array();
while (... | [
"public",
"function",
"RemoveInvalidItems",
"(",
")",
"{",
"// since this is a tcmsrecord list, we need to collect all valid ids, and the reload the list with them",
"$",
"oBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"aValidIds",
"=",
"array",
"(",
... | remove list items that are not permited for the current user or basket. | [
"remove",
"list",
"items",
"that",
"are",
"not",
"permited",
"for",
"the",
"current",
"user",
"or",
"basket",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroupList.class.php#L74-L114 |
32,114 | MetaModels/filter_checkbox | src/FilterSetting/Checkbox.php | Checkbox.getAvailableLanguages | private function getAvailableLanguages(IMetaModel $objMetaModel)
{
return ($objMetaModel->isTranslated() && $this->get('all_langs'))
? $objMetaModel->getAvailableLanguages()
: array($objMetaModel->getActiveLanguage());
} | php | private function getAvailableLanguages(IMetaModel $objMetaModel)
{
return ($objMetaModel->isTranslated() && $this->get('all_langs'))
? $objMetaModel->getAvailableLanguages()
: array($objMetaModel->getActiveLanguage());
} | [
"private",
"function",
"getAvailableLanguages",
"(",
"IMetaModel",
"$",
"objMetaModel",
")",
"{",
"return",
"(",
"$",
"objMetaModel",
"->",
"isTranslated",
"(",
")",
"&&",
"$",
"this",
"->",
"get",
"(",
"'all_langs'",
")",
")",
"?",
"$",
"objMetaModel",
"->"... | Get available langauges.
@param IMetaModel $objMetaModel The metamodel.
@return array|null|\string[] | [
"Get",
"available",
"langauges",
"."
] | 613512934656b17a545a45a231e940e26fbd7b6c | https://github.com/MetaModels/filter_checkbox/blob/613512934656b17a545a45a231e940e26fbd7b6c/src/FilterSetting/Checkbox.php#L191-L196 |
32,115 | MetaModels/filter_checkbox | src/FilterSetting/Checkbox.php | Checkbox.prepareLabel | private function prepareLabel(IAttribute $objAttribute)
{
return ($this->get('ynmode') == 'radio' || $this->get('ynfield') ?
array(
($this->get('label') ?: $objAttribute->getName()),
($this->get('ynmode') == 'yes'
? $GLOBALS['TL_LANG']['MSC']['... | php | private function prepareLabel(IAttribute $objAttribute)
{
return ($this->get('ynmode') == 'radio' || $this->get('ynfield') ?
array(
($this->get('label') ?: $objAttribute->getName()),
($this->get('ynmode') == 'yes'
? $GLOBALS['TL_LANG']['MSC']['... | [
"private",
"function",
"prepareLabel",
"(",
"IAttribute",
"$",
"objAttribute",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"get",
"(",
"'ynmode'",
")",
"==",
"'radio'",
"||",
"$",
"this",
"->",
"get",
"(",
"'ynfield'",
")",
"?",
"array",
"(",
"(",
"$",... | Prepare the label depending on yes no mode.
@param IAttribute $objAttribute The metamodel attribute.
@return array
@SuppressWarnings(PHPMD.Superglobals) | [
"Prepare",
"the",
"label",
"depending",
"on",
"yes",
"no",
"mode",
"."
] | 613512934656b17a545a45a231e940e26fbd7b6c | https://github.com/MetaModels/filter_checkbox/blob/613512934656b17a545a45a231e940e26fbd7b6c/src/FilterSetting/Checkbox.php#L207-L229 |
32,116 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.targetStore | public function targetStore() {
if ($this->owner->ParentID) {
$store = $this->owner->Parent()->getCDNStore();
return $store;
}
return $this->contentService->getDefaultStore();
} | php | public function targetStore() {
if ($this->owner->ParentID) {
$store = $this->owner->Parent()->getCDNStore();
return $store;
}
return $this->contentService->getDefaultStore();
} | [
"public",
"function",
"targetStore",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ParentID",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"owner",
"->",
"Parent",
"(",
")",
"->",
"getCDNStore",
"(",
")",
";",
"return",
"$",
"stor... | Return the CDN store that this file should be stored into, based on its
parent setting, if no parent is found the ContentService default is returned | [
"Return",
"the",
"CDN",
"store",
"that",
"this",
"file",
"should",
"be",
"stored",
"into",
"based",
"on",
"its",
"parent",
"setting",
"if",
"no",
"parent",
"is",
"found",
"the",
"ContentService",
"default",
"is",
"returned"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L154-L161 |
32,117 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.updateURL | public function updateURL(&$url) {
if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
return; /** handled in @link ImageCachedExtension */
}
// in the CMS, we do _not_ change the asset
$controller = Controller::has_curr() ? Controller::curr() : null;
... | php | public function updateURL(&$url) {
if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
return; /** handled in @link ImageCachedExtension */
}
// in the CMS, we do _not_ change the asset
$controller = Controller::has_curr() ? Controller::curr() : null;
... | [
"public",
"function",
"updateURL",
"(",
"&",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"instanceof",
"\\",
"Image_Cached",
"||",
"$",
"this",
"->",
"owner",
"instanceof",
"\\",
"CdnImage_Cached",
")",
"{",
"return",
";",
"/** handled in ... | Update the URL used for a file in various locations
@param type $url
@return null | [
"Update",
"the",
"URL",
"used",
"for",
"a",
"file",
"in",
"various",
"locations"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L189-L208 |
32,118 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.getSecureURL | public function getSecureURL($expires = 60) {
if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
return;
}
/** @var \FileContent $pointer */
$pointer = $this->owner->obj('CDNFile');
if($pointer->exists()) {
$reader = $this->reader();
if ($reader && $this->owner-... | php | public function getSecureURL($expires = 60) {
if($this->owner instanceof \Image_Cached || $this->owner instanceof \CdnImage_Cached) {
return;
}
/** @var \FileContent $pointer */
$pointer = $this->owner->obj('CDNFile');
if($pointer->exists()) {
$reader = $this->reader();
if ($reader && $this->owner-... | [
"public",
"function",
"getSecureURL",
"(",
"$",
"expires",
"=",
"60",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"instanceof",
"\\",
"Image_Cached",
"||",
"$",
"this",
"->",
"owner",
"instanceof",
"\\",
"CdnImage_Cached",
")",
"{",
"return",
";",
"... | Return a secure url for the file. Currently we expect all secure urls are time limited but other limiting methods
nay be supported in the future
@param Int $expires number of second the URL will remain valid
@return String URL pointing the the resource | [
"Return",
"a",
"secure",
"url",
"for",
"the",
"file",
".",
"Currently",
"we",
"expect",
"all",
"secure",
"urls",
"are",
"time",
"limited",
"but",
"other",
"limiting",
"methods",
"nay",
"be",
"supported",
"in",
"the",
"future"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L236-L250 |
32,119 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.getViewType | public function getViewType() {
$perm = null;
if ($this->owner->CanViewType == 'Inherit') {
if ($this->owner->ParentID) {
$perm = $this->owner->Parent()->getViewType();
} else {
$member = Member::currentUser();
$perm = $this->owner... | php | public function getViewType() {
$perm = null;
if ($this->owner->CanViewType == 'Inherit') {
if ($this->owner->ParentID) {
$perm = $this->owner->Parent()->getViewType();
} else {
$member = Member::currentUser();
$perm = $this->owner... | [
"public",
"function",
"getViewType",
"(",
")",
"{",
"$",
"perm",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"CanViewType",
"==",
"'Inherit'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ParentID",
")",
"{",
"$",
"per... | Climbs the folder hierarchy until there's a CanViewType that does not equal Inherit
@return String The first valid CanViewType of this File | [
"Climbs",
"the",
"folder",
"hierarchy",
"until",
"there",
"s",
"a",
"CanViewType",
"that",
"does",
"not",
"equal",
"Inherit"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L257-L276 |
32,120 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.onBeforeDelete | public function onBeforeDelete() {
$store = $this->targetStore();
if (strlen($store)) {
Config::inst()->update('File', 'update_filesystem', false);
}
parent::onBeforeDelete();
} | php | public function onBeforeDelete() {
$store = $this->targetStore();
if (strlen($store)) {
Config::inst()->update('File', 'update_filesystem', false);
}
parent::onBeforeDelete();
} | [
"public",
"function",
"onBeforeDelete",
"(",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"targetStore",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"store",
")",
")",
"{",
"Config",
"::",
"inst",
"(",
")",
"->",
"update",
"(",
"'File'",
",",
... | And if deleting don't do so | [
"And",
"if",
"deleting",
"don",
"t",
"do",
"so"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L327-L334 |
32,121 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.uploadToContentService | public function uploadToContentService() {
/** @var \File $file */
$file = $this->owner;
$writer = $this->writer();
if (!$writer) {
return;
}
$path = $file->getFullPath();
if (strlen($path) && is_file($path) && file_exists($path)) {
$mtime = @filemtime($path);
$name = trim($file->getFil... | php | public function uploadToContentService() {
/** @var \File $file */
$file = $this->owner;
$writer = $this->writer();
if (!$writer) {
return;
}
$path = $file->getFullPath();
if (strlen($path) && is_file($path) && file_exists($path)) {
$mtime = @filemtime($path);
$name = trim($file->getFil... | [
"public",
"function",
"uploadToContentService",
"(",
")",
"{",
"/** @var \\File $file */",
"$",
"file",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"writer",
"=",
"$",
"this",
"->",
"writer",
"(",
")",
";",
"if",
"(",
"!",
"$",
"writer",
")",
"{",
"retu... | Upload this content asset to the configured CDN | [
"Upload",
"this",
"content",
"asset",
"to",
"the",
"configured",
"CDN"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L403-L471 |
32,122 | symbiote/silverstripe-cdncontent | code/extensions/CDNFile.php | CDNFile.moveToCdn | public function moveToCdn($newCdn) {
$reader = $this->reader();
// gets the _new_ writer
$writer = $this->getCDNWriter();
// hooking it to match the current cdn path.
$writer->setId($reader->getId());
$writer->write($reader);
$this->owner->CDNFile = $writer->ge... | php | public function moveToCdn($newCdn) {
$reader = $this->reader();
// gets the _new_ writer
$writer = $this->getCDNWriter();
// hooking it to match the current cdn path.
$writer->setId($reader->getId());
$writer->write($reader);
$this->owner->CDNFile = $writer->ge... | [
"public",
"function",
"moveToCdn",
"(",
"$",
"newCdn",
")",
"{",
"$",
"reader",
"=",
"$",
"this",
"->",
"reader",
"(",
")",
";",
"// gets the _new_ writer",
"$",
"writer",
"=",
"$",
"this",
"->",
"getCDNWriter",
"(",
")",
";",
"// hooking it to match the cur... | Moves this file to its same path on the named CDN
@param string $newCdn | [
"Moves",
"this",
"file",
"to",
"its",
"same",
"path",
"on",
"the",
"named",
"CDN"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/extensions/CDNFile.php#L518-L550 |
32,123 | comporu/compo-core | src/Compo/Sonata/AdminBundle/Admin/BreadcrumbsBuilder.php | BreadcrumbsBuilder.createMenuItem | private function createMenuItem(
AdminInterface $admin,
ItemInterface $menu,
$name,
$translationDomain = null,
array $options = []
) {
$options = array_merge([
'extras' => [
'translation_domain' => $translationDomain,
],
... | php | private function createMenuItem(
AdminInterface $admin,
ItemInterface $menu,
$name,
$translationDomain = null,
array $options = []
) {
$options = array_merge([
'extras' => [
'translation_domain' => $translationDomain,
],
... | [
"private",
"function",
"createMenuItem",
"(",
"AdminInterface",
"$",
"admin",
",",
"ItemInterface",
"$",
"menu",
",",
"$",
"name",
",",
"$",
"translationDomain",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"ar... | Creates a new menu item from a simple name. The name is normalized and
translated with the specified translation domain.
@param AdminInterface $admin used for translation
@param ItemInterface $menu will be modified and returned
@param string $name the source of the final ... | [
"Creates",
"a",
"new",
"menu",
"item",
"from",
"a",
"simple",
"name",
".",
"The",
"name",
"is",
"normalized",
"and",
"translated",
"with",
"the",
"specified",
"translation",
"domain",
"."
] | ebaa9fe8a4b831506c78fdf637da6b4deadec1e2 | https://github.com/comporu/compo-core/blob/ebaa9fe8a4b831506c78fdf637da6b4deadec1e2/src/Compo/Sonata/AdminBundle/Admin/BreadcrumbsBuilder.php#L182-L203 |
32,124 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Creation/Process/ReplaceEntityIdFieldProcess.php | ReplaceEntityIdFieldProcess.getUseStatement | private function getUseStatement(): string
{
switch ($this->idTraitFqn) {
case IdFieldTrait::class:
$useStatement = 'use DSM\Fields\Traits\PrimaryKey\IdFieldTrait;';
break;
case NonBinaryUuidFieldTrait::class:
$useStatement = 'use DSM\F... | php | private function getUseStatement(): string
{
switch ($this->idTraitFqn) {
case IdFieldTrait::class:
$useStatement = 'use DSM\Fields\Traits\PrimaryKey\IdFieldTrait;';
break;
case NonBinaryUuidFieldTrait::class:
$useStatement = 'use DSM\F... | [
"private",
"function",
"getUseStatement",
"(",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"this",
"->",
"idTraitFqn",
")",
"{",
"case",
"IdFieldTrait",
"::",
"class",
":",
"$",
"useStatement",
"=",
"'use DSM\\Fields\\Traits\\PrimaryKey\\IdFieldTrait;'",
";",
"br... | Get the use statement to replace it with
@return string | [
"Get",
"the",
"use",
"statement",
"to",
"replace",
"it",
"with"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Creation/Process/ReplaceEntityIdFieldProcess.php#L47-L64 |
32,125 | Erebot/Erebot | src/Patches.php | Patches.patch | public static function patch()
{
set_error_handler(
function ($errno, $errstr, $errfile, $errline) {
if (($errno & error_reporting()) !== $errno) {
return false;
}
throw new \Erebot\ErrorReportingException(
... | php | public static function patch()
{
set_error_handler(
function ($errno, $errstr, $errfile, $errline) {
if (($errno & error_reporting()) !== $errno) {
return false;
}
throw new \Erebot\ErrorReportingException(
... | [
"public",
"static",
"function",
"patch",
"(",
")",
"{",
"set_error_handler",
"(",
"function",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"if",
"(",
"(",
"$",
"errno",
"&",
"error_reporting",
"(",
")",
"... | Apply a few patches to PHP.
\return
This method does not return anything. | [
"Apply",
"a",
"few",
"patches",
"to",
"PHP",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Patches.php#L36-L66 |
32,126 | chameleon-system/chameleon-shop | src/ShopDhlPackstationBundle/pkgShop/objects/db/TShopOrderStep/TPkgShopDhlPackstation_ShopStepUserDataV2.class.php | TPkgShopDhlPackstation_ShopStepUserDataV2.ChangeShippingAddressIsPackstationState | public function ChangeShippingAddressIsPackstationState()
{
$this->SetPreventProcessStepMethodFromExecuting(true);
$bIsDhlPackstation = false;
$aShipping = $this->GetShippingAddressData();
if (is_array($aShipping) && array_key_exists('is_dhl_packstation', $aShipping)) {
... | php | public function ChangeShippingAddressIsPackstationState()
{
$this->SetPreventProcessStepMethodFromExecuting(true);
$bIsDhlPackstation = false;
$aShipping = $this->GetShippingAddressData();
if (is_array($aShipping) && array_key_exists('is_dhl_packstation', $aShipping)) {
... | [
"public",
"function",
"ChangeShippingAddressIsPackstationState",
"(",
")",
"{",
"$",
"this",
"->",
"SetPreventProcessStepMethodFromExecuting",
"(",
"true",
")",
";",
"$",
"bIsDhlPackstation",
"=",
"false",
";",
"$",
"aShipping",
"=",
"$",
"this",
"->",
"GetShippingA... | switch the current shipping address from being a packstation address to a normal address and back. | [
"switch",
"the",
"current",
"shipping",
"address",
"from",
"being",
"a",
"packstation",
"address",
"to",
"a",
"normal",
"address",
"and",
"back",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopDhlPackstationBundle/pkgShop/objects/db/TShopOrderStep/TPkgShopDhlPackstation_ShopStepUserDataV2.class.php#L32-L86 |
32,127 | chameleon-system/chameleon-shop | src/ShopDhlPackstationBundle/pkgShop/objects/db/TShopOrderStep/TPkgShopDhlPackstation_ShopStepUserDataV2.class.php | TPkgShopDhlPackstation_ShopStepUserDataV2.ChangeSelectedAddress | public function ChangeSelectedAddress()
{
$oUser = self::getExtranetUserProvider()->getActiveUser();
if ($oUser->IsLoggedIn()) {
$newShippingAddressId = $this->GetShippingAddressData('selectedAddressId');
$newBillingAddressId = $this->GetBillingAddressData('selectedAddressId'... | php | public function ChangeSelectedAddress()
{
$oUser = self::getExtranetUserProvider()->getActiveUser();
if ($oUser->IsLoggedIn()) {
$newShippingAddressId = $this->GetShippingAddressData('selectedAddressId');
$newBillingAddressId = $this->GetBillingAddressData('selectedAddressId'... | [
"public",
"function",
"ChangeSelectedAddress",
"(",
")",
"{",
"$",
"oUser",
"=",
"self",
"::",
"getExtranetUserProvider",
"(",
")",
"->",
"getActiveUser",
"(",
")",
";",
"if",
"(",
"$",
"oUser",
"->",
"IsLoggedIn",
"(",
")",
")",
"{",
"$",
"newShippingAddr... | Set correct billing address if new selected shipping address is packstation.
{@inheritdoc} | [
"Set",
"correct",
"billing",
"address",
"if",
"new",
"selected",
"shipping",
"address",
"is",
"packstation",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopDhlPackstationBundle/pkgShop/objects/db/TShopOrderStep/TPkgShopDhlPackstation_ShopStepUserDataV2.class.php#L179-L202 |
32,128 | chameleon-system/chameleon-shop | src/ShopDhlPackstationBundle/pkgShop/objects/db/TShopOrderStep/TPkgShopDhlPackstation_ShopStepUserDataV2.class.php | TPkgShopDhlPackstation_ShopStepUserDataV2.updateStepAddressDataForAddressId | private function updateStepAddressDataForAddressId($newShippingAddressId, $newBillingAddressId)
{
$newBillingAddress = TdbDataExtranetUserAddress::GetNewInstance();
if (true === $newBillingAddress->Load($newBillingAddressId)) {
$this->SetBillingAddressData($newBillingAddress->sqlData);
... | php | private function updateStepAddressDataForAddressId($newShippingAddressId, $newBillingAddressId)
{
$newBillingAddress = TdbDataExtranetUserAddress::GetNewInstance();
if (true === $newBillingAddress->Load($newBillingAddressId)) {
$this->SetBillingAddressData($newBillingAddress->sqlData);
... | [
"private",
"function",
"updateStepAddressDataForAddressId",
"(",
"$",
"newShippingAddressId",
",",
"$",
"newBillingAddressId",
")",
"{",
"$",
"newBillingAddress",
"=",
"TdbDataExtranetUserAddress",
"::",
"GetNewInstance",
"(",
")",
";",
"if",
"(",
"true",
"===",
"$",
... | Loads given addresses and updates step address data.
Needed for address selection to load the new selected address.
@param string $newShippingAddressId
@param string $newBillingAddressId | [
"Loads",
"given",
"addresses",
"and",
"updates",
"step",
"address",
"data",
".",
"Needed",
"for",
"address",
"selection",
"to",
"load",
"the",
"new",
"selected",
"address",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopDhlPackstationBundle/pkgShop/objects/db/TShopOrderStep/TPkgShopDhlPackstation_ShopStepUserDataV2.class.php#L220-L234 |
32,129 | Firesphere/silverstripe-bootstrapmfa | src/Handlers/BootstrapMFALoginHandler.php | BootstrapMFALoginHandler.doLogin | public function doLogin($data, MemberLoginForm $form, HTTPRequest $request)
{
/**
* @var ValidationResult $message
* @var Member|MemberExtension $member
*/
$member = $this->checkLogin($data, $request, $message);
if (!$member) {
return $this->redirectBa... | php | public function doLogin($data, MemberLoginForm $form, HTTPRequest $request)
{
/**
* @var ValidationResult $message
* @var Member|MemberExtension $member
*/
$member = $this->checkLogin($data, $request, $message);
if (!$member) {
return $this->redirectBa... | [
"public",
"function",
"doLogin",
"(",
"$",
"data",
",",
"MemberLoginForm",
"$",
"form",
",",
"HTTPRequest",
"$",
"request",
")",
"{",
"/**\n * @var ValidationResult $message\n * @var Member|MemberExtension $member\n */",
"$",
"member",
"=",
"$",
"thi... | Override the doLogin method to do our own work here
@param array $data
@param MemberLoginForm $form
@param HTTPRequest $request
@return HTTPResponse | [
"Override",
"the",
"doLogin",
"method",
"to",
"do",
"our",
"own",
"work",
"here"
] | 8d2d6c6f2f918c8fa157da91550b897816495a4b | https://github.com/Firesphere/silverstripe-bootstrapmfa/blob/8d2d6c6f2f918c8fa157da91550b897816495a4b/src/Handlers/BootstrapMFALoginHandler.php#L91-L121 |
32,130 | Firesphere/silverstripe-bootstrapmfa | src/Handlers/BootstrapMFALoginHandler.php | BootstrapMFALoginHandler.secondFactor | public function secondFactor(HTTPRequest $request)
{
$memberID = $request->getSession()->get(BootstrapMFAAuthenticator::SESSION_KEY . '.MemberID');
/** @var Member|MemberExtension $member */
$member = Member::get()->byID($memberID);
if (!$member) {
// Assume the session ... | php | public function secondFactor(HTTPRequest $request)
{
$memberID = $request->getSession()->get(BootstrapMFAAuthenticator::SESSION_KEY . '.MemberID');
/** @var Member|MemberExtension $member */
$member = Member::get()->byID($memberID);
if (!$member) {
// Assume the session ... | [
"public",
"function",
"secondFactor",
"(",
"HTTPRequest",
"$",
"request",
")",
"{",
"$",
"memberID",
"=",
"$",
"request",
"->",
"getSession",
"(",
")",
"->",
"get",
"(",
"BootstrapMFAAuthenticator",
"::",
"SESSION_KEY",
".",
"'.MemberID'",
")",
";",
"/** @var ... | Render the second factor forms for displaying at the frontend
@param HTTPRequest $request
@return array
@throws \Exception | [
"Render",
"the",
"second",
"factor",
"forms",
"for",
"displaying",
"at",
"the",
"frontend"
] | 8d2d6c6f2f918c8fa157da91550b897816495a4b | https://github.com/Firesphere/silverstripe-bootstrapmfa/blob/8d2d6c6f2f918c8fa157da91550b897816495a4b/src/Handlers/BootstrapMFALoginHandler.php#L130-L154 |
32,131 | Firesphere/silverstripe-bootstrapmfa | src/Handlers/BootstrapMFALoginHandler.php | BootstrapMFALoginHandler.getFormList | protected function getFormList()
{
$formList = [];
foreach ($this->availableAuthenticators as $key => $className) {
/** @var BootstrapMFAAuthenticator $class */
$class = Injector::inst()->get($className);
$formList[] = $class->getMFAForm($this, static::VERIFICATIO... | php | protected function getFormList()
{
$formList = [];
foreach ($this->availableAuthenticators as $key => $className) {
/** @var BootstrapMFAAuthenticator $class */
$class = Injector::inst()->get($className);
$formList[] = $class->getMFAForm($this, static::VERIFICATIO... | [
"protected",
"function",
"getFormList",
"(",
")",
"{",
"$",
"formList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"availableAuthenticators",
"as",
"$",
"key",
"=>",
"$",
"className",
")",
"{",
"/** @var BootstrapMFAAuthenticator $class */",
"$",
"... | Get all MFA forms from the enabled authenticators
@return array | [
"Get",
"all",
"MFA",
"forms",
"from",
"the",
"enabled",
"authenticators"
] | 8d2d6c6f2f918c8fa157da91550b897816495a4b | https://github.com/Firesphere/silverstripe-bootstrapmfa/blob/8d2d6c6f2f918c8fa157da91550b897816495a4b/src/Handlers/BootstrapMFALoginHandler.php#L161-L171 |
32,132 | chameleon-system/chameleon-shop | src/ShopArticlePreorderBundle/objects/db/TPkgShopArticlePreorder.class.php | TPkgShopArticlePreorder.SendMail | public function SendMail($oArticle = null, $sEmail = '')
{
// ------------------------------------------------------------------------
static $aPortals = array();
if (null === $oArticle) {
$oArticle = $this->GetFieldShopArticle();
}
if ('' === $sEmail) {
... | php | public function SendMail($oArticle = null, $sEmail = '')
{
// ------------------------------------------------------------------------
static $aPortals = array();
if (null === $oArticle) {
$oArticle = $this->GetFieldShopArticle();
}
if ('' === $sEmail) {
... | [
"public",
"function",
"SendMail",
"(",
"$",
"oArticle",
"=",
"null",
",",
"$",
"sEmail",
"=",
"''",
")",
"{",
"// ------------------------------------------------------------------------",
"static",
"$",
"aPortals",
"=",
"array",
"(",
")",
";",
"if",
"(",
"null",
... | send email to users email for the given article.
@param TShopArticle $oArticle
@param string $sEmail
@return bool | [
"send",
"email",
"to",
"users",
"email",
"for",
"the",
"given",
"article",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopArticlePreorderBundle/objects/db/TPkgShopArticlePreorder.class.php#L24-L66 |
32,133 | chameleon-system/chameleon-shop | src/ShopArticlePreorderBundle/objects/db/TPkgShopArticlePreorder.class.php | TPkgShopArticlePreorder.SaveNewPreorder | public function SaveNewPreorder($sArticleId = '')
{
// ------------------------------------------------------------------------
$oGlobal = TGlobal::instance();
$oMsgManager = TCMSMessageManager::GetInstance();
if ($oGlobal->userDataExists('eMail') && TTools::IsValidEMail($oGlobal->Ge... | php | public function SaveNewPreorder($sArticleId = '')
{
// ------------------------------------------------------------------------
$oGlobal = TGlobal::instance();
$oMsgManager = TCMSMessageManager::GetInstance();
if ($oGlobal->userDataExists('eMail') && TTools::IsValidEMail($oGlobal->Ge... | [
"public",
"function",
"SaveNewPreorder",
"(",
"$",
"sArticleId",
"=",
"''",
")",
"{",
"// ------------------------------------------------------------------------",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"$",
"oMsgManager",
"=",
"TCMSMessageMan... | save new preorder to the DB.
@param string $sArticleId
@return bool | [
"save",
"new",
"preorder",
"to",
"the",
"DB",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopArticlePreorderBundle/objects/db/TPkgShopArticlePreorder.class.php#L79-L109 |
32,134 | chameleon-system/chameleon-shop | src/ShopDhlPackstationBundle/pkgExtranet/objects/WebModules/MTExtranet_PkgShopDhlPackstation.class.php | MTExtranet_PkgShopDhlPackstation.UpdateShippingAddress | protected function UpdateShippingAddress($aAddress)
{
$oUser = TdbDataExtranetUser::GetInstance();
if ($oUser->DHLPackStationStatusChanged($aAddress)) {
$aAddress = $oUser->fillPackStationFieldValue($aAddress);
if (true === $this->isAddressBillingAddress($aAddress, $oUser) &&... | php | protected function UpdateShippingAddress($aAddress)
{
$oUser = TdbDataExtranetUser::GetInstance();
if ($oUser->DHLPackStationStatusChanged($aAddress)) {
$aAddress = $oUser->fillPackStationFieldValue($aAddress);
if (true === $this->isAddressBillingAddress($aAddress, $oUser) &&... | [
"protected",
"function",
"UpdateShippingAddress",
"(",
"$",
"aAddress",
")",
"{",
"$",
"oUser",
"=",
"TdbDataExtranetUser",
"::",
"GetInstance",
"(",
")",
";",
"if",
"(",
"$",
"oUser",
"->",
"DHLPackStationStatusChanged",
"(",
"$",
"aAddress",
")",
")",
"{",
... | update the shipping address with the data passed.
Set new pack station type before validating
@param array $aAddress
@return bool | [
"update",
"the",
"shipping",
"address",
"with",
"the",
"data",
"passed",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopDhlPackstationBundle/pkgExtranet/objects/WebModules/MTExtranet_PkgShopDhlPackstation.class.php#L25-L50 |
32,135 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopManufacturerArticleCatalogCore/MTShopManufacturerArticleCatalogCore.class.php | MTShopManufacturerArticleCatalogCore.LoadManufacturer | protected function LoadManufacturer()
{
if (is_null($this->oActiveManufacturer) && !is_null($this->iActiveManufacturerId)) {
$this->oActiveManufacturer = TdbShopManufacturer::GetNewInstance();
if (!$this->oActiveManufacturer->Load($this->iActiveManufacturerId)) {
$thi... | php | protected function LoadManufacturer()
{
if (is_null($this->oActiveManufacturer) && !is_null($this->iActiveManufacturerId)) {
$this->oActiveManufacturer = TdbShopManufacturer::GetNewInstance();
if (!$this->oActiveManufacturer->Load($this->iActiveManufacturerId)) {
$thi... | [
"protected",
"function",
"LoadManufacturer",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"oActiveManufacturer",
")",
"&&",
"!",
"is_null",
"(",
"$",
"this",
"->",
"iActiveManufacturerId",
")",
")",
"{",
"$",
"this",
"->",
"oActiveManufacture... | load manufacturer and related data. | [
"load",
"manufacturer",
"and",
"related",
"data",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopManufacturerArticleCatalogCore/MTShopManufacturerArticleCatalogCore.class.php#L43-L53 |
32,136 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php | MTShopArticleCatalogCoreEndPoint.ChangePageAjax | public function ChangePageAjax($iListIdent = null)
{
$oResponse = new MTShopArticleListResponse();
/** @var $oResponse MTShopArticleListResponse */
if (null === $iListIdent) {
$oGlobal = TGlobal::instance();
$iListIdent = $oGlobal->GetUserData(TdbShopArticleList::URL_... | php | public function ChangePageAjax($iListIdent = null)
{
$oResponse = new MTShopArticleListResponse();
/** @var $oResponse MTShopArticleListResponse */
if (null === $iListIdent) {
$oGlobal = TGlobal::instance();
$iListIdent = $oGlobal->GetUserData(TdbShopArticleList::URL_... | [
"public",
"function",
"ChangePageAjax",
"(",
"$",
"iListIdent",
"=",
"null",
")",
"{",
"$",
"oResponse",
"=",
"new",
"MTShopArticleListResponse",
"(",
")",
";",
"/** @var $oResponse MTShopArticleListResponse */",
"if",
"(",
"null",
"===",
"$",
"iListIdent",
")",
"... | send a paging signal to the list with iListIdent
since we changed the list to act on the signal on its own, we only need to return the
result here.
@param string $iListIdent
@return | [
"send",
"a",
"paging",
"signal",
"to",
"the",
"list",
"with",
"iListIdent",
"since",
"we",
"changed",
"the",
"list",
"to",
"act",
"on",
"the",
"signal",
"on",
"its",
"own",
"we",
"only",
"need",
"to",
"return",
"the",
"result",
"here",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php#L144-L178 |
32,137 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php | MTShopArticleCatalogCoreEndPoint.WriteReview | public function WriteReview()
{
// validate user input...
$bDataValide = false;
$oMsgManager = TCMSMessageManager::GetInstance();
$oGlobal = TGlobal::instance();
$aUserData = $oGlobal->GetUserData(TdbShopArticleReview::INPUT_BASE_NAME);
if (is_array($aUserData)) {
... | php | public function WriteReview()
{
// validate user input...
$bDataValide = false;
$oMsgManager = TCMSMessageManager::GetInstance();
$oGlobal = TGlobal::instance();
$aUserData = $oGlobal->GetUserData(TdbShopArticleReview::INPUT_BASE_NAME);
if (is_array($aUserData)) {
... | [
"public",
"function",
"WriteReview",
"(",
")",
"{",
"// validate user input...",
"$",
"bDataValide",
"=",
"false",
";",
"$",
"oMsgManager",
"=",
"TCMSMessageManager",
"::",
"GetInstance",
"(",
")",
";",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")... | write a review. | [
"write",
"a",
"review",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php#L317-L386 |
32,138 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php | MTShopArticleCatalogCoreEndPoint.ViewArticleHook | protected function ViewArticleHook()
{
$this->SetTemplate('MTShopArticleCatalog', 'system/article');
// add review item and fill with user data
$oReviewItem = TdbShopArticleReview::GetNewInstance();
/** @var $oReviewItem TdbShopArticleReview */
$oGlobal = TGlobal::instance()... | php | protected function ViewArticleHook()
{
$this->SetTemplate('MTShopArticleCatalog', 'system/article');
// add review item and fill with user data
$oReviewItem = TdbShopArticleReview::GetNewInstance();
/** @var $oReviewItem TdbShopArticleReview */
$oGlobal = TGlobal::instance()... | [
"protected",
"function",
"ViewArticleHook",
"(",
")",
"{",
"$",
"this",
"->",
"SetTemplate",
"(",
"'MTShopArticleCatalog'",
",",
"'system/article'",
")",
";",
"// add review item and fill with user data",
"$",
"oReviewItem",
"=",
"TdbShopArticleReview",
"::",
"GetNewInsta... | called if the user requested to view an item. | [
"called",
"if",
"the",
"user",
"requested",
"to",
"view",
"an",
"item",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php#L413-L437 |
32,139 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php | MTShopArticleCatalogCoreEndPoint.& | protected function &GetOrderByFilterList()
{
$aFilterIds = $this->oModuleConf->GetMLTIdList('shop_module_articlelist_orderby');
$oList = TdbShopModuleArticlelistOrderbyList::GetListForIds($aFilterIds);
$oList->bAllowItemCache = true;
// fill item cache
$i = 0;
while (... | php | protected function &GetOrderByFilterList()
{
$aFilterIds = $this->oModuleConf->GetMLTIdList('shop_module_articlelist_orderby');
$oList = TdbShopModuleArticlelistOrderbyList::GetListForIds($aFilterIds);
$oList->bAllowItemCache = true;
// fill item cache
$i = 0;
while (... | [
"protected",
"function",
"&",
"GetOrderByFilterList",
"(",
")",
"{",
"$",
"aFilterIds",
"=",
"$",
"this",
"->",
"oModuleConf",
"->",
"GetMLTIdList",
"(",
"'shop_module_articlelist_orderby'",
")",
";",
"$",
"oList",
"=",
"TdbShopModuleArticlelistOrderbyList",
"::",
"... | return order by list for category view.
@return TdbShopModuleArticlelistOrderbyList | [
"return",
"order",
"by",
"list",
"for",
"category",
"view",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php#L494-L507 |
32,140 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php | MTShopArticleCatalogCoreEndPoint.GetActiveShopModuleArticlelistOrderbyId | public function GetActiveShopModuleArticlelistOrderbyId($sInstanceId = '')
{
$iActiveShopModuleArticlelistOrderbyId = null;
$oGlobal = TGlobal::instance();
if ($oGlobal->UserDataExists(self::URL_ORDER_BY)) {
$iActiveShopModuleArticlelistOrderbyId = $oGlobal->GetUserData(self::URL... | php | public function GetActiveShopModuleArticlelistOrderbyId($sInstanceId = '')
{
$iActiveShopModuleArticlelistOrderbyId = null;
$oGlobal = TGlobal::instance();
if ($oGlobal->UserDataExists(self::URL_ORDER_BY)) {
$iActiveShopModuleArticlelistOrderbyId = $oGlobal->GetUserData(self::URL... | [
"public",
"function",
"GetActiveShopModuleArticlelistOrderbyId",
"(",
"$",
"sInstanceId",
"=",
"''",
")",
"{",
"$",
"iActiveShopModuleArticlelistOrderbyId",
"=",
"null",
";",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"$",
"oGlob... | return the active order by id based on session or url parameter.
@return int | [
"return",
"the",
"active",
"order",
"by",
"id",
"based",
"on",
"session",
"or",
"url",
"parameter",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php#L514-L527 |
32,141 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php | MTShopArticleCatalogCoreEndPoint.GetActiveOrderByString | public function GetActiveOrderByString($sDefaultActiveShopModuleArticlelistOrderbyId = null, $sInstanceId = '')
{
static $oOrderBy = null;
if (is_null($oOrderBy)) {
// remove default order by - for performance reason we should be allowed to sort by nothing
$sOrder = ''; //`sh... | php | public function GetActiveOrderByString($sDefaultActiveShopModuleArticlelistOrderbyId = null, $sInstanceId = '')
{
static $oOrderBy = null;
if (is_null($oOrderBy)) {
// remove default order by - for performance reason we should be allowed to sort by nothing
$sOrder = ''; //`sh... | [
"public",
"function",
"GetActiveOrderByString",
"(",
"$",
"sDefaultActiveShopModuleArticlelistOrderbyId",
"=",
"null",
",",
"$",
"sInstanceId",
"=",
"''",
")",
"{",
"static",
"$",
"oOrderBy",
"=",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"oOrderBy",
")",
"... | return the current order string for the article lists.
@return string | [
"return",
"the",
"current",
"order",
"string",
"for",
"the",
"article",
"lists",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopArticleCatalogCore/MTShopArticleCatalogCoreEndPoint.class.php#L534-L565 |
32,142 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Generator/FileCreationTransaction.php | FileCreationTransaction.registerShutdownFunction | private static function registerShutdownFunction(): bool
{
self::$startTime = microtime(true);
register_shutdown_function(
function () {
$error = error_get_last();
if ($error === E_ERROR && count(self::$pathsCreated) > 0) {
self::echoDi... | php | private static function registerShutdownFunction(): bool
{
self::$startTime = microtime(true);
register_shutdown_function(
function () {
$error = error_get_last();
if ($error === E_ERROR && count(self::$pathsCreated) > 0) {
self::echoDi... | [
"private",
"static",
"function",
"registerShutdownFunction",
"(",
")",
":",
"bool",
"{",
"self",
"::",
"$",
"startTime",
"=",
"microtime",
"(",
"true",
")",
";",
"register_shutdown_function",
"(",
"function",
"(",
")",
"{",
"$",
"error",
"=",
"error_get_last",... | Registers our shutdown function. Will attempt to echo out the dirty file clean up commands on a fatal error
@return bool | [
"Registers",
"our",
"shutdown",
"function",
".",
"Will",
"attempt",
"to",
"echo",
"out",
"the",
"dirty",
"file",
"clean",
"up",
"commands",
"on",
"a",
"fatal",
"error"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Generator/FileCreationTransaction.php#L59-L72 |
32,143 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Generator/FileCreationTransaction.php | FileCreationTransaction.echoDirtyTransactionCleanupCommands | public static function echoDirtyTransactionCleanupCommands($handle = STDERR): void
{
if (0 === count(self::$pathsCreated)) {
return;
}
$sinceTimeSeconds = ceil(microtime(true) - self::$startTime);
// why, because of xdebug break - you could easily spend over 1 minute step... | php | public static function echoDirtyTransactionCleanupCommands($handle = STDERR): void
{
if (0 === count(self::$pathsCreated)) {
return;
}
$sinceTimeSeconds = ceil(microtime(true) - self::$startTime);
// why, because of xdebug break - you could easily spend over 1 minute step... | [
"public",
"static",
"function",
"echoDirtyTransactionCleanupCommands",
"(",
"$",
"handle",
"=",
"STDERR",
")",
":",
"void",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"self",
"::",
"$",
"pathsCreated",
")",
")",
"{",
"return",
";",
"}",
"$",
"sinceTimeSecon... | Echos out bash find commands to find and delete created paths
@param bool|resource $handle | [
"Echos",
"out",
"bash",
"find",
"commands",
"to",
"find",
"and",
"delete",
"created",
"paths"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Generator/FileCreationTransaction.php#L79-L108 |
32,144 | PGB-LIV/php-ms | src/experimental/MzMlMerge.php | MzMlMerge.merge | public function merge()
{
// TODO: verify analysis phase run
foreach ($this->dataFiles as $replicate => $fractions) {
$firstFile = current($fractions);
// Write header
$this->writeHeader($firstFile['path'], $this->spectrumCount[$replicate], $this->outputFiles[$rep... | php | public function merge()
{
// TODO: verify analysis phase run
foreach ($this->dataFiles as $replicate => $fractions) {
$firstFile = current($fractions);
// Write header
$this->writeHeader($firstFile['path'], $this->spectrumCount[$replicate], $this->outputFiles[$rep... | [
"public",
"function",
"merge",
"(",
")",
"{",
"// TODO: verify analysis phase run",
"foreach",
"(",
"$",
"this",
"->",
"dataFiles",
"as",
"$",
"replicate",
"=>",
"$",
"fractions",
")",
"{",
"$",
"firstFile",
"=",
"current",
"(",
"$",
"fractions",
")",
";",
... | Merges the MzML files specified in the constructor into a single MzML file and writes the data to the output file specified in the constructor | [
"Merges",
"the",
"MzML",
"files",
"specified",
"in",
"the",
"constructor",
"into",
"a",
"single",
"MzML",
"file",
"and",
"writes",
"the",
"data",
"to",
"the",
"output",
"file",
"specified",
"in",
"the",
"constructor"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/experimental/MzMlMerge.php#L193-L214 |
32,145 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getStaticMethods | public function getStaticMethods(): array
{
if (null !== $this->staticMethods) {
return $this->staticMethods;
}
$this->staticMethods = $this->reflectionClass->getMethods(
\ReflectionMethod::IS_STATIC
);
return $this->staticMethods;
} | php | public function getStaticMethods(): array
{
if (null !== $this->staticMethods) {
return $this->staticMethods;
}
$this->staticMethods = $this->reflectionClass->getMethods(
\ReflectionMethod::IS_STATIC
);
return $this->staticMethods;
} | [
"public",
"function",
"getStaticMethods",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"staticMethods",
")",
"{",
"return",
"$",
"this",
"->",
"staticMethods",
";",
"}",
"$",
"this",
"->",
"staticMethods",
"=",
"$",
"this",
... | Get an array of all static methods implemented by the current class
Merges trait methods
Filters out this trait
@return array|ReflectionMethod[]
@throws \ReflectionException | [
"Get",
"an",
"array",
"of",
"all",
"static",
"methods",
"implemented",
"by",
"the",
"current",
"class"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L149-L159 |
32,146 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.setTableName | private function setTableName(ClassMetadataBuilder $builder): void
{
$tableName = MappingHelper::getTableNameForEntityFqn($this->reflectionClass->getName());
$builder->setTable($tableName);
} | php | private function setTableName(ClassMetadataBuilder $builder): void
{
$tableName = MappingHelper::getTableNameForEntityFqn($this->reflectionClass->getName());
$builder->setTable($tableName);
} | [
"private",
"function",
"setTableName",
"(",
"ClassMetadataBuilder",
"$",
"builder",
")",
":",
"void",
"{",
"$",
"tableName",
"=",
"MappingHelper",
"::",
"getTableNameForEntityFqn",
"(",
"$",
"this",
"->",
"reflectionClass",
"->",
"getName",
"(",
")",
")",
";",
... | Sets the table name for the class
@param ClassMetadataBuilder $builder
@SuppressWarnings(PHPMD.StaticAccess) | [
"Sets",
"the",
"table",
"name",
"for",
"the",
"class"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L168-L172 |
32,147 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getRequiredRelationProperties | public function getRequiredRelationProperties(): array
{
if (null !== $this->requiredRelationProperties) {
return $this->requiredRelationProperties;
}
$traits = $this->reflectionClass->getTraits();
$return = [];
foreach ($traits as $traitName => $traitReflection) ... | php | public function getRequiredRelationProperties(): array
{
if (null !== $this->requiredRelationProperties) {
return $this->requiredRelationProperties;
}
$traits = $this->reflectionClass->getTraits();
$return = [];
foreach ($traits as $traitName => $traitReflection) ... | [
"public",
"function",
"getRequiredRelationProperties",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"requiredRelationProperties",
")",
"{",
"return",
"$",
"this",
"->",
"requiredRelationProperties",
";",
"}",
"$",
"traits",
"=",
"$... | Get an array of required relation properties, keyed by the property name and the value being an array of FQNs
for the declared types
@return array [ propertyName => [...types]]
@throws \ReflectionException | [
"Get",
"an",
"array",
"of",
"required",
"relation",
"properties",
"keyed",
"by",
"the",
"property",
"name",
"and",
"the",
"value",
"being",
"an",
"array",
"of",
"FQNs",
"for",
"the",
"declared",
"types"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L199-L223 |
32,148 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getTypesFromVarComment | private function getTypesFromVarComment(string $property, ReflectionClass $traitReflection): array
{
$docComment = $this->reflectionClass->getProperty($property)->getDocComment();
\preg_match('%@var\s*?(.+)%', $docComment, $matches);
$traitCode = \ts\file_get_contents($traitReflection->getFi... | php | private function getTypesFromVarComment(string $property, ReflectionClass $traitReflection): array
{
$docComment = $this->reflectionClass->getProperty($property)->getDocComment();
\preg_match('%@var\s*?(.+)%', $docComment, $matches);
$traitCode = \ts\file_get_contents($traitReflection->getFi... | [
"private",
"function",
"getTypesFromVarComment",
"(",
"string",
"$",
"property",
",",
"ReflectionClass",
"$",
"traitReflection",
")",
":",
"array",
"{",
"$",
"docComment",
"=",
"$",
"this",
"->",
"reflectionClass",
"->",
"getProperty",
"(",
"$",
"property",
")",... | Parse the docblock for a property and get the type, then read the source code to resolve the short type to the
FQN of the type. Roll on PHP 7.3
@param string $property
@param ReflectionClass $traitReflection
@return array | [
"Parse",
"the",
"docblock",
"for",
"a",
"property",
"and",
"get",
"the",
"type",
"then",
"read",
"the",
"source",
"code",
"to",
"resolve",
"the",
"short",
"type",
"to",
"the",
"FQN",
"of",
"the",
"type",
".",
"Roll",
"on",
"PHP",
"7",
".",
"3"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L235-L266 |
32,149 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getEmbeddableProperties | public function getEmbeddableProperties(): array
{
if (null !== $this->embeddableProperties) {
return $this->embeddableProperties;
}
$traits = $this->reflectionClass->getTraits();
$return = [];
foreach ($traits as $traitName => $traitReflection) {
if (... | php | public function getEmbeddableProperties(): array
{
if (null !== $this->embeddableProperties) {
return $this->embeddableProperties;
}
$traits = $this->reflectionClass->getTraits();
$return = [];
foreach ($traits as $traitName => $traitReflection) {
if (... | [
"public",
"function",
"getEmbeddableProperties",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"embeddableProperties",
")",
"{",
"return",
"$",
"this",
"->",
"embeddableProperties",
";",
"}",
"$",
"traits",
"=",
"$",
"this",
"->... | Get an array of property names that contain embeddable objects
@return array
@throws \ReflectionException | [
"Get",
"an",
"array",
"of",
"property",
"names",
"that",
"contain",
"embeddable",
"objects"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L292-L315 |
32,150 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getPlural | public function getPlural(): string
{
try {
if (null === $this->plural) {
$singular = $this->getSingular();
$this->plural = Inflector::pluralize($singular);
}
return $this->plural;
} catch (\Exception $e) {
throw ne... | php | public function getPlural(): string
{
try {
if (null === $this->plural) {
$singular = $this->getSingular();
$this->plural = Inflector::pluralize($singular);
}
return $this->plural;
} catch (\Exception $e) {
throw ne... | [
"public",
"function",
"getPlural",
"(",
")",
":",
"string",
"{",
"try",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"plural",
")",
"{",
"$",
"singular",
"=",
"$",
"this",
"->",
"getSingular",
"(",
")",
";",
"$",
"this",
"->",
"plural",
"=",
... | Get the property name the Entity is mapped by when plural
Override it in your entity class if you are using an Entity class name that doesn't pluralize nicely
@return string
@throws DoctrineStaticMetaException
@SuppressWarnings(PHPMD.StaticAccess) | [
"Get",
"the",
"property",
"name",
"the",
"Entity",
"is",
"mapped",
"by",
"when",
"plural"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L326-L342 |
32,151 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getSingular | public function getSingular(): string
{
try {
if (null === $this->singular) {
$reflectionClass = $this->getReflectionClass();
$shortName = $reflectionClass->getShortName();
$singularShortName = MappingHelper::singularize($shortName);
... | php | public function getSingular(): string
{
try {
if (null === $this->singular) {
$reflectionClass = $this->getReflectionClass();
$shortName = $reflectionClass->getShortName();
$singularShortName = MappingHelper::singularize($shortName);
... | [
"public",
"function",
"getSingular",
"(",
")",
":",
"string",
"{",
"try",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"singular",
")",
"{",
"$",
"reflectionClass",
"=",
"$",
"this",
"->",
"getReflectionClass",
"(",
")",
";",
"$",
"shortName",
"="... | Get the property the name the Entity is mapped by when singular
@return string
@throws DoctrineStaticMetaException
@SuppressWarnings(PHPMD.StaticAccess) | [
"Get",
"the",
"property",
"the",
"name",
"the",
"Entity",
"is",
"mapped",
"by",
"when",
"singular"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L351-L381 |
32,152 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getSetters | public function getSetters(): array
{
if (null !== $this->setters) {
return $this->setters;
}
$skip = [
'addPropertyChangedListener' => true,
'setEntityCollectionAndNotify' => true,
'addToEntityCollectionAndNotify' => true,
... | php | public function getSetters(): array
{
if (null !== $this->setters) {
return $this->setters;
}
$skip = [
'addPropertyChangedListener' => true,
'setEntityCollectionAndNotify' => true,
'addToEntityCollectionAndNotify' => true,
... | [
"public",
"function",
"getSetters",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"setters",
")",
"{",
"return",
"$",
"this",
"->",
"setters",
";",
"}",
"$",
"skip",
"=",
"[",
"'addPropertyChangedListener'",
"=>",
"true",
",... | Get an array of setters by name
@return array|string[] | [
"Get",
"an",
"array",
"of",
"setters",
"by",
"name"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L407-L434 |
32,153 | edmondscommerce/doctrine-static-meta | src/DoctrineStaticMeta.php | DoctrineStaticMeta.getGetters | public function getGetters(): array
{
if (null !== $this->getters) {
return $this->getters;
}
$skip = [
'getEntityFqn' => true,
'getDoctrineStaticMeta' => true,
'isValid' => true,
'getValidator' => tr... | php | public function getGetters(): array
{
if (null !== $this->getters) {
return $this->getters;
}
$skip = [
'getEntityFqn' => true,
'getDoctrineStaticMeta' => true,
'isValid' => true,
'getValidator' => tr... | [
"public",
"function",
"getGetters",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"getters",
")",
"{",
"return",
"$",
"this",
"->",
"getters",
";",
"}",
"$",
"skip",
"=",
"[",
"'getEntityFqn'",
"=>",
"true",
",",
"'getDoct... | Get an array of getters by name
@return array|string[]
@throws \ReflectionException | [
"Get",
"an",
"array",
"of",
"getters",
"by",
"name"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/DoctrineStaticMeta.php#L471-L505 |
32,154 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopDiscount.class.php | TShopDiscount.IsActive | public function IsActive()
{
$sToday = date('Y-m-d H:i:s');
$bIsActive = ($this->fieldActive && ($this->fieldActiveFrom <= $sToday && ($this->fieldActiveTo >= $sToday || '0000-00-00 00:00:00' == $this->fieldActiveTo)));
return $bIsActive;
} | php | public function IsActive()
{
$sToday = date('Y-m-d H:i:s');
$bIsActive = ($this->fieldActive && ($this->fieldActiveFrom <= $sToday && ($this->fieldActiveTo >= $sToday || '0000-00-00 00:00:00' == $this->fieldActiveTo)));
return $bIsActive;
} | [
"public",
"function",
"IsActive",
"(",
")",
"{",
"$",
"sToday",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
";",
"$",
"bIsActive",
"=",
"(",
"$",
"this",
"->",
"fieldActive",
"&&",
"(",
"$",
"this",
"->",
"fieldActiveFrom",
"<=",
"$",
"sToday",
"&&",
"(",
... | return true if the discount is active.
@return bool | [
"return",
"true",
"if",
"the",
"discount",
"is",
"active",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopDiscount.class.php#L70-L76 |
32,155 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopDiscount.class.php | TShopDiscount.GetValue | public function GetValue()
{
$dValue = $this->fieldValue;
$oBasket = TShopBasket::GetInstance();
$dBasketValueApplicableForDiscount = $oBasket->GetBasketSumForDiscount($this);
$dValue = $this->GetValueForBasketValue($dBasketValueApplicableForDiscount);
return $dValue;
} | php | public function GetValue()
{
$dValue = $this->fieldValue;
$oBasket = TShopBasket::GetInstance();
$dBasketValueApplicableForDiscount = $oBasket->GetBasketSumForDiscount($this);
$dValue = $this->GetValueForBasketValue($dBasketValueApplicableForDiscount);
return $dValue;
} | [
"public",
"function",
"GetValue",
"(",
")",
"{",
"$",
"dValue",
"=",
"$",
"this",
"->",
"fieldValue",
";",
"$",
"oBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"dBasketValueApplicableForDiscount",
"=",
"$",
"oBasket",
"->",
"GetBasket... | Returns the value of the discount - takes the current basket and user into consideration.
@return float | [
"Returns",
"the",
"value",
"of",
"the",
"discount",
"-",
"takes",
"the",
"current",
"basket",
"and",
"user",
"into",
"consideration",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopDiscount.class.php#L173-L181 |
32,156 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopDiscount.class.php | TShopDiscount.AllowDiscountForArticle | public function AllowDiscountForArticle(TdbShopArticle $oArticle)
{
$bMayBeUsed = true;
if ($oArticle->fieldExcludeFromDiscounts) {
$bMayBeUsed = false;
}
// check article restrictions
if ($bMayBeUsed) {
$aArticleRestrictions = $this->GetFieldShopArti... | php | public function AllowDiscountForArticle(TdbShopArticle $oArticle)
{
$bMayBeUsed = true;
if ($oArticle->fieldExcludeFromDiscounts) {
$bMayBeUsed = false;
}
// check article restrictions
if ($bMayBeUsed) {
$aArticleRestrictions = $this->GetFieldShopArti... | [
"public",
"function",
"AllowDiscountForArticle",
"(",
"TdbShopArticle",
"$",
"oArticle",
")",
"{",
"$",
"bMayBeUsed",
"=",
"true",
";",
"if",
"(",
"$",
"oArticle",
"->",
"fieldExcludeFromDiscounts",
")",
"{",
"$",
"bMayBeUsed",
"=",
"false",
";",
"}",
"// chec... | return true if the discount may be used for the article.
@param TdbShopArticle $oArticle
@return bool | [
"return",
"true",
"if",
"the",
"discount",
"may",
"be",
"used",
"for",
"the",
"article",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopDiscount.class.php#L212-L236 |
32,157 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopDiscount.class.php | TShopDiscount.ClearCacheOnAllAffectedArticles | public function ClearCacheOnAllAffectedArticles()
{
$iStartOperation = time();
$aArticleRestrictions = $this->GetMLTIdList('shop_article_mlt');
foreach ($aArticleRestrictions as $sArticelId) {
TCacheManager::PerformeTableChange('shop_article', $sArticelId);
}
$aC... | php | public function ClearCacheOnAllAffectedArticles()
{
$iStartOperation = time();
$aArticleRestrictions = $this->GetMLTIdList('shop_article_mlt');
foreach ($aArticleRestrictions as $sArticelId) {
TCacheManager::PerformeTableChange('shop_article', $sArticelId);
}
$aC... | [
"public",
"function",
"ClearCacheOnAllAffectedArticles",
"(",
")",
"{",
"$",
"iStartOperation",
"=",
"time",
"(",
")",
";",
"$",
"aArticleRestrictions",
"=",
"$",
"this",
"->",
"GetMLTIdList",
"(",
"'shop_article_mlt'",
")",
";",
"foreach",
"(",
"$",
"aArticleRe... | trigger a clear cache on all related articles. | [
"trigger",
"a",
"clear",
"cache",
"on",
"all",
"related",
"articles",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopDiscount.class.php#L345-L379 |
32,158 | chameleon-system/chameleon-shop | src/ShopBundle/mappers/order/TPkgShopMapper_OrderArticleList.class.php | TPkgShopMapper_OrderArticleList.getArticleImageId | protected function getArticleImageId(TdbShopArticle $oArticle, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled, $sImageSizeName = 'basket')
{
$sImageId = '';
if (null !== $oArticle) {
$oImage = $oArticle->GetImagePreviewObject($sImageSizeName);
if (null ... | php | protected function getArticleImageId(TdbShopArticle $oArticle, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled, $sImageSizeName = 'basket')
{
$sImageId = '';
if (null !== $oArticle) {
$oImage = $oArticle->GetImagePreviewObject($sImageSizeName);
if (null ... | [
"protected",
"function",
"getArticleImageId",
"(",
"TdbShopArticle",
"$",
"oArticle",
",",
"IMapperCacheTriggerRestricted",
"$",
"oCacheTriggerManager",
",",
"$",
"bCachingEnabled",
",",
"$",
"sImageSizeName",
"=",
"'basket'",
")",
"{",
"$",
"sImageId",
"=",
"''",
"... | get the image id of connected article for given order item in the dimensions defined by the given image size identifier.
@param TdbShopArticle $oArticle
@param IMapperCacheTriggerRestricted $oCacheTriggerManager
@param bool $bCachingEnabled
@param string $... | [
"get",
"the",
"image",
"id",
"of",
"connected",
"article",
"for",
"given",
"order",
"item",
"in",
"the",
"dimensions",
"defined",
"by",
"the",
"given",
"image",
"size",
"identifier",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/mappers/order/TPkgShopMapper_OrderArticleList.class.php#L109-L136 |
32,159 | Erebot/Erebot | src/Config/Proxy.php | Proxy.parseBoolHelper | public static function parseBoolHelper($value)
{
$value = strtolower($value);
if (in_array($value, array('true', '1', 'on', 'yes'), true)) {
return true;
}
if (in_array($value, array('false', '0', 'off', 'no'), true)) {
return false;
}
return n... | php | public static function parseBoolHelper($value)
{
$value = strtolower($value);
if (in_array($value, array('true', '1', 'on', 'yes'), true)) {
return true;
}
if (in_array($value, array('false', '0', 'off', 'no'), true)) {
return false;
}
return n... | [
"public",
"static",
"function",
"parseBoolHelper",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"strtolower",
"(",
"$",
"value",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"value",
",",
"array",
"(",
"'true'",
",",
"'1'",
",",
"'on'",
",",
"'yes'"... | Parses a text and tries to extract a boolean value.
\param string $value
The text from which a boolean should be extracted.
\retval bool
If a boolean could be extracted from the $value provided,
it is returned as the corresponding PHP boolean value
(either \b true or \b false).
\retval null
No boolean could be extra... | [
"Parses",
"a",
"text",
"and",
"tries",
"to",
"extract",
"a",
"boolean",
"value",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Config/Proxy.php#L203-L213 |
32,160 | Erebot/Erebot | src/Config/Proxy.php | Proxy.parseIntHelper | public static function parseIntHelper($value)
{
if ($value == '') {
return null;
}
if (is_int($value)) {
return $value;
}
if (ctype_digit($value)) {
return (int) $value;
}
if (strpos('+-', $value[0]) !== false && ctype_di... | php | public static function parseIntHelper($value)
{
if ($value == '') {
return null;
}
if (is_int($value)) {
return $value;
}
if (ctype_digit($value)) {
return (int) $value;
}
if (strpos('+-', $value[0]) !== false && ctype_di... | [
"public",
"static",
"function",
"parseIntHelper",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"is_int",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"if... | Parses a text and tries to extract an integer value.
\param string $value
The text from which an integer should be extracted.
\retval int
If an integer could be extracted from the $value provided,
it is returned as the corresponding PHP (signed) integer value.
\retval null
If no integer could be extracted. | [
"Parses",
"a",
"text",
"and",
"tries",
"to",
"extract",
"an",
"integer",
"value",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Config/Proxy.php#L228-L247 |
32,161 | Erebot/Erebot | src/Config/Proxy.php | Proxy.parseSomething | protected function parseSomething(
$module,
$param,
$default,
callable $parser,
$origin,
callable $checker
) {
try {
if (!isset($this->modules[$module])) {
throw new \Erebot\NotFoundException('No such module');
}
... | php | protected function parseSomething(
$module,
$param,
$default,
callable $parser,
$origin,
callable $checker
) {
try {
if (!isset($this->modules[$module])) {
throw new \Erebot\NotFoundException('No such module');
}
... | [
"protected",
"function",
"parseSomething",
"(",
"$",
"module",
",",
"$",
"param",
",",
"$",
"default",
",",
"callable",
"$",
"parser",
",",
"$",
"origin",
",",
"callable",
"$",
"checker",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this... | Returns the typed value for a module's parameter.
\param string $module
The name of the module.
\param string $param
The name of the parameter to fetch
from the module's settings.
\param mixed $default
Default value if no value has been
defined in the module's settings,
or \b null if there is no default value.
\par... | [
"Returns",
"the",
"typed",
"value",
"for",
"a",
"module",
"s",
"parameter",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Config/Proxy.php#L313-L349 |
32,162 | CHH/sirel | lib/Sirel/InsertManager.php | InsertManager.values | function values(array $values)
{
$cols = array();
$vals = array();
foreach ($values as $col => $val) {
if (null !== $val) {
$cols[] = $col;
$vals[] = $val;
}
}
foreach ($cols as &$col) {
$this->nodes->colum... | php | function values(array $values)
{
$cols = array();
$vals = array();
foreach ($values as $col => $val) {
if (null !== $val) {
$cols[] = $col;
$vals[] = $val;
}
}
foreach ($cols as &$col) {
$this->nodes->colum... | [
"function",
"values",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"cols",
"=",
"array",
"(",
")",
";",
"$",
"vals",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"col",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"null",
"... | Column-Value-Pairs
@param array $values
@return InsertManager | [
"Column",
"-",
"Value",
"-",
"Pairs"
] | 7c32b8ed3b975dc18c0e5e257edfd11207e5c8a8 | https://github.com/CHH/sirel/blob/7c32b8ed3b975dc18c0e5e257edfd11207e5c8a8/lib/Sirel/InsertManager.php#L45-L63 |
32,163 | CHH/sirel | lib/Sirel/InsertManager.php | InsertManager.columns | function columns(array $columns)
{
foreach ($columns as &$col) {
if (!$col instanceof Attribute) {
$col = new UnqualifiedColumn($col);
}
}
$this->nodes->columns = $columns;
return $this;
} | php | function columns(array $columns)
{
foreach ($columns as &$col) {
if (!$col instanceof Attribute) {
$col = new UnqualifiedColumn($col);
}
}
$this->nodes->columns = $columns;
return $this;
} | [
"function",
"columns",
"(",
"array",
"$",
"columns",
")",
"{",
"foreach",
"(",
"$",
"columns",
"as",
"&",
"$",
"col",
")",
"{",
"if",
"(",
"!",
"$",
"col",
"instanceof",
"Attribute",
")",
"{",
"$",
"col",
"=",
"new",
"UnqualifiedColumn",
"(",
"$",
... | Sets columns for this insert
@param array $columns
@return InsertManager | [
"Sets",
"columns",
"for",
"this",
"insert"
] | 7c32b8ed3b975dc18c0e5e257edfd11207e5c8a8 | https://github.com/CHH/sirel/blob/7c32b8ed3b975dc18c0e5e257edfd11207e5c8a8/lib/Sirel/InsertManager.php#L71-L80 |
32,164 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans_SwissPostFinance.class.php | TShopPaymentHandlerDataTrans_SwissPostFinance.GetPaymentParameter | protected function GetPaymentParameter()
{
$aParameter = parent::GetPaymentParameter();
$aParameter['paymentmethod'] = 'POS';
$aParameter['paymenttype'] = self::PAYMENT_TYPE;
$aParameter['currency'] = 'CHF';
return $aParameter;
} | php | protected function GetPaymentParameter()
{
$aParameter = parent::GetPaymentParameter();
$aParameter['paymentmethod'] = 'POS';
$aParameter['paymenttype'] = self::PAYMENT_TYPE;
$aParameter['currency'] = 'CHF';
return $aParameter;
} | [
"protected",
"function",
"GetPaymentParameter",
"(",
")",
"{",
"$",
"aParameter",
"=",
"parent",
"::",
"GetPaymentParameter",
"(",
")",
";",
"$",
"aParameter",
"[",
"'paymentmethod'",
"]",
"=",
"'POS'",
";",
"$",
"aParameter",
"[",
"'paymenttype'",
"]",
"=",
... | Get hidden field parameter needed for payment.
Add payment type to hidden parameter to. was needed to check correct
payment method in authorisation response.
@return array | [
"Get",
"hidden",
"field",
"parameter",
"needed",
"for",
"payment",
".",
"Add",
"payment",
"type",
"to",
"hidden",
"parameter",
"to",
".",
"was",
"needed",
"to",
"check",
"correct",
"payment",
"method",
"in",
"authorisation",
"response",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans_SwissPostFinance.class.php#L90-L98 |
32,165 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans_SwissPostFinance.class.php | TShopPaymentHandlerDataTrans_SwissPostFinance.AllowUse | public function AllowUse(TdbShopPaymentMethod &$oPaymentMethod)
{
$bAllowUse = parent::AllowUse($oPaymentMethod);
if ($bAllowUse) {
if (preg_match('/Chrome/i', $_SERVER['HTTP_USER_AGENT']) || preg_match('/Opera/i', $_SERVER['HTTP_USER_AGENT'])) {
$bAllowUse = false;
... | php | public function AllowUse(TdbShopPaymentMethod &$oPaymentMethod)
{
$bAllowUse = parent::AllowUse($oPaymentMethod);
if ($bAllowUse) {
if (preg_match('/Chrome/i', $_SERVER['HTTP_USER_AGENT']) || preg_match('/Opera/i', $_SERVER['HTTP_USER_AGENT'])) {
$bAllowUse = false;
... | [
"public",
"function",
"AllowUse",
"(",
"TdbShopPaymentMethod",
"&",
"$",
"oPaymentMethod",
")",
"{",
"$",
"bAllowUse",
"=",
"parent",
"::",
"AllowUse",
"(",
"$",
"oPaymentMethod",
")",
";",
"if",
"(",
"$",
"bAllowUse",
")",
"{",
"if",
"(",
"preg_match",
"(... | return true if the the payment handler may be used by the payment method passed.
you can use this hook to disable payment methods based on basket contents, payment method, user data, ...
Don't show payment PostFinance if user browser is Chrome or Opera. because PostFinance wont work with them.
@param TdbShopPaymentMe... | [
"return",
"true",
"if",
"the",
"the",
"payment",
"handler",
"may",
"be",
"used",
"by",
"the",
"payment",
"method",
"passed",
".",
"you",
"can",
"use",
"this",
"hook",
"to",
"disable",
"payment",
"methods",
"based",
"on",
"basket",
"contents",
"payment",
"m... | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerDataTrans_SwissPostFinance.class.php#L142-L152 |
32,166 | Firesphere/silverstripe-bootstrapmfa | src/Generators/CodeGenerator.php | CodeGenerator.generate | public function generate()
{
$chars = $this->validChars();
$numChars = strlen($chars) - 1;
$length = $this->getLength();
$code = array();
for ($i = 0; $i < $length; ++$i) {
$code[] = $chars[random_int(0, $numChars)];
}
return implode('', $code);
... | php | public function generate()
{
$chars = $this->validChars();
$numChars = strlen($chars) - 1;
$length = $this->getLength();
$code = array();
for ($i = 0; $i < $length; ++$i) {
$code[] = $chars[random_int(0, $numChars)];
}
return implode('', $code);
... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"chars",
"=",
"$",
"this",
"->",
"validChars",
"(",
")",
";",
"$",
"numChars",
"=",
"strlen",
"(",
"$",
"chars",
")",
"-",
"1",
";",
"$",
"length",
"=",
"$",
"this",
"->",
"getLength",
"(",
")... | Generate a random resulting string
@return string | [
"Generate",
"a",
"random",
"resulting",
"string"
] | 8d2d6c6f2f918c8fa157da91550b897816495a4b | https://github.com/Firesphere/silverstripe-bootstrapmfa/blob/8d2d6c6f2f918c8fa157da91550b897816495a4b/src/Generators/CodeGenerator.php#L127-L138 |
32,167 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlistArticle.class.php | TPkgShopWishlistArticle.GetCommentAsHTML | public function GetCommentAsHTML()
{
$sText = trim($this->fieldComment);
$sText = TGlobal::OutHTML($sText);
$sText = nl2br($sText);
return $sText;
} | php | public function GetCommentAsHTML()
{
$sText = trim($this->fieldComment);
$sText = TGlobal::OutHTML($sText);
$sText = nl2br($sText);
return $sText;
} | [
"public",
"function",
"GetCommentAsHTML",
"(",
")",
"{",
"$",
"sText",
"=",
"trim",
"(",
"$",
"this",
"->",
"fieldComment",
")",
";",
"$",
"sText",
"=",
"TGlobal",
"::",
"OutHTML",
"(",
"$",
"sText",
")",
";",
"$",
"sText",
"=",
"nl2br",
"(",
"$",
... | return comment text as html.
@return string | [
"return",
"comment",
"text",
"as",
"html",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlistArticle.class.php#L21-L28 |
32,168 | chameleon-system/chameleon-shop | src/ShopWishlistBundle/objects/db/TPkgShopWishlistArticle.class.php | TPkgShopWishlistArticle.GetRemoveFromWishlistLink | public function GetRemoveFromWishlistLink($bIncludePortalLink = false)
{
$oShopConfig = TdbShop::GetInstance();
$aParameters = array('module_fnc['.$oShopConfig->GetBasketModuleSpotName().']' => 'RemoveFromWishlist', MTShopBasketCore::URL_ITEM_ID => $this->id, MTShopBasketCore::URL_MESSAGE_CONSUMER =... | php | public function GetRemoveFromWishlistLink($bIncludePortalLink = false)
{
$oShopConfig = TdbShop::GetInstance();
$aParameters = array('module_fnc['.$oShopConfig->GetBasketModuleSpotName().']' => 'RemoveFromWishlist', MTShopBasketCore::URL_ITEM_ID => $this->id, MTShopBasketCore::URL_MESSAGE_CONSUMER =... | [
"public",
"function",
"GetRemoveFromWishlistLink",
"(",
"$",
"bIncludePortalLink",
"=",
"false",
")",
"{",
"$",
"oShopConfig",
"=",
"TdbShop",
"::",
"GetInstance",
"(",
")",
";",
"$",
"aParameters",
"=",
"array",
"(",
"'module_fnc['",
".",
"$",
"oShopConfig",
... | get link to remove item from wishlist.
@param bool $bIncludePortalLink
@return string | [
"get",
"link",
"to",
"remove",
"item",
"from",
"wishlist",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopWishlistBundle/objects/db/TPkgShopWishlistArticle.class.php#L37-L43 |
32,169 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Action/CreateEmbeddableAction.php | CreateEmbeddableAction.run | public function run(): void
{
if ('' === (string)$this->catName) {
throw new \RuntimeException('You must call setCatName before running this action');
}
if ('' === (string)$this->name) {
throw new \RuntimeException('You must call setName before running this action');
... | php | public function run(): void
{
if ('' === (string)$this->catName) {
throw new \RuntimeException('You must call setCatName before running this action');
}
if ('' === (string)$this->name) {
throw new \RuntimeException('You must call setName before running this action');
... | [
"public",
"function",
"run",
"(",
")",
":",
"void",
"{",
"if",
"(",
"''",
"===",
"(",
"string",
")",
"$",
"this",
"->",
"catName",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'You must call setCatName before running this action'",
")",
";",
"}"... | This must be the method that actually performs the action
All your requirements, configuration and dependencies must be called with individual setters | [
"This",
"must",
"be",
"the",
"method",
"that",
"actually",
"performs",
"the",
"action"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Action/CreateEmbeddableAction.php#L65-L78 |
32,170 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php | SimpleCheckoutExample.calculateOrderTotalBasedOnBuyerDetails | public function calculateOrderTotalBasedOnBuyerDetails($orderReferenceDetails, $orderAmountPreTaxAndShipping, $shippingType)
{
return $this->_shippingAndTaxCostHelper->calculateTotalAmount($orderReferenceDetails,
$orderAmountPreTaxAndShipping, $shippingType);
} | php | public function calculateOrderTotalBasedOnBuyerDetails($orderReferenceDetails, $orderAmountPreTaxAndShipping, $shippingType)
{
return $this->_shippingAndTaxCostHelper->calculateTotalAmount($orderReferenceDetails,
$orderAmountPreTaxAndShipping, $shippingType);
} | [
"public",
"function",
"calculateOrderTotalBasedOnBuyerDetails",
"(",
"$",
"orderReferenceDetails",
",",
"$",
"orderAmountPreTaxAndShipping",
",",
"$",
"shippingType",
")",
"{",
"return",
"$",
"this",
"->",
"_shippingAndTaxCostHelper",
"->",
"calculateTotalAmount",
"(",
"$... | Calculate the total amount to charge the buyer for this order,
based on the buyer destination address
Note that until the order is confirmed, the name & address fields will
not be returned to the client
@param OffAmazonPaymentsService_Model_OrderReferenceDetails $orderReferenceDetails response
@param string ... | [
"Calculate",
"the",
"total",
"amount",
"to",
"charge",
"the",
"buyer",
"for",
"this",
"order",
"based",
"on",
"the",
"buyer",
"destination",
"address"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php#L115-L119 |
32,171 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php | SimpleCheckoutExample.confirmOrderReference | public function confirmOrderReference()
{
$confirmOrderReferenceRequest
= new OffAmazonPaymentsService_Model_ConfirmOrderReferenceRequest();
$confirmOrderReferenceRequest
->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
$confirmOrderReferenceRequest->setS... | php | public function confirmOrderReference()
{
$confirmOrderReferenceRequest
= new OffAmazonPaymentsService_Model_ConfirmOrderReferenceRequest();
$confirmOrderReferenceRequest
->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
$confirmOrderReferenceRequest->setS... | [
"public",
"function",
"confirmOrderReference",
"(",
")",
"{",
"$",
"confirmOrderReferenceRequest",
"=",
"new",
"OffAmazonPaymentsService_Model_ConfirmOrderReferenceRequest",
"(",
")",
";",
"$",
"confirmOrderReferenceRequest",
"->",
"setAmazonOrderReferenceId",
"(",
"$",
"this... | Confirm the order reference information, allowing for
authorizations and captures to be created
@return OffAmazonPaymentsService_Model_ConfirmOrderReferenceResponse service response | [
"Confirm",
"the",
"order",
"reference",
"information",
"allowing",
"for",
"authorizations",
"and",
"captures",
"to",
"be",
"created"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php#L157-L166 |
32,172 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php | SimpleCheckoutExample.captureOrderAmount | public function captureOrderAmount($captureAmount, $amazonAuthorizationId)
{
$captureRequest = new OffAmazonPaymentsService_Model_CaptureRequest();
$captureRequest->setSellerId($this->_sellerId);
$captureRequest->setAmazonAuthorizationId($amazonAuthorizationId);
$captureRequest->setC... | php | public function captureOrderAmount($captureAmount, $amazonAuthorizationId)
{
$captureRequest = new OffAmazonPaymentsService_Model_CaptureRequest();
$captureRequest->setSellerId($this->_sellerId);
$captureRequest->setAmazonAuthorizationId($amazonAuthorizationId);
$captureRequest->setC... | [
"public",
"function",
"captureOrderAmount",
"(",
"$",
"captureAmount",
",",
"$",
"amazonAuthorizationId",
")",
"{",
"$",
"captureRequest",
"=",
"new",
"OffAmazonPaymentsService_Model_CaptureRequest",
"(",
")",
";",
"$",
"captureRequest",
"->",
"setSellerId",
"(",
"$",... | Perform the capture call for the order
@param float $captureAmount amount to capture from the buyer
@param string $amazonAuthorizationId auth id to perform the capture on
@return OffAmazonPaymentsService_Model_CaptureResponse service response | [
"Perform",
"the",
"capture",
"call",
"for",
"the",
"order"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php#L248-L259 |
32,173 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php | SimpleCheckoutExample.closeOrderReference | public function closeOrderReference()
{
$closeOrderReferenceRequest = new OffAmazonPaymentsService_Model_CloseOrderReferenceRequest();
$closeOrderReferenceRequest->setSellerId($this->_sellerId);
$closeOrderReferenceRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
$... | php | public function closeOrderReference()
{
$closeOrderReferenceRequest = new OffAmazonPaymentsService_Model_CloseOrderReferenceRequest();
$closeOrderReferenceRequest->setSellerId($this->_sellerId);
$closeOrderReferenceRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
$... | [
"public",
"function",
"closeOrderReference",
"(",
")",
"{",
"$",
"closeOrderReferenceRequest",
"=",
"new",
"OffAmazonPaymentsService_Model_CloseOrderReferenceRequest",
"(",
")",
";",
"$",
"closeOrderReferenceRequest",
"->",
"setSellerId",
"(",
"$",
"this",
"->",
"_sellerI... | Close this order reference to indicate that the order is complete, and
no further authorizations and captures will be performed on this order
@return OffAmazonPaymentsService_Model_CloseOrderReferenceResponse service response | [
"Close",
"this",
"order",
"reference",
"to",
"indicate",
"that",
"the",
"order",
"is",
"complete",
"and",
"no",
"further",
"authorizations",
"and",
"captures",
"will",
"be",
"performed",
"on",
"this",
"order"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExample.php#L285-L293 |
32,174 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php | OffAmazonPaymentsService_RegionSpecificProperties.getWidgetUrlFor | public function getWidgetUrlFor($region, $environment, $merchantId, $overrideUrl)
{
return sprintf(self::WIDGET_FORMAT_STRING,
$this->_getWidgetHostFor($region, $overrideUrl),
$this->_getWidgetRegionFor($region),
$this->_getWidgetEnvironmentFor($environment),
urlencode($merchantId));
} | php | public function getWidgetUrlFor($region, $environment, $merchantId, $overrideUrl)
{
return sprintf(self::WIDGET_FORMAT_STRING,
$this->_getWidgetHostFor($region, $overrideUrl),
$this->_getWidgetRegionFor($region),
$this->_getWidgetEnvironmentFor($environment),
urlencode($merchantId));
} | [
"public",
"function",
"getWidgetUrlFor",
"(",
"$",
"region",
",",
"$",
"environment",
",",
"$",
"merchantId",
",",
"$",
"overrideUrl",
")",
"{",
"return",
"sprintf",
"(",
"self",
"::",
"WIDGET_FORMAT_STRING",
",",
"$",
"this",
"->",
"_getWidgetHostFor",
"(",
... | Return the correct widget url for the javascript widget
@param string $region
@param string $environment
@param string $merchantId
@param string $overrideUrl
@return string widgetUrl | [
"Return",
"the",
"correct",
"widget",
"url",
"for",
"the",
"javascript",
"widget"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php#L69-L76 |
32,175 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php | OffAmazonPaymentsService_RegionSpecificProperties.getServiceUrlFor | public function getServiceUrlFor($region, $environment, $overrideUrl)
{
return sprintf(self::SERVICE_FORMAT_STRING,
$this->_getServiceHostFor($region, $overrideUrl),
$this->_getSectionNameFor($environment),
OffAmazonPaymentsService_Client::SERVICE_VERSION);
} | php | public function getServiceUrlFor($region, $environment, $overrideUrl)
{
return sprintf(self::SERVICE_FORMAT_STRING,
$this->_getServiceHostFor($region, $overrideUrl),
$this->_getSectionNameFor($environment),
OffAmazonPaymentsService_Client::SERVICE_VERSION);
} | [
"public",
"function",
"getServiceUrlFor",
"(",
"$",
"region",
",",
"$",
"environment",
",",
"$",
"overrideUrl",
")",
"{",
"return",
"sprintf",
"(",
"self",
"::",
"SERVICE_FORMAT_STRING",
",",
"$",
"this",
"->",
"_getServiceHostFor",
"(",
"$",
"region",
",",
... | Return the mws service for this region
@param string $region merchant region - us, na, uk, de
@param string $environment service - live, sandbox
@param string $overrideUrl override url
@return string mws service url | [
"Return",
"the",
"mws",
"service",
"for",
"this",
"region"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php#L87-L93 |
32,176 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php | OffAmazonPaymentsService_RegionSpecificProperties.getCurrencyFor | public function getCurrencyFor($region)
{
$this->_validateRegionIsDefined($region, $this->_currencyCodes);
return $this->_currencyCodes[$region];
} | php | public function getCurrencyFor($region)
{
$this->_validateRegionIsDefined($region, $this->_currencyCodes);
return $this->_currencyCodes[$region];
} | [
"public",
"function",
"getCurrencyFor",
"(",
"$",
"region",
")",
"{",
"$",
"this",
"->",
"_validateRegionIsDefined",
"(",
"$",
"region",
",",
"$",
"this",
"->",
"_currencyCodes",
")",
";",
"return",
"$",
"this",
"->",
"_currencyCodes",
"[",
"$",
"region",
... | Get the currency code for the given region
@param string $region us,uk,de,na
@return string currency code | [
"Get",
"the",
"currency",
"code",
"for",
"the",
"given",
"region"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php#L102-L106 |
32,177 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php | OffAmazonPaymentsService_RegionSpecificProperties._getWidgetHostFor | private function _getWidgetHostFor($region, $overrideUrl)
{
if (empty($overrideUrl)) {
return $this->_getRegionPropertyFor($region, $this->_widgetUrls);
}
return $overrideUrl;
} | php | private function _getWidgetHostFor($region, $overrideUrl)
{
if (empty($overrideUrl)) {
return $this->_getRegionPropertyFor($region, $this->_widgetUrls);
}
return $overrideUrl;
} | [
"private",
"function",
"_getWidgetHostFor",
"(",
"$",
"region",
",",
"$",
"overrideUrl",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"overrideUrl",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_getRegionPropertyFor",
"(",
"$",
"region",
",",
"$",
"this",
"->... | Return the correct host for the widget url based on the region
@param string $region us,uk,de,na
@param string $overrideUrl override string for widget host
@return string widget host | [
"Return",
"the",
"correct",
"host",
"for",
"the",
"widget",
"url",
"based",
"on",
"the",
"region"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php#L116-L123 |
32,178 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php | OffAmazonPaymentsService_RegionSpecificProperties._getServiceHostFor | private function _getServiceHostFor($region, $overrideUrl)
{
if (empty($overrideUrl)) {
return $this->_getRegionPropertyFor($region, $this->_serviceUrls);
}
return $overrideUrl;
} | php | private function _getServiceHostFor($region, $overrideUrl)
{
if (empty($overrideUrl)) {
return $this->_getRegionPropertyFor($region, $this->_serviceUrls);
}
return $overrideUrl;
} | [
"private",
"function",
"_getServiceHostFor",
"(",
"$",
"region",
",",
"$",
"overrideUrl",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"overrideUrl",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_getRegionPropertyFor",
"(",
"$",
"region",
",",
"$",
"this",
"-... | Return the correct host for the service url based on the region
@param string $region us,uk,de,na
@param string $overrideUrl override string for service host
@return string mws host | [
"Return",
"the",
"correct",
"host",
"for",
"the",
"service",
"url",
"based",
"on",
"the",
"region"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php#L133-L140 |
32,179 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php | OffAmazonPaymentsService_RegionSpecificProperties._getRegionPropertyFor | private function _getRegionPropertyFor($region, $properties)
{
$this->_validateRegionIsDefined($region, $this->_regionMappings);
return $properties[$this->_regionMappings[$region]];
} | php | private function _getRegionPropertyFor($region, $properties)
{
$this->_validateRegionIsDefined($region, $this->_regionMappings);
return $properties[$this->_regionMappings[$region]];
} | [
"private",
"function",
"_getRegionPropertyFor",
"(",
"$",
"region",
",",
"$",
"properties",
")",
"{",
"$",
"this",
"->",
"_validateRegionIsDefined",
"(",
"$",
"region",
",",
"$",
"this",
"->",
"_regionMappings",
")",
";",
"return",
"$",
"properties",
"[",
"$... | Return the correct value for this region from an
associate array keyed by realms
@param string $region us,uk,de,na
@param array $properties associate array of realms to property values
@return string property for region | [
"Return",
"the",
"correct",
"value",
"for",
"this",
"region",
"from",
"an",
"associate",
"array",
"keyed",
"by",
"realms"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/RegionSpecificProperties.php#L151-L155 |
32,180 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroup.class.php | TShopShippingGroup.& | public function &GetValidPaymentMethods($bRefresh = false)
{
if (is_null($this->oValidPaymentMethods) || $bRefresh) {
$this->oValidPaymentMethods = &TdbShopPaymentMethodList::GetAvailableMethods($this->id);
$this->oValidPaymentMethods->bAllowItemCache = true;
}
if (!i... | php | public function &GetValidPaymentMethods($bRefresh = false)
{
if (is_null($this->oValidPaymentMethods) || $bRefresh) {
$this->oValidPaymentMethods = &TdbShopPaymentMethodList::GetAvailableMethods($this->id);
$this->oValidPaymentMethods->bAllowItemCache = true;
}
if (!i... | [
"public",
"function",
"&",
"GetValidPaymentMethods",
"(",
"$",
"bRefresh",
"=",
"false",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"oValidPaymentMethods",
")",
"||",
"$",
"bRefresh",
")",
"{",
"$",
"this",
"->",
"oValidPaymentMethods",
"=",
"... | return list of valid payment methods.
@param bool $bRefresh - set to true to force a regeneration of the list
@return TdbShopPaymentMethodList | [
"return",
"list",
"of",
"valid",
"payment",
"methods",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroup.class.php#L340-L351 |
32,181 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroup.class.php | TShopShippingGroup.GetVat | public function GetVat()
{
$oVat = $this->GetFromInternalCache('ovat');
if (is_null($oVat)) {
$oVat = null;
$oShopConf = TdbShop::GetInstance();
if (!$oShopConf->fieldShippingVatDependsOnBasketContents) {
$oVat = $this->GetFieldShopVat();
... | php | public function GetVat()
{
$oVat = $this->GetFromInternalCache('ovat');
if (is_null($oVat)) {
$oVat = null;
$oShopConf = TdbShop::GetInstance();
if (!$oShopConf->fieldShippingVatDependsOnBasketContents) {
$oVat = $this->GetFieldShopVat();
... | [
"public",
"function",
"GetVat",
"(",
")",
"{",
"$",
"oVat",
"=",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'ovat'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oVat",
")",
")",
"{",
"$",
"oVat",
"=",
"null",
";",
"$",
"oShopConf",
"=",
"TdbSh... | return the vat group for this shipping group.
@return TdbShopVat | [
"return",
"the",
"vat",
"group",
"for",
"this",
"shipping",
"group",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroup.class.php#L420-L441 |
32,182 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroup.class.php | TShopShippingGroup.GetValidPaymentMethodsSelectableByTheUser | public function GetValidPaymentMethodsSelectableByTheUser()
{
$oPaymentMethods = clone $this->GetValidPaymentMethods(true);
$aInvalidMethods = array();
$oPaymentMethods->GoToStart();
while ($oPaymentMethod = $oPaymentMethods->Next()) {
$oHandler = $oPaymentMethod->GetFiel... | php | public function GetValidPaymentMethodsSelectableByTheUser()
{
$oPaymentMethods = clone $this->GetValidPaymentMethods(true);
$aInvalidMethods = array();
$oPaymentMethods->GoToStart();
while ($oPaymentMethod = $oPaymentMethods->Next()) {
$oHandler = $oPaymentMethod->GetFiel... | [
"public",
"function",
"GetValidPaymentMethodsSelectableByTheUser",
"(",
")",
"{",
"$",
"oPaymentMethods",
"=",
"clone",
"$",
"this",
"->",
"GetValidPaymentMethods",
"(",
"true",
")",
";",
"$",
"aInvalidMethods",
"=",
"array",
"(",
")",
";",
"$",
"oPaymentMethods",... | return a the active list of payment handlers reduced to those, that the user may select in the payment step.
@return TdbShopPaymentMethodList | [
"return",
"a",
"the",
"active",
"list",
"of",
"payment",
"handlers",
"reduced",
"to",
"those",
"that",
"the",
"user",
"may",
"select",
"in",
"the",
"payment",
"step",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroup.class.php#L472-L489 |
32,183 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroup.class.php | TShopShippingGroup.GetValidShippingTypesForBasketArticleListAndCountry | public function GetValidShippingTypesForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
{
$oValidShippingTypes = new TIterator();
/** @var $oValidShippingTypes TIterator* */
$oShippingTypes = $this->GetFieldShopShippingTypeList('position');
while ($oShippingType = $... | php | public function GetValidShippingTypesForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
{
$oValidShippingTypes = new TIterator();
/** @var $oValidShippingTypes TIterator* */
$oShippingTypes = $this->GetFieldShopShippingTypeList('position');
while ($oShippingType = $... | [
"public",
"function",
"GetValidShippingTypesForBasketArticleListAndCountry",
"(",
"$",
"oBasketArticleList",
",",
"$",
"sDataCountryId",
")",
"{",
"$",
"oValidShippingTypes",
"=",
"new",
"TIterator",
"(",
")",
";",
"/** @var $oValidShippingTypes TIterator* */",
"$",
"oShipp... | Get a list of shipping types based on a basket article list and the desired shipping country id.
@param TShopBasketArticleList $oBasketArticleList
@param string $sDataCountryId
@return TIterator | [
"Get",
"a",
"list",
"of",
"shipping",
"types",
"based",
"on",
"a",
"basket",
"article",
"list",
"and",
"the",
"desired",
"shipping",
"country",
"id",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroup.class.php#L515-L535 |
32,184 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingGroup.class.php | TShopShippingGroup.GetShippingCostsForBasketArticleListAndCountry | public function GetShippingCostsForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
{
/** @var Request $request */
$request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest();
$oBasketArticleList->GoToStart();
$oOldBasket = clon... | php | public function GetShippingCostsForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
{
/** @var Request $request */
$request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest();
$oBasketArticleList->GoToStart();
$oOldBasket = clon... | [
"public",
"function",
"GetShippingCostsForBasketArticleListAndCountry",
"(",
"$",
"oBasketArticleList",
",",
"$",
"sDataCountryId",
")",
"{",
"/** @var Request $request */",
"$",
"request",
"=",
"\\",
"ChameleonSystem",
"\\",
"CoreBundle",
"\\",
"ServiceLocator",
"::",
"g... | Calculate the shipping costs for a basket article list to be expected for a certain shipping country id.
@param TShopBasketArticleList $oBasketArticleList
@param string $sDataCountryId
@return float | [
"Calculate",
"the",
"shipping",
"costs",
"for",
"a",
"basket",
"article",
"list",
"to",
"be",
"expected",
"for",
"a",
"certain",
"shipping",
"country",
"id",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingGroup.class.php#L545-L591 |
32,185 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopVoucherSeries.class.php | TShopVoucherSeries.NumberOfTimesUsedByUser | public function NumberOfTimesUsedByUser($iDataExtranetUserId = null, $aExcludeVouchers = array())
{
$iNumberOfVouchersUsed = 0;
if (is_null($iDataExtranetUserId)) {
$oUser = TdbDataExtranetUser::GetInstance();
$iDataExtranetUserId = $oUser->id;
}
$sRestricti... | php | public function NumberOfTimesUsedByUser($iDataExtranetUserId = null, $aExcludeVouchers = array())
{
$iNumberOfVouchersUsed = 0;
if (is_null($iDataExtranetUserId)) {
$oUser = TdbDataExtranetUser::GetInstance();
$iDataExtranetUserId = $oUser->id;
}
$sRestricti... | [
"public",
"function",
"NumberOfTimesUsedByUser",
"(",
"$",
"iDataExtranetUserId",
"=",
"null",
",",
"$",
"aExcludeVouchers",
"=",
"array",
"(",
")",
")",
"{",
"$",
"iNumberOfVouchersUsed",
"=",
"0",
";",
"if",
"(",
"is_null",
"(",
"$",
"iDataExtranetUserId",
"... | returns the number of vouchers from that series that have been used by the user (note, we count
also the vouchers that have been used in part only.
@param int $iDataExtranetUserId (if null, use the current user)
@param array $aExcludeVouchers - the voucher ids to exclude from the count
@return int | [
"returns",
"the",
"number",
"of",
"vouchers",
"from",
"that",
"series",
"that",
"have",
"been",
"used",
"by",
"the",
"user",
"(",
"note",
"we",
"count",
"also",
"the",
"vouchers",
"that",
"have",
"been",
"used",
"in",
"part",
"only",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopVoucherSeries.class.php#L44-L73 |
32,186 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopVoucherSeries.class.php | TShopVoucherSeries.CreateNewVoucher | public function CreateNewVoucher($sCode = null)
{
if (is_null($sCode)) {
$bCodeUnique = false;
$dMaxTry = 15;
$sCode = '';
while (!$bCodeUnique && $dMaxTry > 0) {
--$dMaxTry;
$sCode = TdbShopVoucher::GenerateVoucherCode();
... | php | public function CreateNewVoucher($sCode = null)
{
if (is_null($sCode)) {
$bCodeUnique = false;
$dMaxTry = 15;
$sCode = '';
while (!$bCodeUnique && $dMaxTry > 0) {
--$dMaxTry;
$sCode = TdbShopVoucher::GenerateVoucherCode();
... | [
"public",
"function",
"CreateNewVoucher",
"(",
"$",
"sCode",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"sCode",
")",
")",
"{",
"$",
"bCodeUnique",
"=",
"false",
";",
"$",
"dMaxTry",
"=",
"15",
";",
"$",
"sCode",
"=",
"''",
";",
"while"... | create a new voucher.
@param string $sCode - code to create
@return TdbShopVoucher | [
"create",
"a",
"new",
"voucher",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopVoucherSeries.class.php#L82-L105 |
32,187 | Erebot/Erebot | src/CLI.php | CLI.cleanupPidfile | public static function cleanupPidfile($handle, $pidfile)
{
flock($handle, LOCK_UN);
@unlink($pidfile);
$logger = \Plop\Plop::getInstance();
$logger->debug(
'Removed lock on pidfile (%(pidfile)s)',
array('pidfile' => $pidfile)
);
} | php | public static function cleanupPidfile($handle, $pidfile)
{
flock($handle, LOCK_UN);
@unlink($pidfile);
$logger = \Plop\Plop::getInstance();
$logger->debug(
'Removed lock on pidfile (%(pidfile)s)',
array('pidfile' => $pidfile)
);
} | [
"public",
"static",
"function",
"cleanupPidfile",
"(",
"$",
"handle",
",",
"$",
"pidfile",
")",
"{",
"flock",
"(",
"$",
"handle",
",",
"LOCK_UN",
")",
";",
"@",
"unlink",
"(",
"$",
"pidfile",
")",
";",
"$",
"logger",
"=",
"\\",
"Plop",
"\\",
"Plop",
... | Called after the bot has finished its execution
to perform cleanup tasks.
\param resource $handle
Open file handle on the pidfile.
\param string $pidfile
Name of the pidfile.
\return
This method does not return anything. | [
"Called",
"after",
"the",
"bot",
"has",
"finished",
"its",
"execution",
"to",
"perform",
"cleanup",
"tasks",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/CLI.php#L68-L77 |
32,188 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/OpenSslVerifySignature.php | OpenSslVerifySignature.verifySignatureIsCorrect | public function verifySignatureIsCorrect($data, $signature, $certificatePath)
{
$cert = $this->_getCertificateFromCertifcatePath($certificatePath);
$certKey = openssl_get_publickey($cert);
if ($certKey === False) {
throw new OffAmazonPaymentsNotifications_InvalidMessageExceptio... | php | public function verifySignatureIsCorrect($data, $signature, $certificatePath)
{
$cert = $this->_getCertificateFromCertifcatePath($certificatePath);
$certKey = openssl_get_publickey($cert);
if ($certKey === False) {
throw new OffAmazonPaymentsNotifications_InvalidMessageExceptio... | [
"public",
"function",
"verifySignatureIsCorrect",
"(",
"$",
"data",
",",
"$",
"signature",
",",
"$",
"certificatePath",
")",
"{",
"$",
"cert",
"=",
"$",
"this",
"->",
"_getCertificateFromCertifcatePath",
"(",
"$",
"certificatePath",
")",
";",
"$",
"certKey",
"... | Verify that the signature is correct for the given data and
public key
@param string $data data to validate
@param string $signature decoded signature to compare against
@param string $certificatePath path to certificate, can be file or url
@throws OffAmazonPaymentsNotifications_InvalidMessageExcepti... | [
"Verify",
"that",
"the",
"signature",
"is",
"correct",
"for",
"the",
"given",
"data",
"and",
"public",
"key"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/OpenSslVerifySignature.php#L53-L75 |
32,189 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/OpenSslVerifySignature.php | OpenSslVerifySignature._getCertificateFromCertifcatePath | private function _getCertificateFromCertifcatePath($certificatePath)
{
$this->_validateUrl($certificatePath); //ADDED EXTRA CHECK
try {
$cert = file_get_contents($certificatePath);
} catch (Exception $ex) {
throw new OffAmazonPaymentsNotifications_InvalidMessageExcept... | php | private function _getCertificateFromCertifcatePath($certificatePath)
{
$this->_validateUrl($certificatePath); //ADDED EXTRA CHECK
try {
$cert = file_get_contents($certificatePath);
} catch (Exception $ex) {
throw new OffAmazonPaymentsNotifications_InvalidMessageExcept... | [
"private",
"function",
"_getCertificateFromCertifcatePath",
"(",
"$",
"certificatePath",
")",
"{",
"$",
"this",
"->",
"_validateUrl",
"(",
"$",
"certificatePath",
")",
";",
"//ADDED EXTRA CHECK",
"try",
"{",
"$",
"cert",
"=",
"file_get_contents",
"(",
"$",
"certif... | Request the signing certificate from the given path, in order to
get the public key
@param string $certificatePath certificate path to retreive
@throws OffAmazonPaymentsNotifications_InvalidMessageException
@return void | [
"Request",
"the",
"signing",
"certificate",
"from",
"the",
"given",
"path",
"in",
"order",
"to",
"get",
"the",
"public",
"key"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/OpenSslVerifySignature.php#L87-L107 |
32,190 | edmondscommerce/doctrine-static-meta | src/Entity/Savers/EntitySaverFactory.php | EntitySaverFactory.getSaverForEntity | public function getSaverForEntity(
EntityInterface $entity
): EntitySaverInterface {
$fqn = $this->getEntityNamespace($entity);
return $this->getSaverForEntityFqn($fqn);
} | php | public function getSaverForEntity(
EntityInterface $entity
): EntitySaverInterface {
$fqn = $this->getEntityNamespace($entity);
return $this->getSaverForEntityFqn($fqn);
} | [
"public",
"function",
"getSaverForEntity",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"EntitySaverInterface",
"{",
"$",
"fqn",
"=",
"$",
"this",
"->",
"getEntityNamespace",
"(",
"$",
"entity",
")",
";",
"return",
"$",
"this",
"->",
"getSaverForEntityFqn",
... | Gets the Entity Specific Saver if one is defined, otherwise the standard Entity Saver
@param EntityInterface $entity
@return EntitySaverInterface | [
"Gets",
"the",
"Entity",
"Specific",
"Saver",
"if",
"one",
"is",
"defined",
"otherwise",
"the",
"standard",
"Entity",
"Saver"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/Entity/Savers/EntitySaverFactory.php#L47-L53 |
32,191 | edmondscommerce/doctrine-static-meta | src/Entity/Savers/EntitySaverFactory.php | EntitySaverFactory.getEntityNamespace | private function getEntityNamespace(EntityInterface $entity): string
{
if ($entity instanceof Proxy) {
$proxyFqn = \get_class($entity);
$namespace = $this->entityManager->getConfiguration()->getProxyNamespace();
$marker = \Doctrine\Common\Persistence\Proxy::MARKER;
... | php | private function getEntityNamespace(EntityInterface $entity): string
{
if ($entity instanceof Proxy) {
$proxyFqn = \get_class($entity);
$namespace = $this->entityManager->getConfiguration()->getProxyNamespace();
$marker = \Doctrine\Common\Persistence\Proxy::MARKER;
... | [
"private",
"function",
"getEntityNamespace",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"string",
"{",
"if",
"(",
"$",
"entity",
"instanceof",
"Proxy",
")",
"{",
"$",
"proxyFqn",
"=",
"\\",
"get_class",
"(",
"$",
"entity",
")",
";",
"$",
"namespace",... | It is possible to pass a proxy to the class which will trigger a fatal error due to autoloading problems.
This will resolve the namespace to that of the entity, rather than the proxy. May need to update this to handle
other cases
@param EntityInterface $entity
@return string | [
"It",
"is",
"possible",
"to",
"pass",
"a",
"proxy",
"to",
"the",
"class",
"which",
"will",
"trigger",
"a",
"fatal",
"error",
"due",
"to",
"autoloading",
"problems",
"."
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/Entity/Savers/EntitySaverFactory.php#L65-L76 |
32,192 | chameleon-system/chameleon-shop | src/ShopBundle/objects/TCMSTableEditor/TCMSTableEditorShopArticleReview.class.php | TCMSTableEditorShopArticleReview.UpdateArticleReviewStats | protected function UpdateArticleReviewStats($iArticleId)
{
$oArticle = TdbShopArticle::GetNewInstance();
/** @var $oArticle TdbShopArticle */
if ($oArticle->Load($iArticleId)) {
$oArticle->UpdateStatsReviews();
}
} | php | protected function UpdateArticleReviewStats($iArticleId)
{
$oArticle = TdbShopArticle::GetNewInstance();
/** @var $oArticle TdbShopArticle */
if ($oArticle->Load($iArticleId)) {
$oArticle->UpdateStatsReviews();
}
} | [
"protected",
"function",
"UpdateArticleReviewStats",
"(",
"$",
"iArticleId",
")",
"{",
"$",
"oArticle",
"=",
"TdbShopArticle",
"::",
"GetNewInstance",
"(",
")",
";",
"/** @var $oArticle TdbShopArticle */",
"if",
"(",
"$",
"oArticle",
"->",
"Load",
"(",
"$",
"iArti... | updates the review stats for the article connected to the review item. | [
"updates",
"the",
"review",
"stats",
"for",
"the",
"article",
"connected",
"to",
"the",
"review",
"item",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/TCMSTableEditor/TCMSTableEditorShopArticleReview.class.php#L29-L36 |
32,193 | symbiote/silverstripe-cdncontent | code/dataobjects/CdnImage.php | CdnImage.createResampledAsset | protected function createResampledAsset($filename) {
$fullpath = Director::baseFolder() . '/' . $filename;
$asset = ContentServiceAsset::get()->filter('Filename', $filename)->first();
if(!$asset) {
$asset = new ContentServiceAsset();
}
$this->service = singleton('ContentS... | php | protected function createResampledAsset($filename) {
$fullpath = Director::baseFolder() . '/' . $filename;
$asset = ContentServiceAsset::get()->filter('Filename', $filename)->first();
if(!$asset) {
$asset = new ContentServiceAsset();
}
$this->service = singleton('ContentS... | [
"protected",
"function",
"createResampledAsset",
"(",
"$",
"filename",
")",
"{",
"$",
"fullpath",
"=",
"Director",
"::",
"baseFolder",
"(",
")",
".",
"'/'",
".",
"$",
"filename",
";",
"$",
"asset",
"=",
"ContentServiceAsset",
"::",
"get",
"(",
")",
"->",
... | Creates a content service asset object based on a given resampled file path
@param type $filename
@return ContentServiceAsset | [
"Creates",
"a",
"content",
"service",
"asset",
"object",
"based",
"on",
"a",
"given",
"resampled",
"file",
"path"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/dataobjects/CdnImage.php#L103-L141 |
32,194 | symbiote/silverstripe-cdncontent | code/dataobjects/CdnImage.php | CdnImage.deleteResamplings | protected function deleteResamplings() {
$children = ContentServiceAsset::get()->filter('SourceID', $this->ID);
$numDeleted = 0;
foreach ($children as $child) {
$child->SourceID = -1;
// we _DONT_ do a hard delete; if content has this image cached, it should be able to
... | php | protected function deleteResamplings() {
$children = ContentServiceAsset::get()->filter('SourceID', $this->ID);
$numDeleted = 0;
foreach ($children as $child) {
$child->SourceID = -1;
// we _DONT_ do a hard delete; if content has this image cached, it should be able to
... | [
"protected",
"function",
"deleteResamplings",
"(",
")",
"{",
"$",
"children",
"=",
"ContentServiceAsset",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"'SourceID'",
",",
"$",
"this",
"->",
"ID",
")",
";",
"$",
"numDeleted",
"=",
"0",
";",
"foreach",
"(",
... | Mark content service assets as being deleted, and reset our Resamplings value
for update later
@return int | [
"Mark",
"content",
"service",
"assets",
"as",
"being",
"deleted",
"and",
"reset",
"our",
"Resamplings",
"value",
"for",
"update",
"later"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/dataobjects/CdnImage.php#L175-L191 |
32,195 | symbiote/silverstripe-cdncontent | code/dataobjects/CdnImage.php | CdnImage.getDimensions | public function getDimensions($dim = "string") {
if(!$this->getField('Filename')) {
return null;
}
$imageDimensions = $this->getDimensionsFromDB($dim);
if ($imageDimensions !== null) {
return $imageDimensions;
}
// Download file from S3/CDN if we... | php | public function getDimensions($dim = "string") {
if(!$this->getField('Filename')) {
return null;
}
$imageDimensions = $this->getDimensionsFromDB($dim);
if ($imageDimensions !== null) {
return $imageDimensions;
}
// Download file from S3/CDN if we... | [
"public",
"function",
"getDimensions",
"(",
"$",
"dim",
"=",
"\"string\"",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getField",
"(",
"'Filename'",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"imageDimensions",
"=",
"$",
"this",
"->",
"getDimens... | Captures the image dimensions in a db field to avoid needing to download the file all the time
@param type $dim
@return int|string | [
"Captures",
"the",
"image",
"dimensions",
"in",
"a",
"db",
"field",
"to",
"avoid",
"needing",
"to",
"download",
"the",
"file",
"all",
"the",
"time"
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/dataobjects/CdnImage.php#L199-L226 |
32,196 | symbiote/silverstripe-cdncontent | code/dataobjects/CdnImage.php | CdnImage.getDimensionsFromDB | private function getDimensionsFromDB($dim = "string") {
$imageDimensions = $this->ImageDim;
if (!$imageDimensions) {
return null;
}
if ($dim === 'string') {
return $imageDimensions;
}
$widthAndHeight = explode('x', $imageDimensions);
if (!i... | php | private function getDimensionsFromDB($dim = "string") {
$imageDimensions = $this->ImageDim;
if (!$imageDimensions) {
return null;
}
if ($dim === 'string') {
return $imageDimensions;
}
$widthAndHeight = explode('x', $imageDimensions);
if (!i... | [
"private",
"function",
"getDimensionsFromDB",
"(",
"$",
"dim",
"=",
"\"string\"",
")",
"{",
"$",
"imageDimensions",
"=",
"$",
"this",
"->",
"ImageDim",
";",
"if",
"(",
"!",
"$",
"imageDimensions",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"... | Get the dimensions of this Image.
@param string $dim If this is equal to "string", return the dimensions in string form,
if it is 0 return the height, if it is 1 return the width.
@return string|int|null | [
"Get",
"the",
"dimensions",
"of",
"this",
"Image",
"."
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/dataobjects/CdnImage.php#L235-L248 |
32,197 | symbiote/silverstripe-cdncontent | code/dataobjects/CdnImage.php | CdnImage.getCMSFields | public function getCMSFields() {
$fields = parent::getCMSFields();
$previewField = new LiteralField("SecureImageFull",
"<img id='thumbnailImage' class='thumbnail-preview' src='".$this->Link()."' alt='Secured File' />\n"
);
$url = $this->Link();// 5 minute link expire
$link = ReadonlyField::create('CDNUr... | php | public function getCMSFields() {
$fields = parent::getCMSFields();
$previewField = new LiteralField("SecureImageFull",
"<img id='thumbnailImage' class='thumbnail-preview' src='".$this->Link()."' alt='Secured File' />\n"
);
$url = $this->Link();// 5 minute link expire
$link = ReadonlyField::create('CDNUr... | [
"public",
"function",
"getCMSFields",
"(",
")",
"{",
"$",
"fields",
"=",
"parent",
"::",
"getCMSFields",
"(",
")",
";",
"$",
"previewField",
"=",
"new",
"LiteralField",
"(",
"\"SecureImageFull\"",
",",
"\"<img id='thumbnailImage' class='thumbnail-preview' src='\"",
".... | Replaces the Preview Image and Link with secured links if the file is secured.
@return FieldList | [
"Replaces",
"the",
"Preview",
"Image",
"and",
"Link",
"with",
"secured",
"links",
"if",
"the",
"file",
"is",
"secured",
"."
] | a5f82e802e9addaf98d506cf305a621b873a5c9b | https://github.com/symbiote/silverstripe-cdncontent/blob/a5f82e802e9addaf98d506cf305a621b873a5c9b/code/dataobjects/CdnImage.php#L262-L282 |
32,198 | chameleon-system/chameleon-shop | src/ShopBundle/objects/TShopBasket/TShopBasketVoucherCoreList.class.php | TShopBasketVoucherCoreList.GetUniqueItemKey | protected function GetUniqueItemKey()
{
$iCurrentPointer = $this->getItemPointer();
$this->GoToStart();
$aItemKeyList = array();
while ($oItem = $this->Next()) {
$aItemKeyList[] = $oItem->sBasketVoucherKey;
}
// now generate a key
do {
... | php | protected function GetUniqueItemKey()
{
$iCurrentPointer = $this->getItemPointer();
$this->GoToStart();
$aItemKeyList = array();
while ($oItem = $this->Next()) {
$aItemKeyList[] = $oItem->sBasketVoucherKey;
}
// now generate a key
do {
... | [
"protected",
"function",
"GetUniqueItemKey",
"(",
")",
"{",
"$",
"iCurrentPointer",
"=",
"$",
"this",
"->",
"getItemPointer",
"(",
")",
";",
"$",
"this",
"->",
"GoToStart",
"(",
")",
";",
"$",
"aItemKeyList",
"=",
"array",
"(",
")",
";",
"while",
"(",
... | return a unique sBasketVoucherKey for the current list.
@return string | [
"return",
"a",
"unique",
"sBasketVoucherKey",
"for",
"the",
"current",
"list",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/TShopBasket/TShopBasketVoucherCoreList.class.php#L33-L48 |
32,199 | chameleon-system/chameleon-shop | src/ShopBundle/objects/TShopBasket/TShopBasketVoucherCoreList.class.php | TShopBasketVoucherCoreList.GetVoucherValue | public function GetVoucherValue($bSponsoredVouchers = false)
{
$dValue = 0;
$oBasket = TShopBasket::GetInstance();
$iTmpPointer = $this->getItemPointer();
$this->GoToStart();
$maxValueShippingCostAdjustment = true === $bSponsoredVouchers ? $oBasket->dCostShipping : 0;
... | php | public function GetVoucherValue($bSponsoredVouchers = false)
{
$dValue = 0;
$oBasket = TShopBasket::GetInstance();
$iTmpPointer = $this->getItemPointer();
$this->GoToStart();
$maxValueShippingCostAdjustment = true === $bSponsoredVouchers ? $oBasket->dCostShipping : 0;
... | [
"public",
"function",
"GetVoucherValue",
"(",
"$",
"bSponsoredVouchers",
"=",
"false",
")",
"{",
"$",
"dValue",
"=",
"0",
";",
"$",
"oBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"iTmpPointer",
"=",
"$",
"this",
"->",
"getItemPoint... | return the total voucher value for all active vouchers. note that the method will fetch the current basket
using the baskets singleton factory.
@param bool $bSponsoredVouchers - set to true: only sponsored vouchers, false only none sponsored vouchers
@return float | [
"return",
"the",
"total",
"voucher",
"value",
"for",
"all",
"active",
"vouchers",
".",
"note",
"that",
"the",
"method",
"will",
"fetch",
"the",
"current",
"basket",
"using",
"the",
"baskets",
"singleton",
"factory",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/TShopBasket/TShopBasketVoucherCoreList.class.php#L68-L86 |
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.