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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
31,700 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client.getBillingAgreementDetails | public function getBillingAgreementDetails($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest) {
$request = new OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest($request);
}
$httpResponse = $this->_invoke($this->_convertGetBillingAgreementDetails($request));
$response = OffAmazonPaymentsService_Model_GetBillingAgreementDetailsResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | php | public function getBillingAgreementDetails($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest) {
$request = new OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest($request);
}
$httpResponse = $this->_invoke($this->_convertGetBillingAgreementDetails($request));
$response = OffAmazonPaymentsService_Model_GetBillingAgreementDetailsResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | [
"public",
"function",
"getBillingAgreementDetails",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest",
")",
"{",
"$",
"request",
"=",
"new",
"OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest",
"(",
"$",
"request",
")",
";",
"}",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"_invoke",
"(",
"$",
"this",
"->",
"_convertGetBillingAgreementDetails",
"(",
"$",
"request",
")",
")",
";",
"$",
"response",
"=",
"OffAmazonPaymentsService_Model_GetBillingAgreementDetailsResponse",
"::",
"fromXML",
"(",
"$",
"httpResponse",
"[",
"'ResponseBody'",
"]",
")",
";",
"$",
"response",
"->",
"setResponseHeaderMetadata",
"(",
"$",
"httpResponse",
"[",
"'ResponseHeaderMetadata'",
"]",
")",
";",
"return",
"$",
"response",
";",
"}"
] | Get Billing Agreement Details
@param mixed $request array of parameters for OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest request
or OffAmazonPaymentsService_Model_GetBillingAgreementDetailsRequest object itself
@see OffAmazonPaymentsService_Model_GetBillingAgreementDetails
@return OffAmazonPaymentsService_Model_GetBillingAgreementDetailsResponse OffAmazonPaymentsService_Model_GetBillingAgreementDetailsResponse
@throws OffAmazonPaymentsService_Exception | [
"Get",
"Billing",
"Agreement",
"Details"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L612-L621 |
31,701 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client.setBillingAgreementDetails | public function setBillingAgreementDetails($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest) {
$request = new OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest($request);
}
$httpResponse = $this->_invoke($this->_convertSetBillingAgreementDetails($request));
$response = OffAmazonPaymentsService_Model_SetBillingAgreementDetailsResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | php | public function setBillingAgreementDetails($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest) {
$request = new OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest($request);
}
$httpResponse = $this->_invoke($this->_convertSetBillingAgreementDetails($request));
$response = OffAmazonPaymentsService_Model_SetBillingAgreementDetailsResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | [
"public",
"function",
"setBillingAgreementDetails",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest",
")",
"{",
"$",
"request",
"=",
"new",
"OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest",
"(",
"$",
"request",
")",
";",
"}",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"_invoke",
"(",
"$",
"this",
"->",
"_convertSetBillingAgreementDetails",
"(",
"$",
"request",
")",
")",
";",
"$",
"response",
"=",
"OffAmazonPaymentsService_Model_SetBillingAgreementDetailsResponse",
"::",
"fromXML",
"(",
"$",
"httpResponse",
"[",
"'ResponseBody'",
"]",
")",
";",
"$",
"response",
"->",
"setResponseHeaderMetadata",
"(",
"$",
"httpResponse",
"[",
"'ResponseHeaderMetadata'",
"]",
")",
";",
"return",
"$",
"response",
";",
"}"
] | Set Billing Agreement Details
@param mixed $request array of parameters for OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest request
or OffAmazonPaymentsService_Model_SetBillingAgreementDetailsRequest object itself
@see OffAmazonPaymentsService_Model_SetBillingAgreementDetails
@return OffAmazonPaymentsService_Model_SetBillingAgreementDetailsResponse OffAmazonPaymentsService_Model_SetBillingAgreementDetailsResponse
@throws OffAmazonPaymentsService_Exception | [
"Set",
"Billing",
"Agreement",
"Details"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L635-L644 |
31,702 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client.confirmBillingAgreement | public function confirmBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertConfirmBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_ConfirmBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | php | public function confirmBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertConfirmBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_ConfirmBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | [
"public",
"function",
"confirmBillingAgreement",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest",
")",
"{",
"$",
"request",
"=",
"new",
"OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest",
"(",
"$",
"request",
")",
";",
"}",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"_invoke",
"(",
"$",
"this",
"->",
"_convertConfirmBillingAgreement",
"(",
"$",
"request",
")",
")",
";",
"$",
"response",
"=",
"OffAmazonPaymentsService_Model_ConfirmBillingAgreementResponse",
"::",
"fromXML",
"(",
"$",
"httpResponse",
"[",
"'ResponseBody'",
"]",
")",
";",
"$",
"response",
"->",
"setResponseHeaderMetadata",
"(",
"$",
"httpResponse",
"[",
"'ResponseHeaderMetadata'",
"]",
")",
";",
"return",
"$",
"response",
";",
"}"
] | Confirm Billing Agreement
@param mixed $request array of parameters for OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest request
or OffAmazonPaymentsService_Model_ConfirmBillingAgreementRequest object itself
@see OffAmazonPaymentsService_Model_ConfirmBillingAgreement
@return OffAmazonPaymentsService_Model_ConfirmBillingAgreementResponse OffAmazonPaymentsService_Model_ConfirmBillingAgreementResponse
@throws OffAmazonPaymentsService_Exception | [
"Confirm",
"Billing",
"Agreement"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L658-L667 |
31,703 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client.validateBillingAgreement | public function validateBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertValidateBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_ValidateBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | php | public function validateBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertValidateBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_ValidateBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | [
"public",
"function",
"validateBillingAgreement",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest",
")",
"{",
"$",
"request",
"=",
"new",
"OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest",
"(",
"$",
"request",
")",
";",
"}",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"_invoke",
"(",
"$",
"this",
"->",
"_convertValidateBillingAgreement",
"(",
"$",
"request",
")",
")",
";",
"$",
"response",
"=",
"OffAmazonPaymentsService_Model_ValidateBillingAgreementResponse",
"::",
"fromXML",
"(",
"$",
"httpResponse",
"[",
"'ResponseBody'",
"]",
")",
";",
"$",
"response",
"->",
"setResponseHeaderMetadata",
"(",
"$",
"httpResponse",
"[",
"'ResponseHeaderMetadata'",
"]",
")",
";",
"return",
"$",
"response",
";",
"}"
] | Validate Billing Agreement
@param mixed $request array of parameters for OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest request
or OffAmazonPaymentsService_Model_ValidateBillingAgreementRequest object itself
@see OffAmazonPaymentsService_Model_ValidateBillingAgreement
@return OffAmazonPaymentsService_Model_ValidateBillingAgreementResponse OffAmazonPaymentsService_Model_ValidateBillingAgreementResponse
@throws OffAmazonPaymentsService_Exception | [
"Validate",
"Billing",
"Agreement"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L681-L690 |
31,704 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client.authorizeOnBillingAgreement | public function authorizeOnBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertAuthorizeOnBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | php | public function authorizeOnBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertAuthorizeOnBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | [
"public",
"function",
"authorizeOnBillingAgreement",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest",
")",
"{",
"$",
"request",
"=",
"new",
"OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest",
"(",
"$",
"request",
")",
";",
"}",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"_invoke",
"(",
"$",
"this",
"->",
"_convertAuthorizeOnBillingAgreement",
"(",
"$",
"request",
")",
")",
";",
"$",
"response",
"=",
"OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementResponse",
"::",
"fromXML",
"(",
"$",
"httpResponse",
"[",
"'ResponseBody'",
"]",
")",
";",
"$",
"response",
"->",
"setResponseHeaderMetadata",
"(",
"$",
"httpResponse",
"[",
"'ResponseHeaderMetadata'",
"]",
")",
";",
"return",
"$",
"response",
";",
"}"
] | Authorize On Billing Agreement
@param mixed $request array of parameters for OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest request
or OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementRequest object itself
@see OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreement
@return OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementResponse OffAmazonPaymentsService_Model_AuthorizeOnBillingAgreementResponse
@throws OffAmazonPaymentsService_Exception | [
"Authorize",
"On",
"Billing",
"Agreement"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L704-L713 |
31,705 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client.closeBillingAgreement | public function closeBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_CloseBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_CloseBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertCloseBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_CloseBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | php | public function closeBillingAgreement($request)
{
if (!$request instanceof OffAmazonPaymentsService_Model_CloseBillingAgreementRequest) {
$request = new OffAmazonPaymentsService_Model_CloseBillingAgreementRequest($request);
}
$httpResponse = $this->_invoke($this->_convertCloseBillingAgreement($request));
$response = OffAmazonPaymentsService_Model_CloseBillingAgreementResponse::fromXML($httpResponse['ResponseBody']);
$response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
return $response;
} | [
"public",
"function",
"closeBillingAgreement",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"instanceof",
"OffAmazonPaymentsService_Model_CloseBillingAgreementRequest",
")",
"{",
"$",
"request",
"=",
"new",
"OffAmazonPaymentsService_Model_CloseBillingAgreementRequest",
"(",
"$",
"request",
")",
";",
"}",
"$",
"httpResponse",
"=",
"$",
"this",
"->",
"_invoke",
"(",
"$",
"this",
"->",
"_convertCloseBillingAgreement",
"(",
"$",
"request",
")",
")",
";",
"$",
"response",
"=",
"OffAmazonPaymentsService_Model_CloseBillingAgreementResponse",
"::",
"fromXML",
"(",
"$",
"httpResponse",
"[",
"'ResponseBody'",
"]",
")",
";",
"$",
"response",
"->",
"setResponseHeaderMetadata",
"(",
"$",
"httpResponse",
"[",
"'ResponseHeaderMetadata'",
"]",
")",
";",
"return",
"$",
"response",
";",
"}"
] | Close Billing Agreement
@param mixed $request array of parameters for OffAmazonPaymentsService_Model_CloseBillingAgreementRequest request
or OffAmazonPaymentsService_Model_CloseBillingAgreementRequest object itself
@see OffAmazonPaymentsService_Model_CloseBillingAgreement
@return OffAmazonPaymentsService_Model_CloseBillingAgreementResponse OffAmazonPaymentsService_Model_CloseBillingAgreementResponse
@throws OffAmazonPaymentsService_Exception | [
"Close",
"Billing",
"Agreement"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L727-L736 |
31,706 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._getParametersAsString | private function _getParametersAsString(array $parameters)
{
$queryParameters = array();
foreach ($parameters as $key => $value) {
$queryParameters[] = $key . '=' . $this->_urlencode($value);
}
return implode('&', $queryParameters);
} | php | private function _getParametersAsString(array $parameters)
{
$queryParameters = array();
foreach ($parameters as $key => $value) {
$queryParameters[] = $key . '=' . $this->_urlencode($value);
}
return implode('&', $queryParameters);
} | [
"private",
"function",
"_getParametersAsString",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"queryParameters",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"queryParameters",
"[",
"]",
"=",
"$",
"key",
".",
"'='",
".",
"$",
"this",
"->",
"_urlencode",
"(",
"$",
"value",
")",
";",
"}",
"return",
"implode",
"(",
"'&'",
",",
"$",
"queryParameters",
")",
";",
"}"
] | Convert paremeters to Url encoded query string | [
"Convert",
"paremeters",
"to",
"Url",
"encoded",
"query",
"string"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L984-L991 |
31,707 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._calculateStringToSignV2 | private function _calculateStringToSignV2(array $parameters) {
$data = 'POST';
$data .= "\n";
$endpoint = parse_url ($this->_config['ServiceURL']);
$data .= $endpoint['host'];
$data .= "\n";
$uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
if (!isset ($uri)) {
$uri = "/";
}
$uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
$data .= $uriencoded;
$data .= "\n";
uksort($parameters, 'strcmp');
$data .= $this->_getParametersAsString($parameters);
return $data;
} | php | private function _calculateStringToSignV2(array $parameters) {
$data = 'POST';
$data .= "\n";
$endpoint = parse_url ($this->_config['ServiceURL']);
$data .= $endpoint['host'];
$data .= "\n";
$uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
if (!isset ($uri)) {
$uri = "/";
}
$uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
$data .= $uriencoded;
$data .= "\n";
uksort($parameters, 'strcmp');
$data .= $this->_getParametersAsString($parameters);
return $data;
} | [
"private",
"function",
"_calculateStringToSignV2",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"data",
"=",
"'POST'",
";",
"$",
"data",
".=",
"\"\\n\"",
";",
"$",
"endpoint",
"=",
"parse_url",
"(",
"$",
"this",
"->",
"_config",
"[",
"'ServiceURL'",
"]",
")",
";",
"$",
"data",
".=",
"$",
"endpoint",
"[",
"'host'",
"]",
";",
"$",
"data",
".=",
"\"\\n\"",
";",
"$",
"uri",
"=",
"array_key_exists",
"(",
"'path'",
",",
"$",
"endpoint",
")",
"?",
"$",
"endpoint",
"[",
"'path'",
"]",
":",
"null",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"uri",
")",
")",
"{",
"$",
"uri",
"=",
"\"/\"",
";",
"}",
"$",
"uriencoded",
"=",
"implode",
"(",
"\"/\"",
",",
"array_map",
"(",
"array",
"(",
"$",
"this",
",",
"\"_urlencode\"",
")",
",",
"explode",
"(",
"\"/\"",
",",
"$",
"uri",
")",
")",
")",
";",
"$",
"data",
".=",
"$",
"uriencoded",
";",
"$",
"data",
".=",
"\"\\n\"",
";",
"uksort",
"(",
"$",
"parameters",
",",
"'strcmp'",
")",
";",
"$",
"data",
".=",
"$",
"this",
"->",
"_getParametersAsString",
"(",
"$",
"parameters",
")",
";",
"return",
"$",
"data",
";",
"}"
] | Calculate String to Sign for SignatureVersion 2
@param array $parameters request parameters
@return String to Sign | [
"Calculate",
"String",
"to",
"Sign",
"for",
"SignatureVersion",
"2"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1043-L1059 |
31,708 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._sign | private function _sign($data, $key, $algorithm)
{
if ($algorithm === 'HmacSHA1') {
$hash = 'sha1';
} else if ($algorithm === 'HmacSHA256') {
$hash = 'sha256';
} else {
throw new Exception ("Non-supported signing method specified");
}
return base64_encode(
hash_hmac($hash, $data, $key, true)
);
} | php | private function _sign($data, $key, $algorithm)
{
if ($algorithm === 'HmacSHA1') {
$hash = 'sha1';
} else if ($algorithm === 'HmacSHA256') {
$hash = 'sha256';
} else {
throw new Exception ("Non-supported signing method specified");
}
return base64_encode(
hash_hmac($hash, $data, $key, true)
);
} | [
"private",
"function",
"_sign",
"(",
"$",
"data",
",",
"$",
"key",
",",
"$",
"algorithm",
")",
"{",
"if",
"(",
"$",
"algorithm",
"===",
"'HmacSHA1'",
")",
"{",
"$",
"hash",
"=",
"'sha1'",
";",
"}",
"else",
"if",
"(",
"$",
"algorithm",
"===",
"'HmacSHA256'",
")",
"{",
"$",
"hash",
"=",
"'sha256'",
";",
"}",
"else",
"{",
"throw",
"new",
"Exception",
"(",
"\"Non-supported signing method specified\"",
")",
";",
"}",
"return",
"base64_encode",
"(",
"hash_hmac",
"(",
"$",
"hash",
",",
"$",
"data",
",",
"$",
"key",
",",
"true",
")",
")",
";",
"}"
] | Computes RFC 2104-compliant HMAC signature. | [
"Computes",
"RFC",
"2104",
"-",
"compliant",
"HMAC",
"signature",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1069-L1081 |
31,709 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertCapture | private function _convertCapture($request) {
$parameters = array();
$parameters['Action'] = 'Capture';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonAuthorizationId()) {
$parameters['AmazonAuthorizationId'] = $request->getAmazonAuthorizationId();
}
if ($request->isSetCaptureReferenceId()) {
$parameters['CaptureReferenceId'] = $request->getCaptureReferenceId();
}
if ($request->isSetCaptureAmount()) {
$captureAmountcaptureRequest = $request->getCaptureAmount();
if ($captureAmountcaptureRequest->isSetAmount()) {
$parameters['CaptureAmount' . '.' . 'Amount'] = $captureAmountcaptureRequest->getAmount();
}
if ($captureAmountcaptureRequest->isSetCurrencyCode()) {
$parameters['CaptureAmount' . '.' . 'CurrencyCode'] = $captureAmountcaptureRequest->getCurrencyCode();
}
}
if ($request->isSetSellerCaptureNote()) {
$parameters['SellerCaptureNote'] = $request->getSellerCaptureNote();
}
if ($request->isSetSoftDescriptor()) {
$parameters['SoftDescriptor'] = $request->getSoftDescriptor();
}
return $parameters;
} | php | private function _convertCapture($request) {
$parameters = array();
$parameters['Action'] = 'Capture';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonAuthorizationId()) {
$parameters['AmazonAuthorizationId'] = $request->getAmazonAuthorizationId();
}
if ($request->isSetCaptureReferenceId()) {
$parameters['CaptureReferenceId'] = $request->getCaptureReferenceId();
}
if ($request->isSetCaptureAmount()) {
$captureAmountcaptureRequest = $request->getCaptureAmount();
if ($captureAmountcaptureRequest->isSetAmount()) {
$parameters['CaptureAmount' . '.' . 'Amount'] = $captureAmountcaptureRequest->getAmount();
}
if ($captureAmountcaptureRequest->isSetCurrencyCode()) {
$parameters['CaptureAmount' . '.' . 'CurrencyCode'] = $captureAmountcaptureRequest->getCurrencyCode();
}
}
if ($request->isSetSellerCaptureNote()) {
$parameters['SellerCaptureNote'] = $request->getSellerCaptureNote();
}
if ($request->isSetSoftDescriptor()) {
$parameters['SoftDescriptor'] = $request->getSoftDescriptor();
}
return $parameters;
} | [
"private",
"function",
"_convertCapture",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'Capture'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonAuthorizationId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonAuthorizationId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonAuthorizationId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetCaptureReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'CaptureReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getCaptureReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetCaptureAmount",
"(",
")",
")",
"{",
"$",
"captureAmountcaptureRequest",
"=",
"$",
"request",
"->",
"getCaptureAmount",
"(",
")",
";",
"if",
"(",
"$",
"captureAmountcaptureRequest",
"->",
"isSetAmount",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'CaptureAmount'",
".",
"'.'",
".",
"'Amount'",
"]",
"=",
"$",
"captureAmountcaptureRequest",
"->",
"getAmount",
"(",
")",
";",
"}",
"if",
"(",
"$",
"captureAmountcaptureRequest",
"->",
"isSetCurrencyCode",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'CaptureAmount'",
".",
"'.'",
".",
"'CurrencyCode'",
"]",
"=",
"$",
"captureAmountcaptureRequest",
"->",
"getCurrencyCode",
"(",
")",
";",
"}",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerCaptureNote",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerCaptureNote'",
"]",
"=",
"$",
"request",
"->",
"getSellerCaptureNote",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSoftDescriptor",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SoftDescriptor'",
"]",
"=",
"$",
"request",
"->",
"getSoftDescriptor",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert CaptureRequest to name value pairs | [
"Convert",
"CaptureRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1106-L1136 |
31,710 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertRefund | private function _convertRefund($request) {
$parameters = array();
$parameters['Action'] = 'Refund';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonCaptureId()) {
$parameters['AmazonCaptureId'] = $request->getAmazonCaptureId();
}
if ($request->isSetRefundReferenceId()) {
$parameters['RefundReferenceId'] = $request->getRefundReferenceId();
}
if ($request->isSetRefundAmount()) {
$refundAmount = $request->getRefundAmount();
if ($refundAmount->isSetAmount()) {
$parameters['RefundAmount' . '.' . 'Amount'] = $refundAmount->getAmount();
}
if ($refundAmount->isSetCurrencyCode()) {
$parameters['RefundAmount' . '.' . 'CurrencyCode'] = $refundAmount->getCurrencyCode();
}
}
if ($request->isSetSellerRefundNote()) {
$parameters['SellerRefundNote'] = $request->getSellerRefundNote();
}
if ($request->isSetSoftDescriptor()) {
$parameters['SoftDescriptor'] = $request->getSoftDescriptor();
}
return $parameters;
} | php | private function _convertRefund($request) {
$parameters = array();
$parameters['Action'] = 'Refund';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonCaptureId()) {
$parameters['AmazonCaptureId'] = $request->getAmazonCaptureId();
}
if ($request->isSetRefundReferenceId()) {
$parameters['RefundReferenceId'] = $request->getRefundReferenceId();
}
if ($request->isSetRefundAmount()) {
$refundAmount = $request->getRefundAmount();
if ($refundAmount->isSetAmount()) {
$parameters['RefundAmount' . '.' . 'Amount'] = $refundAmount->getAmount();
}
if ($refundAmount->isSetCurrencyCode()) {
$parameters['RefundAmount' . '.' . 'CurrencyCode'] = $refundAmount->getCurrencyCode();
}
}
if ($request->isSetSellerRefundNote()) {
$parameters['SellerRefundNote'] = $request->getSellerRefundNote();
}
if ($request->isSetSoftDescriptor()) {
$parameters['SoftDescriptor'] = $request->getSoftDescriptor();
}
return $parameters;
} | [
"private",
"function",
"_convertRefund",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'Refund'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonCaptureId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonCaptureId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonCaptureId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetRefundReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'RefundReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getRefundReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetRefundAmount",
"(",
")",
")",
"{",
"$",
"refundAmount",
"=",
"$",
"request",
"->",
"getRefundAmount",
"(",
")",
";",
"if",
"(",
"$",
"refundAmount",
"->",
"isSetAmount",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'RefundAmount'",
".",
"'.'",
".",
"'Amount'",
"]",
"=",
"$",
"refundAmount",
"->",
"getAmount",
"(",
")",
";",
"}",
"if",
"(",
"$",
"refundAmount",
"->",
"isSetCurrencyCode",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'RefundAmount'",
".",
"'.'",
".",
"'CurrencyCode'",
"]",
"=",
"$",
"refundAmount",
"->",
"getCurrencyCode",
"(",
")",
";",
"}",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerRefundNote",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerRefundNote'",
"]",
"=",
"$",
"request",
"->",
"getSellerRefundNote",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSoftDescriptor",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SoftDescriptor'",
"]",
"=",
"$",
"request",
"->",
"getSoftDescriptor",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert RefundRequest to name value pairs | [
"Convert",
"RefundRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1142-L1172 |
31,711 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertCloseAuthorization | private function _convertCloseAuthorization($request) {
$parameters = array();
$parameters['Action'] = 'CloseAuthorization';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonAuthorizationId()) {
$parameters['AmazonAuthorizationId'] = $request->getAmazonAuthorizationId();
}
if ($request->isSetClosureReason()) {
$parameters['ClosureReason'] = $request->getClosureReason();
}
return $parameters;
} | php | private function _convertCloseAuthorization($request) {
$parameters = array();
$parameters['Action'] = 'CloseAuthorization';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonAuthorizationId()) {
$parameters['AmazonAuthorizationId'] = $request->getAmazonAuthorizationId();
}
if ($request->isSetClosureReason()) {
$parameters['ClosureReason'] = $request->getClosureReason();
}
return $parameters;
} | [
"private",
"function",
"_convertCloseAuthorization",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'CloseAuthorization'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonAuthorizationId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonAuthorizationId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonAuthorizationId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetClosureReason",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'ClosureReason'",
"]",
"=",
"$",
"request",
"->",
"getClosureReason",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert CloseAuthorizationRequest to name value pairs | [
"Convert",
"CloseAuthorizationRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1178-L1193 |
31,712 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertGetRefundDetails | private function _convertGetRefundDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetRefundDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonRefundId()) {
$parameters['AmazonRefundId'] = $request->getAmazonRefundId();
}
return $parameters;
} | php | private function _convertGetRefundDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetRefundDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonRefundId()) {
$parameters['AmazonRefundId'] = $request->getAmazonRefundId();
}
return $parameters;
} | [
"private",
"function",
"_convertGetRefundDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'GetRefundDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonRefundId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonRefundId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonRefundId",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert GetRefundDetailsRequest to name value pairs | [
"Convert",
"GetRefundDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1199-L1211 |
31,713 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertGetCaptureDetails | private function _convertGetCaptureDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetCaptureDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonCaptureId()) {
$parameters['AmazonCaptureId'] = $request->getAmazonCaptureId();
}
return $parameters;
} | php | private function _convertGetCaptureDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetCaptureDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonCaptureId()) {
$parameters['AmazonCaptureId'] = $request->getAmazonCaptureId();
}
return $parameters;
} | [
"private",
"function",
"_convertGetCaptureDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'GetCaptureDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonCaptureId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonCaptureId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonCaptureId",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert GetCaptureDetailsRequest to name value pairs | [
"Convert",
"GetCaptureDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1217-L1229 |
31,714 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertCloseOrderReference | private function _convertCloseOrderReference($request) {
$parameters = array();
$parameters['Action'] = 'CloseOrderReference';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetClosureReason()) {
$parameters['ClosureReason'] = $request->getClosureReason();
}
return $parameters;
} | php | private function _convertCloseOrderReference($request) {
$parameters = array();
$parameters['Action'] = 'CloseOrderReference';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetClosureReason()) {
$parameters['ClosureReason'] = $request->getClosureReason();
}
return $parameters;
} | [
"private",
"function",
"_convertCloseOrderReference",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'CloseOrderReference'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonOrderReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonOrderReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonOrderReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetClosureReason",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'ClosureReason'",
"]",
"=",
"$",
"request",
"->",
"getClosureReason",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert CloseOrderReferenceRequest to name value pairs | [
"Convert",
"CloseOrderReferenceRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1235-L1250 |
31,715 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertConfirmOrderReference | private function _convertConfirmOrderReference($request) {
$parameters = array();
$parameters['Action'] = 'ConfirmOrderReference';
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
return $parameters;
} | php | private function _convertConfirmOrderReference($request) {
$parameters = array();
$parameters['Action'] = 'ConfirmOrderReference';
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
return $parameters;
} | [
"private",
"function",
"_convertConfirmOrderReference",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'ConfirmOrderReference'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonOrderReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonOrderReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonOrderReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert ConfirmOrderReferenceRequest to name value pairs | [
"Convert",
"ConfirmOrderReferenceRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1256-L1268 |
31,716 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertGetOrderReferenceDetails | private function _convertGetOrderReferenceDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetOrderReferenceDetails';
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAddressConsentToken()) {
$parameters['AddressConsentToken'] = $request->getAddressConsentToken();
}
return $parameters;
} | php | private function _convertGetOrderReferenceDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetOrderReferenceDetails';
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAddressConsentToken()) {
$parameters['AddressConsentToken'] = $request->getAddressConsentToken();
}
return $parameters;
} | [
"private",
"function",
"_convertGetOrderReferenceDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'GetOrderReferenceDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonOrderReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonOrderReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonOrderReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAddressConsentToken",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AddressConsentToken'",
"]",
"=",
"$",
"request",
"->",
"getAddressConsentToken",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert GetOrderReferenceDetailsRequest to name value pairs | [
"Convert",
"GetOrderReferenceDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1274-L1289 |
31,717 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertAuthorize | private function _convertAuthorize($request) {
$parameters = array();
$parameters['Action'] = 'Authorize';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetAuthorizationReferenceId()) {
$parameters['AuthorizationReferenceId'] = $request->getAuthorizationReferenceId();
}
if ($request->isSetAuthorizationAmount()) {
$authorizationAmount = $request->getAuthorizationAmount();
if ($authorizationAmount->isSetAmount()) {
$parameters['AuthorizationAmount' . '.' . 'Amount'] = $authorizationAmount->getAmount();
}
if ($authorizationAmount->isSetCurrencyCode()) {
$parameters['AuthorizationAmount' . '.' . 'CurrencyCode'] = $authorizationAmount->getCurrencyCode();
}
}
if ($request->isSetSellerAuthorizationNote()) {
$parameters['SellerAuthorizationNote'] = $request->getSellerAuthorizationNote();
}
if ($request->isSetOrderItemCategories()) {
$orderItemCategories = $request->getOrderItemCategories();
foreach ($orderItemCategories->getOrderItemCategory() as $orderItemCategoryIndex => $orderItemCategory) {
$parameters['OrderItemCategories' . '.' . 'OrderItemCategory' . '.' . ($orderItemCategoryIndex + 1)] = $orderItemCategory;
}
}
if ($request->isSetTransactionTimeout()) {
$parameters['TransactionTimeout'] = $request->getTransactionTimeout();
}
if ($request->isSetCaptureNow()) {
$parameters['CaptureNow'] = $request->getCaptureNow() ? "true" : "false";
}
if ($request->isSetSoftDescriptor()) {
$parameters['SoftDescriptor'] = $request->getSoftDescriptor();
}
return $parameters;
} | php | private function _convertAuthorize($request) {
$parameters = array();
$parameters['Action'] = 'Authorize';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetAuthorizationReferenceId()) {
$parameters['AuthorizationReferenceId'] = $request->getAuthorizationReferenceId();
}
if ($request->isSetAuthorizationAmount()) {
$authorizationAmount = $request->getAuthorizationAmount();
if ($authorizationAmount->isSetAmount()) {
$parameters['AuthorizationAmount' . '.' . 'Amount'] = $authorizationAmount->getAmount();
}
if ($authorizationAmount->isSetCurrencyCode()) {
$parameters['AuthorizationAmount' . '.' . 'CurrencyCode'] = $authorizationAmount->getCurrencyCode();
}
}
if ($request->isSetSellerAuthorizationNote()) {
$parameters['SellerAuthorizationNote'] = $request->getSellerAuthorizationNote();
}
if ($request->isSetOrderItemCategories()) {
$orderItemCategories = $request->getOrderItemCategories();
foreach ($orderItemCategories->getOrderItemCategory() as $orderItemCategoryIndex => $orderItemCategory) {
$parameters['OrderItemCategories' . '.' . 'OrderItemCategory' . '.' . ($orderItemCategoryIndex + 1)] = $orderItemCategory;
}
}
if ($request->isSetTransactionTimeout()) {
$parameters['TransactionTimeout'] = $request->getTransactionTimeout();
}
if ($request->isSetCaptureNow()) {
$parameters['CaptureNow'] = $request->getCaptureNow() ? "true" : "false";
}
if ($request->isSetSoftDescriptor()) {
$parameters['SoftDescriptor'] = $request->getSoftDescriptor();
}
return $parameters;
} | [
"private",
"function",
"_convertAuthorize",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'Authorize'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonOrderReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonOrderReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonOrderReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAuthorizationReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AuthorizationReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAuthorizationReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAuthorizationAmount",
"(",
")",
")",
"{",
"$",
"authorizationAmount",
"=",
"$",
"request",
"->",
"getAuthorizationAmount",
"(",
")",
";",
"if",
"(",
"$",
"authorizationAmount",
"->",
"isSetAmount",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AuthorizationAmount'",
".",
"'.'",
".",
"'Amount'",
"]",
"=",
"$",
"authorizationAmount",
"->",
"getAmount",
"(",
")",
";",
"}",
"if",
"(",
"$",
"authorizationAmount",
"->",
"isSetCurrencyCode",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AuthorizationAmount'",
".",
"'.'",
".",
"'CurrencyCode'",
"]",
"=",
"$",
"authorizationAmount",
"->",
"getCurrencyCode",
"(",
")",
";",
"}",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerAuthorizationNote",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerAuthorizationNote'",
"]",
"=",
"$",
"request",
"->",
"getSellerAuthorizationNote",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetOrderItemCategories",
"(",
")",
")",
"{",
"$",
"orderItemCategories",
"=",
"$",
"request",
"->",
"getOrderItemCategories",
"(",
")",
";",
"foreach",
"(",
"$",
"orderItemCategories",
"->",
"getOrderItemCategory",
"(",
")",
"as",
"$",
"orderItemCategoryIndex",
"=>",
"$",
"orderItemCategory",
")",
"{",
"$",
"parameters",
"[",
"'OrderItemCategories'",
".",
"'.'",
".",
"'OrderItemCategory'",
".",
"'.'",
".",
"(",
"$",
"orderItemCategoryIndex",
"+",
"1",
")",
"]",
"=",
"$",
"orderItemCategory",
";",
"}",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetTransactionTimeout",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'TransactionTimeout'",
"]",
"=",
"$",
"request",
"->",
"getTransactionTimeout",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetCaptureNow",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'CaptureNow'",
"]",
"=",
"$",
"request",
"->",
"getCaptureNow",
"(",
")",
"?",
"\"true\"",
":",
"\"false\"",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSoftDescriptor",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SoftDescriptor'",
"]",
"=",
"$",
"request",
"->",
"getSoftDescriptor",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert AuthorizeRequest to name value pairs | [
"Convert",
"AuthorizeRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1295-L1337 |
31,718 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertSetOrderReferenceDetails | private function _convertSetOrderReferenceDetails($request) {
$parameters = array();
$parameters['Action'] = 'SetOrderReferenceDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetOrderReferenceAttributes()) {
$orderReferenceAttributes = $request->getOrderReferenceAttributes();
if ($orderReferenceAttributes->isSetOrderTotal()) {
$orderTotal = $orderReferenceAttributes->getOrderTotal();
if ($orderTotal->isSetCurrencyCode()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'CurrencyCode'] = $orderTotal->getCurrencyCode();
}
if ($orderTotal->isSetAmount()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'Amount'] = $orderTotal->getAmount();
}
}
if ($orderReferenceAttributes->isSetPlatformId()) {
$parameters['OrderReferenceAttributes' . '.' . 'PlatformId'] = $orderReferenceAttributes->getPlatformId();
}
if ($orderReferenceAttributes->isSetSellerNote()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerNote'] = $orderReferenceAttributes->getSellerNote();
}
if ($orderReferenceAttributes->isSetSellerOrderAttributes()) {
$sellerOrderAttributes = $orderReferenceAttributes->getSellerOrderAttributes();
if ($sellerOrderAttributes->isSetSellerOrderId()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'SellerOrderId'] = $sellerOrderAttributes->getSellerOrderId();
}
if ($sellerOrderAttributes->isSetStoreName()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'StoreName'] = $sellerOrderAttributes->getStoreName();
}
if ($sellerOrderAttributes->isSetOrderItemCategories()) {
$orderItemCategories = $sellerOrderAttributes->getOrderItemCategories();
foreach ($orderItemCategories->getOrderItemCategory() as $orderItemCategoryIndex => $orderItemCategory) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'OrderItemCategories' . '.' . 'OrderItemCategory' . '.' . ($orderItemCategoryIndex + 1)] = $orderItemCategory;
}
}
if ($sellerOrderAttributes->isSetCustomInformation()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'CustomInformation'] = $sellerOrderAttributes->getCustomInformation();
}
}
}
return $parameters;
} | php | private function _convertSetOrderReferenceDetails($request) {
$parameters = array();
$parameters['Action'] = 'SetOrderReferenceDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetOrderReferenceAttributes()) {
$orderReferenceAttributes = $request->getOrderReferenceAttributes();
if ($orderReferenceAttributes->isSetOrderTotal()) {
$orderTotal = $orderReferenceAttributes->getOrderTotal();
if ($orderTotal->isSetCurrencyCode()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'CurrencyCode'] = $orderTotal->getCurrencyCode();
}
if ($orderTotal->isSetAmount()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'Amount'] = $orderTotal->getAmount();
}
}
if ($orderReferenceAttributes->isSetPlatformId()) {
$parameters['OrderReferenceAttributes' . '.' . 'PlatformId'] = $orderReferenceAttributes->getPlatformId();
}
if ($orderReferenceAttributes->isSetSellerNote()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerNote'] = $orderReferenceAttributes->getSellerNote();
}
if ($orderReferenceAttributes->isSetSellerOrderAttributes()) {
$sellerOrderAttributes = $orderReferenceAttributes->getSellerOrderAttributes();
if ($sellerOrderAttributes->isSetSellerOrderId()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'SellerOrderId'] = $sellerOrderAttributes->getSellerOrderId();
}
if ($sellerOrderAttributes->isSetStoreName()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'StoreName'] = $sellerOrderAttributes->getStoreName();
}
if ($sellerOrderAttributes->isSetOrderItemCategories()) {
$orderItemCategories = $sellerOrderAttributes->getOrderItemCategories();
foreach ($orderItemCategories->getOrderItemCategory() as $orderItemCategoryIndex => $orderItemCategory) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'OrderItemCategories' . '.' . 'OrderItemCategory' . '.' . ($orderItemCategoryIndex + 1)] = $orderItemCategory;
}
}
if ($sellerOrderAttributes->isSetCustomInformation()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'CustomInformation'] = $sellerOrderAttributes->getCustomInformation();
}
}
}
return $parameters;
} | [
"private",
"function",
"_convertSetOrderReferenceDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'SetOrderReferenceDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonOrderReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonOrderReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonOrderReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetOrderReferenceAttributes",
"(",
")",
")",
"{",
"$",
"orderReferenceAttributes",
"=",
"$",
"request",
"->",
"getOrderReferenceAttributes",
"(",
")",
";",
"if",
"(",
"$",
"orderReferenceAttributes",
"->",
"isSetOrderTotal",
"(",
")",
")",
"{",
"$",
"orderTotal",
"=",
"$",
"orderReferenceAttributes",
"->",
"getOrderTotal",
"(",
")",
";",
"if",
"(",
"$",
"orderTotal",
"->",
"isSetCurrencyCode",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'OrderTotal'",
".",
"'.'",
".",
"'CurrencyCode'",
"]",
"=",
"$",
"orderTotal",
"->",
"getCurrencyCode",
"(",
")",
";",
"}",
"if",
"(",
"$",
"orderTotal",
"->",
"isSetAmount",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'OrderTotal'",
".",
"'.'",
".",
"'Amount'",
"]",
"=",
"$",
"orderTotal",
"->",
"getAmount",
"(",
")",
";",
"}",
"}",
"if",
"(",
"$",
"orderReferenceAttributes",
"->",
"isSetPlatformId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'PlatformId'",
"]",
"=",
"$",
"orderReferenceAttributes",
"->",
"getPlatformId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"orderReferenceAttributes",
"->",
"isSetSellerNote",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerNote'",
"]",
"=",
"$",
"orderReferenceAttributes",
"->",
"getSellerNote",
"(",
")",
";",
"}",
"if",
"(",
"$",
"orderReferenceAttributes",
"->",
"isSetSellerOrderAttributes",
"(",
")",
")",
"{",
"$",
"sellerOrderAttributes",
"=",
"$",
"orderReferenceAttributes",
"->",
"getSellerOrderAttributes",
"(",
")",
";",
"if",
"(",
"$",
"sellerOrderAttributes",
"->",
"isSetSellerOrderId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'SellerOrderId'",
"]",
"=",
"$",
"sellerOrderAttributes",
"->",
"getSellerOrderId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"sellerOrderAttributes",
"->",
"isSetStoreName",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'StoreName'",
"]",
"=",
"$",
"sellerOrderAttributes",
"->",
"getStoreName",
"(",
")",
";",
"}",
"if",
"(",
"$",
"sellerOrderAttributes",
"->",
"isSetOrderItemCategories",
"(",
")",
")",
"{",
"$",
"orderItemCategories",
"=",
"$",
"sellerOrderAttributes",
"->",
"getOrderItemCategories",
"(",
")",
";",
"foreach",
"(",
"$",
"orderItemCategories",
"->",
"getOrderItemCategory",
"(",
")",
"as",
"$",
"orderItemCategoryIndex",
"=>",
"$",
"orderItemCategory",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'OrderItemCategories'",
".",
"'.'",
".",
"'OrderItemCategory'",
".",
"'.'",
".",
"(",
"$",
"orderItemCategoryIndex",
"+",
"1",
")",
"]",
"=",
"$",
"orderItemCategory",
";",
"}",
"}",
"if",
"(",
"$",
"sellerOrderAttributes",
"->",
"isSetCustomInformation",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'CustomInformation'",
"]",
"=",
"$",
"sellerOrderAttributes",
"->",
"getCustomInformation",
"(",
")",
";",
"}",
"}",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert SetOrderReferenceDetailsRequest to name value pairs | [
"Convert",
"SetOrderReferenceDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1343-L1391 |
31,719 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertGetAuthorizationDetails | private function _convertGetAuthorizationDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetAuthorizationDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonAuthorizationId()) {
$parameters['AmazonAuthorizationId'] = $request->getAmazonAuthorizationId();
}
return $parameters;
} | php | private function _convertGetAuthorizationDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetAuthorizationDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonAuthorizationId()) {
$parameters['AmazonAuthorizationId'] = $request->getAmazonAuthorizationId();
}
return $parameters;
} | [
"private",
"function",
"_convertGetAuthorizationDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'GetAuthorizationDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonAuthorizationId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonAuthorizationId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonAuthorizationId",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert GetAuthorizationDetailsRequest to name value pairs | [
"Convert",
"GetAuthorizationDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1397-L1409 |
31,720 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertCancelOrderReference | private function _convertCancelOrderReference($request) {
$parameters = array();
$parameters['Action'] = 'CancelOrderReference';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetCancelationReason()) {
$parameters['CancelationReason'] = $request->getCancelationReason();
}
return $parameters;
} | php | private function _convertCancelOrderReference($request) {
$parameters = array();
$parameters['Action'] = 'CancelOrderReference';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonOrderReferenceId()) {
$parameters['AmazonOrderReferenceId'] = $request->getAmazonOrderReferenceId();
}
if ($request->isSetCancelationReason()) {
$parameters['CancelationReason'] = $request->getCancelationReason();
}
return $parameters;
} | [
"private",
"function",
"_convertCancelOrderReference",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'CancelOrderReference'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonOrderReferenceId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonOrderReferenceId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonOrderReferenceId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetCancelationReason",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'CancelationReason'",
"]",
"=",
"$",
"request",
"->",
"getCancelationReason",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert CancelOrderReferenceRequest to name value pairs | [
"Convert",
"CancelOrderReferenceRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1415-L1430 |
31,721 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertCreateOrderReferenceForId | private function _convertCreateOrderReferenceForId($request) {
$parameters = array();
$parameters['Action'] = 'CreateOrderReferenceForId';
if ($request->isSetId()) {
$parameters['Id'] = $request->getId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetIdType()) {
$parameters['IdType'] = $request->getIdType();
}
if ($request->isSetInheritShippingAddress()) {
$parameters['InheritShippingAddress'] = $request->getInheritShippingAddress() ? "true" : "false";
}
if ($request->isSetConfirmNow()) {
$parameters['ConfirmNow'] = $request->getConfirmNow() ? "true" : "false";
}
if ($request->isSetOrderReferenceAttributes()) {
$orderReferenceAttributescreateOrderReferenceForIdRequest = $request->getOrderReferenceAttributes();
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetOrderTotal()) {
$orderTotalorderReferenceAttributes = $orderReferenceAttributescreateOrderReferenceForIdRequest->getOrderTotal();
if ($orderTotalorderReferenceAttributes->isSetCurrencyCode()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'CurrencyCode'] = $orderTotalorderReferenceAttributes->getCurrencyCode();
}
if ($orderTotalorderReferenceAttributes->isSetAmount()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'Amount'] = $orderTotalorderReferenceAttributes->getAmount();
}
}
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetPlatformId()) {
$parameters['OrderReferenceAttributes' . '.' . 'PlatformId'] = $orderReferenceAttributescreateOrderReferenceForIdRequest->getPlatformId();
}
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetSellerNote()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerNote'] = $orderReferenceAttributescreateOrderReferenceForIdRequest->getSellerNote();
}
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetSellerOrderAttributes()) {
$sellerOrderAttributesorderReferenceAttributes = $orderReferenceAttributescreateOrderReferenceForIdRequest->getSellerOrderAttributes();
if ($sellerOrderAttributesorderReferenceAttributes->isSetSellerOrderId()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'SellerOrderId'] = $sellerOrderAttributesorderReferenceAttributes->getSellerOrderId();
}
if ($sellerOrderAttributesorderReferenceAttributes->isSetStoreName()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'StoreName'] = $sellerOrderAttributesorderReferenceAttributes->getStoreName();
}
if ($sellerOrderAttributesorderReferenceAttributes->isSetOrderItemCategories()) {
$orderItemCategoriessellerOrderAttributes = $sellerOrderAttributesorderReferenceAttributes->getOrderItemCategories();
foreach ($orderItemCategoriessellerOrderAttributes->getOrderItemCategory() as $orderItemCategoryorderItemCategoriesIndex => $orderItemCategoryorderItemCategories) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'OrderItemCategories' . '.' . 'OrderItemCategory' . '.' . ($orderItemCategoryorderItemCategoriesIndex + 1)] = $orderItemCategoryorderItemCategories;
}
}
if ($sellerOrderAttributesorderReferenceAttributes->isSetCustomInformation()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'CustomInformation'] = $sellerOrderAttributesorderReferenceAttributes->getCustomInformation();
}
}
}
return $parameters;
} | php | private function _convertCreateOrderReferenceForId($request) {
$parameters = array();
$parameters['Action'] = 'CreateOrderReferenceForId';
if ($request->isSetId()) {
$parameters['Id'] = $request->getId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetIdType()) {
$parameters['IdType'] = $request->getIdType();
}
if ($request->isSetInheritShippingAddress()) {
$parameters['InheritShippingAddress'] = $request->getInheritShippingAddress() ? "true" : "false";
}
if ($request->isSetConfirmNow()) {
$parameters['ConfirmNow'] = $request->getConfirmNow() ? "true" : "false";
}
if ($request->isSetOrderReferenceAttributes()) {
$orderReferenceAttributescreateOrderReferenceForIdRequest = $request->getOrderReferenceAttributes();
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetOrderTotal()) {
$orderTotalorderReferenceAttributes = $orderReferenceAttributescreateOrderReferenceForIdRequest->getOrderTotal();
if ($orderTotalorderReferenceAttributes->isSetCurrencyCode()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'CurrencyCode'] = $orderTotalorderReferenceAttributes->getCurrencyCode();
}
if ($orderTotalorderReferenceAttributes->isSetAmount()) {
$parameters['OrderReferenceAttributes' . '.' . 'OrderTotal' . '.' . 'Amount'] = $orderTotalorderReferenceAttributes->getAmount();
}
}
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetPlatformId()) {
$parameters['OrderReferenceAttributes' . '.' . 'PlatformId'] = $orderReferenceAttributescreateOrderReferenceForIdRequest->getPlatformId();
}
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetSellerNote()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerNote'] = $orderReferenceAttributescreateOrderReferenceForIdRequest->getSellerNote();
}
if ($orderReferenceAttributescreateOrderReferenceForIdRequest->isSetSellerOrderAttributes()) {
$sellerOrderAttributesorderReferenceAttributes = $orderReferenceAttributescreateOrderReferenceForIdRequest->getSellerOrderAttributes();
if ($sellerOrderAttributesorderReferenceAttributes->isSetSellerOrderId()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'SellerOrderId'] = $sellerOrderAttributesorderReferenceAttributes->getSellerOrderId();
}
if ($sellerOrderAttributesorderReferenceAttributes->isSetStoreName()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'StoreName'] = $sellerOrderAttributesorderReferenceAttributes->getStoreName();
}
if ($sellerOrderAttributesorderReferenceAttributes->isSetOrderItemCategories()) {
$orderItemCategoriessellerOrderAttributes = $sellerOrderAttributesorderReferenceAttributes->getOrderItemCategories();
foreach ($orderItemCategoriessellerOrderAttributes->getOrderItemCategory() as $orderItemCategoryorderItemCategoriesIndex => $orderItemCategoryorderItemCategories) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'OrderItemCategories' . '.' . 'OrderItemCategory' . '.' . ($orderItemCategoryorderItemCategoriesIndex + 1)] = $orderItemCategoryorderItemCategories;
}
}
if ($sellerOrderAttributesorderReferenceAttributes->isSetCustomInformation()) {
$parameters['OrderReferenceAttributes' . '.' . 'SellerOrderAttributes' . '.' . 'CustomInformation'] = $sellerOrderAttributesorderReferenceAttributes->getCustomInformation();
}
}
}
return $parameters;
} | [
"private",
"function",
"_convertCreateOrderReferenceForId",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'CreateOrderReferenceForId'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'Id'",
"]",
"=",
"$",
"request",
"->",
"getId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetIdType",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'IdType'",
"]",
"=",
"$",
"request",
"->",
"getIdType",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetInheritShippingAddress",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'InheritShippingAddress'",
"]",
"=",
"$",
"request",
"->",
"getInheritShippingAddress",
"(",
")",
"?",
"\"true\"",
":",
"\"false\"",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetConfirmNow",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'ConfirmNow'",
"]",
"=",
"$",
"request",
"->",
"getConfirmNow",
"(",
")",
"?",
"\"true\"",
":",
"\"false\"",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetOrderReferenceAttributes",
"(",
")",
")",
"{",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"=",
"$",
"request",
"->",
"getOrderReferenceAttributes",
"(",
")",
";",
"if",
"(",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"isSetOrderTotal",
"(",
")",
")",
"{",
"$",
"orderTotalorderReferenceAttributes",
"=",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"getOrderTotal",
"(",
")",
";",
"if",
"(",
"$",
"orderTotalorderReferenceAttributes",
"->",
"isSetCurrencyCode",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'OrderTotal'",
".",
"'.'",
".",
"'CurrencyCode'",
"]",
"=",
"$",
"orderTotalorderReferenceAttributes",
"->",
"getCurrencyCode",
"(",
")",
";",
"}",
"if",
"(",
"$",
"orderTotalorderReferenceAttributes",
"->",
"isSetAmount",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'OrderTotal'",
".",
"'.'",
".",
"'Amount'",
"]",
"=",
"$",
"orderTotalorderReferenceAttributes",
"->",
"getAmount",
"(",
")",
";",
"}",
"}",
"if",
"(",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"isSetPlatformId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'PlatformId'",
"]",
"=",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"getPlatformId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"isSetSellerNote",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerNote'",
"]",
"=",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"getSellerNote",
"(",
")",
";",
"}",
"if",
"(",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"isSetSellerOrderAttributes",
"(",
")",
")",
"{",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"=",
"$",
"orderReferenceAttributescreateOrderReferenceForIdRequest",
"->",
"getSellerOrderAttributes",
"(",
")",
";",
"if",
"(",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"isSetSellerOrderId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'SellerOrderId'",
"]",
"=",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"getSellerOrderId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"isSetStoreName",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'StoreName'",
"]",
"=",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"getStoreName",
"(",
")",
";",
"}",
"if",
"(",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"isSetOrderItemCategories",
"(",
")",
")",
"{",
"$",
"orderItemCategoriessellerOrderAttributes",
"=",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"getOrderItemCategories",
"(",
")",
";",
"foreach",
"(",
"$",
"orderItemCategoriessellerOrderAttributes",
"->",
"getOrderItemCategory",
"(",
")",
"as",
"$",
"orderItemCategoryorderItemCategoriesIndex",
"=>",
"$",
"orderItemCategoryorderItemCategories",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'OrderItemCategories'",
".",
"'.'",
".",
"'OrderItemCategory'",
".",
"'.'",
".",
"(",
"$",
"orderItemCategoryorderItemCategoriesIndex",
"+",
"1",
")",
"]",
"=",
"$",
"orderItemCategoryorderItemCategories",
";",
"}",
"}",
"if",
"(",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"isSetCustomInformation",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'OrderReferenceAttributes'",
".",
"'.'",
".",
"'SellerOrderAttributes'",
".",
"'.'",
".",
"'CustomInformation'",
"]",
"=",
"$",
"sellerOrderAttributesorderReferenceAttributes",
"->",
"getCustomInformation",
"(",
")",
";",
"}",
"}",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert CreateOrderReferenceForIdRequest to name value pairs | [
"Convert",
"CreateOrderReferenceForIdRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1436-L1493 |
31,722 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertGetBillingAgreementDetails | private function _convertGetBillingAgreementDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetBillingAgreementDetails';
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAddressConsentToken()) {
$parameters['AddressConsentToken'] = $request->getAddressConsentToken();
}
return $parameters;
} | php | private function _convertGetBillingAgreementDetails($request) {
$parameters = array();
$parameters['Action'] = 'GetBillingAgreementDetails';
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAddressConsentToken()) {
$parameters['AddressConsentToken'] = $request->getAddressConsentToken();
}
return $parameters;
} | [
"private",
"function",
"_convertGetBillingAgreementDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'GetBillingAgreementDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonBillingAgreementId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonBillingAgreementId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonBillingAgreementId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAddressConsentToken",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AddressConsentToken'",
"]",
"=",
"$",
"request",
"->",
"getAddressConsentToken",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert GetBillingAgreementDetailsRequest to name value pairs | [
"Convert",
"GetBillingAgreementDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1499-L1514 |
31,723 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertSetBillingAgreementDetails | private function _convertSetBillingAgreementDetails($request) {
$parameters = array();
$parameters['Action'] = 'SetBillingAgreementDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetBillingAgreementAttributes()) {
$billingAgreementAttributessetBillingAgreementDetailsRequest = $request->getBillingAgreementAttributes();
if ($billingAgreementAttributessetBillingAgreementDetailsRequest->isSetPlatformId()) {
$parameters['BillingAgreementAttributes' . '.' . 'PlatformId'] = $billingAgreementAttributessetBillingAgreementDetailsRequest->getPlatformId();
}
if ($billingAgreementAttributessetBillingAgreementDetailsRequest->isSetSellerNote()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerNote'] = $billingAgreementAttributessetBillingAgreementDetailsRequest->getSellerNote();
}
if ($billingAgreementAttributessetBillingAgreementDetailsRequest->isSetSellerBillingAgreementAttributes()) {
$sellerBillingAgreementAttributesbillingAgreementAttributes = $billingAgreementAttributessetBillingAgreementDetailsRequest->getSellerBillingAgreementAttributes();
if ($sellerBillingAgreementAttributesbillingAgreementAttributes->isSetSellerBillingAgreementId()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerBillingAgreementAttributes' . '.' . 'SellerBillingAgreementId'] = $sellerBillingAgreementAttributesbillingAgreementAttributes->getSellerBillingAgreementId();
}
if ($sellerBillingAgreementAttributesbillingAgreementAttributes->isSetStoreName()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerBillingAgreementAttributes' . '.' . 'StoreName'] = $sellerBillingAgreementAttributesbillingAgreementAttributes->getStoreName();
}
if ($sellerBillingAgreementAttributesbillingAgreementAttributes->isSetCustomInformation()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerBillingAgreementAttributes' . '.' . 'CustomInformation'] = $sellerBillingAgreementAttributesbillingAgreementAttributes->getCustomInformation();
}
}
}
return $parameters;
} | php | private function _convertSetBillingAgreementDetails($request) {
$parameters = array();
$parameters['Action'] = 'SetBillingAgreementDetails';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetBillingAgreementAttributes()) {
$billingAgreementAttributessetBillingAgreementDetailsRequest = $request->getBillingAgreementAttributes();
if ($billingAgreementAttributessetBillingAgreementDetailsRequest->isSetPlatformId()) {
$parameters['BillingAgreementAttributes' . '.' . 'PlatformId'] = $billingAgreementAttributessetBillingAgreementDetailsRequest->getPlatformId();
}
if ($billingAgreementAttributessetBillingAgreementDetailsRequest->isSetSellerNote()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerNote'] = $billingAgreementAttributessetBillingAgreementDetailsRequest->getSellerNote();
}
if ($billingAgreementAttributessetBillingAgreementDetailsRequest->isSetSellerBillingAgreementAttributes()) {
$sellerBillingAgreementAttributesbillingAgreementAttributes = $billingAgreementAttributessetBillingAgreementDetailsRequest->getSellerBillingAgreementAttributes();
if ($sellerBillingAgreementAttributesbillingAgreementAttributes->isSetSellerBillingAgreementId()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerBillingAgreementAttributes' . '.' . 'SellerBillingAgreementId'] = $sellerBillingAgreementAttributesbillingAgreementAttributes->getSellerBillingAgreementId();
}
if ($sellerBillingAgreementAttributesbillingAgreementAttributes->isSetStoreName()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerBillingAgreementAttributes' . '.' . 'StoreName'] = $sellerBillingAgreementAttributesbillingAgreementAttributes->getStoreName();
}
if ($sellerBillingAgreementAttributesbillingAgreementAttributes->isSetCustomInformation()) {
$parameters['BillingAgreementAttributes' . '.' . 'SellerBillingAgreementAttributes' . '.' . 'CustomInformation'] = $sellerBillingAgreementAttributesbillingAgreementAttributes->getCustomInformation();
}
}
}
return $parameters;
} | [
"private",
"function",
"_convertSetBillingAgreementDetails",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'SetBillingAgreementDetails'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonBillingAgreementId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonBillingAgreementId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonBillingAgreementId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetBillingAgreementAttributes",
"(",
")",
")",
"{",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"=",
"$",
"request",
"->",
"getBillingAgreementAttributes",
"(",
")",
";",
"if",
"(",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"->",
"isSetPlatformId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'BillingAgreementAttributes'",
".",
"'.'",
".",
"'PlatformId'",
"]",
"=",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"->",
"getPlatformId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"->",
"isSetSellerNote",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'BillingAgreementAttributes'",
".",
"'.'",
".",
"'SellerNote'",
"]",
"=",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"->",
"getSellerNote",
"(",
")",
";",
"}",
"if",
"(",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"->",
"isSetSellerBillingAgreementAttributes",
"(",
")",
")",
"{",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"=",
"$",
"billingAgreementAttributessetBillingAgreementDetailsRequest",
"->",
"getSellerBillingAgreementAttributes",
"(",
")",
";",
"if",
"(",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"->",
"isSetSellerBillingAgreementId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'BillingAgreementAttributes'",
".",
"'.'",
".",
"'SellerBillingAgreementAttributes'",
".",
"'.'",
".",
"'SellerBillingAgreementId'",
"]",
"=",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"->",
"getSellerBillingAgreementId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"->",
"isSetStoreName",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'BillingAgreementAttributes'",
".",
"'.'",
".",
"'SellerBillingAgreementAttributes'",
".",
"'.'",
".",
"'StoreName'",
"]",
"=",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"->",
"getStoreName",
"(",
")",
";",
"}",
"if",
"(",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"->",
"isSetCustomInformation",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'BillingAgreementAttributes'",
".",
"'.'",
".",
"'SellerBillingAgreementAttributes'",
".",
"'.'",
".",
"'CustomInformation'",
"]",
"=",
"$",
"sellerBillingAgreementAttributesbillingAgreementAttributes",
"->",
"getCustomInformation",
"(",
")",
";",
"}",
"}",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert SetBillingAgreementDetailsRequest to name value pairs | [
"Convert",
"SetBillingAgreementDetailsRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1520-L1553 |
31,724 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertConfirmBillingAgreement | private function _convertConfirmBillingAgreement($request) {
$parameters = array();
$parameters['Action'] = 'ConfirmBillingAgreement';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
return $parameters;
} | php | private function _convertConfirmBillingAgreement($request) {
$parameters = array();
$parameters['Action'] = 'ConfirmBillingAgreement';
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
return $parameters;
} | [
"private",
"function",
"_convertConfirmBillingAgreement",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'ConfirmBillingAgreement'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonBillingAgreementId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonBillingAgreementId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonBillingAgreementId",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert ConfirmBillingAgreementRequest to name value pairs | [
"Convert",
"ConfirmBillingAgreementRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1559-L1571 |
31,725 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertValidateBillingAgreement | private function _convertValidateBillingAgreement($request) {
$parameters = array();
$parameters['Action'] = 'ValidateBillingAgreement';
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
return $parameters;
} | php | private function _convertValidateBillingAgreement($request) {
$parameters = array();
$parameters['Action'] = 'ValidateBillingAgreement';
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
return $parameters;
} | [
"private",
"function",
"_convertValidateBillingAgreement",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'ValidateBillingAgreement'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonBillingAgreementId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonBillingAgreementId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonBillingAgreementId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert ValidateBillingAgreementRequest to name value pairs | [
"Convert",
"ValidateBillingAgreementRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1577-L1589 |
31,726 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php | OffAmazonPaymentsService_Client._convertCloseBillingAgreement | private function _convertCloseBillingAgreement($request) {
$parameters = array();
$parameters['Action'] = 'CloseBillingAgreement';
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetClosureReason()) {
$parameters['ClosureReason'] = $request->getClosureReason();
}
if ($request->isSetReasonCode()) {
$parameters['ReasonCode'] = $request->getReasonCode();
}
return $parameters;
} | php | private function _convertCloseBillingAgreement($request) {
$parameters = array();
$parameters['Action'] = 'CloseBillingAgreement';
if ($request->isSetAmazonBillingAgreementId()) {
$parameters['AmazonBillingAgreementId'] = $request->getAmazonBillingAgreementId();
}
if ($request->isSetSellerId()) {
$parameters['SellerId'] = $request->getSellerId();
}
if ($request->isSetClosureReason()) {
$parameters['ClosureReason'] = $request->getClosureReason();
}
if ($request->isSetReasonCode()) {
$parameters['ReasonCode'] = $request->getReasonCode();
}
return $parameters;
} | [
"private",
"function",
"_convertCloseBillingAgreement",
"(",
"$",
"request",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
")",
";",
"$",
"parameters",
"[",
"'Action'",
"]",
"=",
"'CloseBillingAgreement'",
";",
"if",
"(",
"$",
"request",
"->",
"isSetAmazonBillingAgreementId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'AmazonBillingAgreementId'",
"]",
"=",
"$",
"request",
"->",
"getAmazonBillingAgreementId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetSellerId",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'SellerId'",
"]",
"=",
"$",
"request",
"->",
"getSellerId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetClosureReason",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'ClosureReason'",
"]",
"=",
"$",
"request",
"->",
"getClosureReason",
"(",
")",
";",
"}",
"if",
"(",
"$",
"request",
"->",
"isSetReasonCode",
"(",
")",
")",
"{",
"$",
"parameters",
"[",
"'ReasonCode'",
"]",
"=",
"$",
"request",
"->",
"getReasonCode",
"(",
")",
";",
"}",
"return",
"$",
"parameters",
";",
"}"
] | Convert CloseBillingAgreementRequest to name value pairs | [
"Convert",
"CloseBillingAgreementRequest",
"to",
"name",
"value",
"pairs"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Client.php#L1664-L1682 |
31,727 | Erebot/Erebot | src/Event/Match/Chan.php | Chan.setChan | public function setChan($chan)
{
if (!\Erebot\Utils::stringifiable($chan)) {
throw new \Erebot\InvalidValueException('Not a channel');
}
$this->chan = $chan;
} | php | public function setChan($chan)
{
if (!\Erebot\Utils::stringifiable($chan)) {
throw new \Erebot\InvalidValueException('Not a channel');
}
$this->chan = $chan;
} | [
"public",
"function",
"setChan",
"(",
"$",
"chan",
")",
"{",
"if",
"(",
"!",
"\\",
"Erebot",
"\\",
"Utils",
"::",
"stringifiable",
"(",
"$",
"chan",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"InvalidValueException",
"(",
"'Not a channel'",
")",
";",
"}",
"$",
"this",
"->",
"chan",
"=",
"$",
"chan",
";",
"}"
] | Sets the channel used in comparisons.
\param $chan string|object
Channel to match incoming events against.
\throw Erebot::InvalidValueException
The given chan is invalid. | [
"Sets",
"the",
"channel",
"used",
"in",
"comparisons",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Event/Match/Chan.php#L70-L77 |
31,728 | sylingd/Yesf | src/Connection/PoolTrait.php | PoolTrait.initPool | public function initPool($config) {
if (!method_exists($this, 'getMinClient') || !method_exists($this, 'getMaxClient')) {
throw new NotFoundException("Method getMinClient or getMaxClient not found");
}
$this->wait = new SplQueue;
$this->connection = new SplQueue;
$this->last_run_out_time = time();
if (isset($config['min'])) {
$this->min_client = intval($config['min']);
}
if (isset($config['max'])) {
$this->max_client = intval($config['max']);
}
//建立最小连接
$count = $this->getMinClient();
while ($count--) {
$this->createConnection();
}
} | php | public function initPool($config) {
if (!method_exists($this, 'getMinClient') || !method_exists($this, 'getMaxClient')) {
throw new NotFoundException("Method getMinClient or getMaxClient not found");
}
$this->wait = new SplQueue;
$this->connection = new SplQueue;
$this->last_run_out_time = time();
if (isset($config['min'])) {
$this->min_client = intval($config['min']);
}
if (isset($config['max'])) {
$this->max_client = intval($config['max']);
}
//建立最小连接
$count = $this->getMinClient();
while ($count--) {
$this->createConnection();
}
} | [
"public",
"function",
"initPool",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"this",
",",
"'getMinClient'",
")",
"||",
"!",
"method_exists",
"(",
"$",
"this",
",",
"'getMaxClient'",
")",
")",
"{",
"throw",
"new",
"NotFoundException",
"(",
"\"Method getMinClient or getMaxClient not found\"",
")",
";",
"}",
"$",
"this",
"->",
"wait",
"=",
"new",
"SplQueue",
";",
"$",
"this",
"->",
"connection",
"=",
"new",
"SplQueue",
";",
"$",
"this",
"->",
"last_run_out_time",
"=",
"time",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'min'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"min_client",
"=",
"intval",
"(",
"$",
"config",
"[",
"'min'",
"]",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'max'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"max_client",
"=",
"intval",
"(",
"$",
"config",
"[",
"'max'",
"]",
")",
";",
"}",
"//建立最小连接",
"$",
"count",
"=",
"$",
"this",
"->",
"getMinClient",
"(",
")",
";",
"while",
"(",
"$",
"count",
"--",
")",
"{",
"$",
"this",
"->",
"createConnection",
"(",
")",
";",
"}",
"}"
] | Setup connection pool
@access public
@param array $config | [
"Setup",
"connection",
"pool"
] | 0fc2b42903bb3519c54c596270c890c826aeb1df | https://github.com/sylingd/Yesf/blob/0fc2b42903bb3519c54c596270c890c826aeb1df/src/Connection/PoolTrait.php#L45-L63 |
31,729 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentDebit.class.php | TShopPaymentHandlerIPaymentDebit.SetErrorCodesFromResponseToMessageManager | protected function SetErrorCodesFromResponseToMessageManager()
{
$SReturnMessage = $this->GetErrorCodesFromResponse();
if (!empty($SReturnMessage)) {
$oMsgManager = TCMSMessageManager::GetInstance();
$oMsgManager->AddMessage(self::MSG_MANAGER_NAME, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $SReturnMessage));
}
} | php | protected function SetErrorCodesFromResponseToMessageManager()
{
$SReturnMessage = $this->GetErrorCodesFromResponse();
if (!empty($SReturnMessage)) {
$oMsgManager = TCMSMessageManager::GetInstance();
$oMsgManager->AddMessage(self::MSG_MANAGER_NAME, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $SReturnMessage));
}
} | [
"protected",
"function",
"SetErrorCodesFromResponseToMessageManager",
"(",
")",
"{",
"$",
"SReturnMessage",
"=",
"$",
"this",
"->",
"GetErrorCodesFromResponse",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"SReturnMessage",
")",
")",
"{",
"$",
"oMsgManager",
"=",
"TCMSMessageManager",
"::",
"GetInstance",
"(",
")",
";",
"$",
"oMsgManager",
"->",
"AddMessage",
"(",
"self",
"::",
"MSG_MANAGER_NAME",
",",
"'ERROR-ORDER-REQUEST-PAYMENT-ERROR'",
",",
"array",
"(",
"'errorMsg'",
"=>",
"$",
"SReturnMessage",
")",
")",
";",
"}",
"}"
] | if request to IPayment was not successfully create a error message. | [
"if",
"request",
"to",
"IPayment",
"was",
"not",
"successfully",
"create",
"a",
"error",
"message",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentDebit.class.php#L68-L75 |
31,730 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentDebit.class.php | TShopPaymentHandlerIPaymentDebit.GetUserAddressData | protected function GetUserAddressData()
{
$aUserAddressData = parent::GetUserAddressData();
$oActiveUser = TdbDataExtranetUser::GetInstance();
if ($oActiveUser) {
$oBillingAddress = $oActiveUser->GetBillingAddress();
if ($oBillingAddress) {
$aUserAddressData['addr_name'] = $oBillingAddress->fieldFirstname.' '.$oBillingAddress->fieldLastname;
}
}
return $aUserAddressData;
} | php | protected function GetUserAddressData()
{
$aUserAddressData = parent::GetUserAddressData();
$oActiveUser = TdbDataExtranetUser::GetInstance();
if ($oActiveUser) {
$oBillingAddress = $oActiveUser->GetBillingAddress();
if ($oBillingAddress) {
$aUserAddressData['addr_name'] = $oBillingAddress->fieldFirstname.' '.$oBillingAddress->fieldLastname;
}
}
return $aUserAddressData;
} | [
"protected",
"function",
"GetUserAddressData",
"(",
")",
"{",
"$",
"aUserAddressData",
"=",
"parent",
"::",
"GetUserAddressData",
"(",
")",
";",
"$",
"oActiveUser",
"=",
"TdbDataExtranetUser",
"::",
"GetInstance",
"(",
")",
";",
"if",
"(",
"$",
"oActiveUser",
")",
"{",
"$",
"oBillingAddress",
"=",
"$",
"oActiveUser",
"->",
"GetBillingAddress",
"(",
")",
";",
"if",
"(",
"$",
"oBillingAddress",
")",
"{",
"$",
"aUserAddressData",
"[",
"'addr_name'",
"]",
"=",
"$",
"oBillingAddress",
"->",
"fieldFirstname",
".",
"' '",
".",
"$",
"oBillingAddress",
"->",
"fieldLastname",
";",
"}",
"}",
"return",
"$",
"aUserAddressData",
";",
"}"
] | Get user address data as array
On ELV add user name to parameter.
@return array $aUserAddressData | [
"Get",
"user",
"address",
"data",
"as",
"array",
"On",
"ELV",
"add",
"user",
"name",
"to",
"parameter",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentDebit.class.php#L83-L95 |
31,731 | chameleon-system/chameleon-shop | src/ShopBundle/mappers/article/TPkgShopMapper_ArticleOtherCategoriesTeaser.class.php | TPkgShopMapper_ArticleOtherCategoriesTeaser.& | protected function &getCategoryList(TdbShopArticle $oArticle)
{
/** @var $oCategoryList TdbShopCategoryList */
$oCategoryList = &$oArticle->GetFieldShopCategoryList();
$oCategoryList->GoToStart();
if (0 === $oCategoryList->Length() && $oArticle->IsVariant()) {
$oParent = &$oArticle->GetFieldVariantParent();
$oCategoryList = &$oParent->GetFieldShopCategoryList();
$oCategoryList->GoToStart();
}
return $oCategoryList;
} | php | protected function &getCategoryList(TdbShopArticle $oArticle)
{
/** @var $oCategoryList TdbShopCategoryList */
$oCategoryList = &$oArticle->GetFieldShopCategoryList();
$oCategoryList->GoToStart();
if (0 === $oCategoryList->Length() && $oArticle->IsVariant()) {
$oParent = &$oArticle->GetFieldVariantParent();
$oCategoryList = &$oParent->GetFieldShopCategoryList();
$oCategoryList->GoToStart();
}
return $oCategoryList;
} | [
"protected",
"function",
"&",
"getCategoryList",
"(",
"TdbShopArticle",
"$",
"oArticle",
")",
"{",
"/** @var $oCategoryList TdbShopCategoryList */",
"$",
"oCategoryList",
"=",
"&",
"$",
"oArticle",
"->",
"GetFieldShopCategoryList",
"(",
")",
";",
"$",
"oCategoryList",
"->",
"GoToStart",
"(",
")",
";",
"if",
"(",
"0",
"===",
"$",
"oCategoryList",
"->",
"Length",
"(",
")",
"&&",
"$",
"oArticle",
"->",
"IsVariant",
"(",
")",
")",
"{",
"$",
"oParent",
"=",
"&",
"$",
"oArticle",
"->",
"GetFieldVariantParent",
"(",
")",
";",
"$",
"oCategoryList",
"=",
"&",
"$",
"oParent",
"->",
"GetFieldShopCategoryList",
"(",
")",
";",
"$",
"oCategoryList",
"->",
"GoToStart",
"(",
")",
";",
"}",
"return",
"$",
"oCategoryList",
";",
"}"
] | return category list for article or parent article if article is variant and fetched category list is empty.
@param TdbShopArticle $oArticle
@return TdbShopCategoryList | [
"return",
"category",
"list",
"for",
"article",
"or",
"parent",
"article",
"if",
"article",
"is",
"variant",
"and",
"fetched",
"category",
"list",
"is",
"empty",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/mappers/article/TPkgShopMapper_ArticleOtherCategoriesTeaser.class.php#L47-L59 |
31,732 | chameleon-system/chameleon-shop | src/ShopBundle/mappers/article/TPkgShopMapper_ArticleOtherCategoriesTeaser.class.php | TPkgShopMapper_ArticleOtherCategoriesTeaser.getLink | protected function getLink(TdbShopCategory $oCategory, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled, $bLinkOnlyLastItem = false)
{
$aLinkParts = array();
$oBreadcrumb = $oCategory->GetBreadcrumb();
/** @var $oBreadcrumbItem TdbShopCategory */
while ($oBreadcrumbItem = $oBreadcrumb->Next()) {
if ($bCachingEnabled) {
$oCacheTriggerManager->addTrigger($oBreadcrumbItem->table, $oBreadcrumbItem->id);
}
$aLinkData = array(
'sName' => $oBreadcrumbItem->GetName(),
'sLink' => '',
);
if (false === $bLinkOnlyLastItem || (true === $bLinkOnlyLastItem && $oBreadcrumb->IsLast())) {
$aLinkData['sLink'] = $oBreadcrumbItem->GetLink();
}
$aLinkParts[] = $aLinkData;
}
return $aLinkParts;
} | php | protected function getLink(TdbShopCategory $oCategory, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled, $bLinkOnlyLastItem = false)
{
$aLinkParts = array();
$oBreadcrumb = $oCategory->GetBreadcrumb();
/** @var $oBreadcrumbItem TdbShopCategory */
while ($oBreadcrumbItem = $oBreadcrumb->Next()) {
if ($bCachingEnabled) {
$oCacheTriggerManager->addTrigger($oBreadcrumbItem->table, $oBreadcrumbItem->id);
}
$aLinkData = array(
'sName' => $oBreadcrumbItem->GetName(),
'sLink' => '',
);
if (false === $bLinkOnlyLastItem || (true === $bLinkOnlyLastItem && $oBreadcrumb->IsLast())) {
$aLinkData['sLink'] = $oBreadcrumbItem->GetLink();
}
$aLinkParts[] = $aLinkData;
}
return $aLinkParts;
} | [
"protected",
"function",
"getLink",
"(",
"TdbShopCategory",
"$",
"oCategory",
",",
"IMapperCacheTriggerRestricted",
"$",
"oCacheTriggerManager",
",",
"$",
"bCachingEnabled",
",",
"$",
"bLinkOnlyLastItem",
"=",
"false",
")",
"{",
"$",
"aLinkParts",
"=",
"array",
"(",
")",
";",
"$",
"oBreadcrumb",
"=",
"$",
"oCategory",
"->",
"GetBreadcrumb",
"(",
")",
";",
"/** @var $oBreadcrumbItem TdbShopCategory */",
"while",
"(",
"$",
"oBreadcrumbItem",
"=",
"$",
"oBreadcrumb",
"->",
"Next",
"(",
")",
")",
"{",
"if",
"(",
"$",
"bCachingEnabled",
")",
"{",
"$",
"oCacheTriggerManager",
"->",
"addTrigger",
"(",
"$",
"oBreadcrumbItem",
"->",
"table",
",",
"$",
"oBreadcrumbItem",
"->",
"id",
")",
";",
"}",
"$",
"aLinkData",
"=",
"array",
"(",
"'sName'",
"=>",
"$",
"oBreadcrumbItem",
"->",
"GetName",
"(",
")",
",",
"'sLink'",
"=>",
"''",
",",
")",
";",
"if",
"(",
"false",
"===",
"$",
"bLinkOnlyLastItem",
"||",
"(",
"true",
"===",
"$",
"bLinkOnlyLastItem",
"&&",
"$",
"oBreadcrumb",
"->",
"IsLast",
"(",
")",
")",
")",
"{",
"$",
"aLinkData",
"[",
"'sLink'",
"]",
"=",
"$",
"oBreadcrumbItem",
"->",
"GetLink",
"(",
")",
";",
"}",
"$",
"aLinkParts",
"[",
"]",
"=",
"$",
"aLinkData",
";",
"}",
"return",
"$",
"aLinkParts",
";",
"}"
] | converts the category into an array with link data.
@param TdbShopCategory $oCategory
@param IMapperCacheTriggerRestricted $oCacheTriggerManager
@param bool $bCachingEnabled
@param bool $bLinkOnlyLastItem set to true if only the last category should have a link set otherwise each item has a link set
@return array | [
"converts",
"the",
"category",
"into",
"an",
"array",
"with",
"link",
"data",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/mappers/article/TPkgShopMapper_ArticleOtherCategoriesTeaser.class.php#L71-L93 |
31,733 | chameleon-system/chameleon-shop | src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php | TPkgImageHotspotItem.GetNextItem | public function GetNextItem()
{
$oNextItem = &$this->GetFromInternalCache('oNextItem');
if (is_null($oNextItem)) {
$oItemList = TdbPkgImageHotspotItemList::GetListForPkgImageHotspotId($this->fieldPkgImageHotspotId);
$oItemList->bAllowItemCache = true;
if ($oItemList->Length() > 1) {
$oNextItem = null;
$oFirst = $oItemList->Current();
while (is_null($oNextItem) && ($oTmpItem = $oItemList->Next())) {
if ($oTmpItem->IsSameAs($this)) {
$oNextItem = $oItemList->Next();
}
}
if (false === $oNextItem) {
$oNextItem = $oFirst;
if ($oNextItem->IsSameAs($this)) {
$oNextItem = false;
}
}
}
$this->SetInternalCache('oNextItem', $oNextItem);
}
return $oNextItem;
} | php | public function GetNextItem()
{
$oNextItem = &$this->GetFromInternalCache('oNextItem');
if (is_null($oNextItem)) {
$oItemList = TdbPkgImageHotspotItemList::GetListForPkgImageHotspotId($this->fieldPkgImageHotspotId);
$oItemList->bAllowItemCache = true;
if ($oItemList->Length() > 1) {
$oNextItem = null;
$oFirst = $oItemList->Current();
while (is_null($oNextItem) && ($oTmpItem = $oItemList->Next())) {
if ($oTmpItem->IsSameAs($this)) {
$oNextItem = $oItemList->Next();
}
}
if (false === $oNextItem) {
$oNextItem = $oFirst;
if ($oNextItem->IsSameAs($this)) {
$oNextItem = false;
}
}
}
$this->SetInternalCache('oNextItem', $oNextItem);
}
return $oNextItem;
} | [
"public",
"function",
"GetNextItem",
"(",
")",
"{",
"$",
"oNextItem",
"=",
"&",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oNextItem'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oNextItem",
")",
")",
"{",
"$",
"oItemList",
"=",
"TdbPkgImageHotspotItemList",
"::",
"GetListForPkgImageHotspotId",
"(",
"$",
"this",
"->",
"fieldPkgImageHotspotId",
")",
";",
"$",
"oItemList",
"->",
"bAllowItemCache",
"=",
"true",
";",
"if",
"(",
"$",
"oItemList",
"->",
"Length",
"(",
")",
">",
"1",
")",
"{",
"$",
"oNextItem",
"=",
"null",
";",
"$",
"oFirst",
"=",
"$",
"oItemList",
"->",
"Current",
"(",
")",
";",
"while",
"(",
"is_null",
"(",
"$",
"oNextItem",
")",
"&&",
"(",
"$",
"oTmpItem",
"=",
"$",
"oItemList",
"->",
"Next",
"(",
")",
")",
")",
"{",
"if",
"(",
"$",
"oTmpItem",
"->",
"IsSameAs",
"(",
"$",
"this",
")",
")",
"{",
"$",
"oNextItem",
"=",
"$",
"oItemList",
"->",
"Next",
"(",
")",
";",
"}",
"}",
"if",
"(",
"false",
"===",
"$",
"oNextItem",
")",
"{",
"$",
"oNextItem",
"=",
"$",
"oFirst",
";",
"if",
"(",
"$",
"oNextItem",
"->",
"IsSameAs",
"(",
"$",
"this",
")",
")",
"{",
"$",
"oNextItem",
"=",
"false",
";",
"}",
"}",
"}",
"$",
"this",
"->",
"SetInternalCache",
"(",
"'oNextItem'",
",",
"$",
"oNextItem",
")",
";",
"}",
"return",
"$",
"oNextItem",
";",
"}"
] | returns the item next in line relative to this item
if the current item is the last in line, the method will return the first item. returns false if
no next item exists.
@return TdbPkgImageHotspotItem | [
"returns",
"the",
"item",
"next",
"in",
"line",
"relative",
"to",
"this",
"item",
"if",
"the",
"current",
"item",
"is",
"the",
"last",
"in",
"line",
"the",
"method",
"will",
"return",
"the",
"first",
"item",
".",
"returns",
"false",
"if",
"no",
"next",
"item",
"exists",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php#L81-L106 |
31,734 | chameleon-system/chameleon-shop | src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php | TPkgImageHotspotItem.GetPreviousItem | public function GetPreviousItem()
{
$oPreviousItem = &$this->GetFromInternalCache('oPreviousItem');
if (is_null($oPreviousItem)) {
$oItemList = TdbPkgImageHotspotItemList::GetListForPkgImageHotspotId($this->fieldPkgImageHotspotId);
$oItemList->bAllowItemCache = true;
if ($oItemList->Length() > 1) {
$oPreviousItem = null;
$oItemList->GoToEnd();
while (is_null($oPreviousItem) && ($oTmpItem = $oItemList->Previous())) {
if ($oTmpItem->IsSameAs($this)) {
$oPreviousItem = $oItemList->Previous();
}
}
if (!$oPreviousItem) {
$oItemList->GoToEnd();
$oPreviousItem = $oItemList->Previous();
if (!$oPreviousItem || $oPreviousItem->IsSameAs($this)) {
$oPreviousItem = false;
}
}
}
$this->SetInternalCache('oPreviousItem', $oPreviousItem);
}
return $oPreviousItem;
} | php | public function GetPreviousItem()
{
$oPreviousItem = &$this->GetFromInternalCache('oPreviousItem');
if (is_null($oPreviousItem)) {
$oItemList = TdbPkgImageHotspotItemList::GetListForPkgImageHotspotId($this->fieldPkgImageHotspotId);
$oItemList->bAllowItemCache = true;
if ($oItemList->Length() > 1) {
$oPreviousItem = null;
$oItemList->GoToEnd();
while (is_null($oPreviousItem) && ($oTmpItem = $oItemList->Previous())) {
if ($oTmpItem->IsSameAs($this)) {
$oPreviousItem = $oItemList->Previous();
}
}
if (!$oPreviousItem) {
$oItemList->GoToEnd();
$oPreviousItem = $oItemList->Previous();
if (!$oPreviousItem || $oPreviousItem->IsSameAs($this)) {
$oPreviousItem = false;
}
}
}
$this->SetInternalCache('oPreviousItem', $oPreviousItem);
}
return $oPreviousItem;
} | [
"public",
"function",
"GetPreviousItem",
"(",
")",
"{",
"$",
"oPreviousItem",
"=",
"&",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oPreviousItem'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oPreviousItem",
")",
")",
"{",
"$",
"oItemList",
"=",
"TdbPkgImageHotspotItemList",
"::",
"GetListForPkgImageHotspotId",
"(",
"$",
"this",
"->",
"fieldPkgImageHotspotId",
")",
";",
"$",
"oItemList",
"->",
"bAllowItemCache",
"=",
"true",
";",
"if",
"(",
"$",
"oItemList",
"->",
"Length",
"(",
")",
">",
"1",
")",
"{",
"$",
"oPreviousItem",
"=",
"null",
";",
"$",
"oItemList",
"->",
"GoToEnd",
"(",
")",
";",
"while",
"(",
"is_null",
"(",
"$",
"oPreviousItem",
")",
"&&",
"(",
"$",
"oTmpItem",
"=",
"$",
"oItemList",
"->",
"Previous",
"(",
")",
")",
")",
"{",
"if",
"(",
"$",
"oTmpItem",
"->",
"IsSameAs",
"(",
"$",
"this",
")",
")",
"{",
"$",
"oPreviousItem",
"=",
"$",
"oItemList",
"->",
"Previous",
"(",
")",
";",
"}",
"}",
"if",
"(",
"!",
"$",
"oPreviousItem",
")",
"{",
"$",
"oItemList",
"->",
"GoToEnd",
"(",
")",
";",
"$",
"oPreviousItem",
"=",
"$",
"oItemList",
"->",
"Previous",
"(",
")",
";",
"if",
"(",
"!",
"$",
"oPreviousItem",
"||",
"$",
"oPreviousItem",
"->",
"IsSameAs",
"(",
"$",
"this",
")",
")",
"{",
"$",
"oPreviousItem",
"=",
"false",
";",
"}",
"}",
"}",
"$",
"this",
"->",
"SetInternalCache",
"(",
"'oPreviousItem'",
",",
"$",
"oPreviousItem",
")",
";",
"}",
"return",
"$",
"oPreviousItem",
";",
"}"
] | returns the item before this item
if the current item is the first in line, the method will return the last item. returns false if
no previous item exists.
@return TdbPkgImageHotspotItem | [
"returns",
"the",
"item",
"before",
"this",
"item",
"if",
"the",
"current",
"item",
"is",
"the",
"first",
"in",
"line",
"the",
"method",
"will",
"return",
"the",
"last",
"item",
".",
"returns",
"false",
"if",
"no",
"previous",
"item",
"exists",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php#L115-L141 |
31,735 | chameleon-system/chameleon-shop | src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php | TPkgImageHotspotItem.GetURLParameterBaseForActiveSpot | public static function GetURLParameterBaseForActiveSpot()
{
$oGlobal = TGlobal::instance();
$oRunningModule = &$oGlobal->GetExecutingModulePointer();
$sModuleSpotName = $oRunningModule->sModuleSpotName;
return TdbPkgImageHotspotItem::URL_NAME_ITEM_ID.$sModuleSpotName;
} | php | public static function GetURLParameterBaseForActiveSpot()
{
$oGlobal = TGlobal::instance();
$oRunningModule = &$oGlobal->GetExecutingModulePointer();
$sModuleSpotName = $oRunningModule->sModuleSpotName;
return TdbPkgImageHotspotItem::URL_NAME_ITEM_ID.$sModuleSpotName;
} | [
"public",
"static",
"function",
"GetURLParameterBaseForActiveSpot",
"(",
")",
"{",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"$",
"oRunningModule",
"=",
"&",
"$",
"oGlobal",
"->",
"GetExecutingModulePointer",
"(",
")",
";",
"$",
"sModuleSpotName",
"=",
"$",
"oRunningModule",
"->",
"sModuleSpotName",
";",
"return",
"TdbPkgImageHotspotItem",
"::",
"URL_NAME_ITEM_ID",
".",
"$",
"sModuleSpotName",
";",
"}"
] | returns the url parameter base name for the currently active module spot.
@return string | [
"returns",
"the",
"url",
"parameter",
"base",
"name",
"for",
"the",
"currently",
"active",
"module",
"spot",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php#L148-L155 |
31,736 | chameleon-system/chameleon-shop | src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php | TPkgImageHotspotItem.GetAjaxLink | public function GetAjaxLink($sViewName = 'standard', $sType = 'Core', $aParameter = array())
{
$oGlobal = TGlobal::instance();
$oRunningModule = &$oGlobal->GetExecutingModulePointer();
$aParameter['id'] = $this->id;
$aParameter['sViewName'] = $sViewName;
$aParameter['sType'] = $sType;
$aData = array(
TdbPkgImageHotspotItem::GetURLParameterBaseForActiveSpot() => $aParameter,
'module_fnc' => array($oRunningModule->sModuleSpotName => 'ExecuteAjaxCall'),
'_fnc' => 'AjaxRenderHotspotImage',
);
return $this->getActivePageService()->getLinkToActivePageRelative($aData);
} | php | public function GetAjaxLink($sViewName = 'standard', $sType = 'Core', $aParameter = array())
{
$oGlobal = TGlobal::instance();
$oRunningModule = &$oGlobal->GetExecutingModulePointer();
$aParameter['id'] = $this->id;
$aParameter['sViewName'] = $sViewName;
$aParameter['sType'] = $sType;
$aData = array(
TdbPkgImageHotspotItem::GetURLParameterBaseForActiveSpot() => $aParameter,
'module_fnc' => array($oRunningModule->sModuleSpotName => 'ExecuteAjaxCall'),
'_fnc' => 'AjaxRenderHotspotImage',
);
return $this->getActivePageService()->getLinkToActivePageRelative($aData);
} | [
"public",
"function",
"GetAjaxLink",
"(",
"$",
"sViewName",
"=",
"'standard'",
",",
"$",
"sType",
"=",
"'Core'",
",",
"$",
"aParameter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"$",
"oRunningModule",
"=",
"&",
"$",
"oGlobal",
"->",
"GetExecutingModulePointer",
"(",
")",
";",
"$",
"aParameter",
"[",
"'id'",
"]",
"=",
"$",
"this",
"->",
"id",
";",
"$",
"aParameter",
"[",
"'sViewName'",
"]",
"=",
"$",
"sViewName",
";",
"$",
"aParameter",
"[",
"'sType'",
"]",
"=",
"$",
"sType",
";",
"$",
"aData",
"=",
"array",
"(",
"TdbPkgImageHotspotItem",
"::",
"GetURLParameterBaseForActiveSpot",
"(",
")",
"=>",
"$",
"aParameter",
",",
"'module_fnc'",
"=>",
"array",
"(",
"$",
"oRunningModule",
"->",
"sModuleSpotName",
"=>",
"'ExecuteAjaxCall'",
")",
",",
"'_fnc'",
"=>",
"'AjaxRenderHotspotImage'",
",",
")",
";",
"return",
"$",
"this",
"->",
"getActivePageService",
"(",
")",
"->",
"getLinkToActivePageRelative",
"(",
"$",
"aData",
")",
";",
"}"
] | return the url request needed to fetch the spot using ajax. | [
"return",
"the",
"url",
"request",
"needed",
"to",
"fetch",
"the",
"spot",
"using",
"ajax",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ImageHotspotBundle/objects/db/TPkgImageHotspotItem.class.php#L172-L186 |
31,737 | chameleon-system/chameleon-shop | src/ShopListFilterBundle/objects/db/TPkgShopListfilterItem.class.php | TPkgShopListfilterItem.OverloadViewSettings | protected function OverloadViewSettings()
{
if (empty($this->fieldView)) {
$oListFilterItemType = $this->GetFieldPkgShopListfilterItemType();
if (!is_null($oListFilterItemType) && !TGlobal::IsCMSMode()) {
$this->sqlData['view'] = $oListFilterItemType->fieldView;
$this->fieldView = $this->sqlData['view'];
$this->sqlData['view_class_type'] = $oListFilterItemType->fieldViewClassType;
$this->fieldViewClassType = $this->sqlData['view_class_type'];
}
}
} | php | protected function OverloadViewSettings()
{
if (empty($this->fieldView)) {
$oListFilterItemType = $this->GetFieldPkgShopListfilterItemType();
if (!is_null($oListFilterItemType) && !TGlobal::IsCMSMode()) {
$this->sqlData['view'] = $oListFilterItemType->fieldView;
$this->fieldView = $this->sqlData['view'];
$this->sqlData['view_class_type'] = $oListFilterItemType->fieldViewClassType;
$this->fieldViewClassType = $this->sqlData['view_class_type'];
}
}
} | [
"protected",
"function",
"OverloadViewSettings",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"fieldView",
")",
")",
"{",
"$",
"oListFilterItemType",
"=",
"$",
"this",
"->",
"GetFieldPkgShopListfilterItemType",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"oListFilterItemType",
")",
"&&",
"!",
"TGlobal",
"::",
"IsCMSMode",
"(",
")",
")",
"{",
"$",
"this",
"->",
"sqlData",
"[",
"'view'",
"]",
"=",
"$",
"oListFilterItemType",
"->",
"fieldView",
";",
"$",
"this",
"->",
"fieldView",
"=",
"$",
"this",
"->",
"sqlData",
"[",
"'view'",
"]",
";",
"$",
"this",
"->",
"sqlData",
"[",
"'view_class_type'",
"]",
"=",
"$",
"oListFilterItemType",
"->",
"fieldViewClassType",
";",
"$",
"this",
"->",
"fieldViewClassType",
"=",
"$",
"this",
"->",
"sqlData",
"[",
"'view_class_type'",
"]",
";",
"}",
"}",
"}"
] | overload view settings from filter-type if nothing is set in this filter-item. | [
"overload",
"view",
"settings",
"from",
"filter",
"-",
"type",
"if",
"nothing",
"is",
"set",
"in",
"this",
"filter",
"-",
"item",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopListFilterBundle/objects/db/TPkgShopListfilterItem.class.php#L107-L118 |
31,738 | chameleon-system/chameleon-shop | src/ShopListFilterBundle/objects/db/TPkgShopListfilterItem.class.php | TPkgShopListfilterItem.GetActiveSettingAsArray | public function GetActiveSettingAsArray()
{
$aData = array();
if (is_array($this->aActiveFilterData) || !empty($this->aActiveFilterData)) {
$aData = array(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA => array($this->id => $this->aActiveFilterData));
}
return $aData;
} | php | public function GetActiveSettingAsArray()
{
$aData = array();
if (is_array($this->aActiveFilterData) || !empty($this->aActiveFilterData)) {
$aData = array(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA => array($this->id => $this->aActiveFilterData));
}
return $aData;
} | [
"public",
"function",
"GetActiveSettingAsArray",
"(",
")",
"{",
"$",
"aData",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"aActiveFilterData",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
"->",
"aActiveFilterData",
")",
")",
"{",
"$",
"aData",
"=",
"array",
"(",
"TdbPkgShopListfilterItem",
"::",
"URL_PARAMETER_FILTER_DATA",
"=>",
"array",
"(",
"$",
"this",
"->",
"id",
"=>",
"$",
"this",
"->",
"aActiveFilterData",
")",
")",
";",
"}",
"return",
"$",
"aData",
";",
"}"
] | return the settings as an array.
@return array | [
"return",
"the",
"settings",
"as",
"an",
"array",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopListFilterBundle/objects/db/TPkgShopListfilterItem.class.php#L145-L153 |
31,739 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/ReflectionHelper.php | ReflectionHelper.getEntityNamespaceRootFromEntityReflection | public function getEntityNamespaceRootFromEntityReflection(
ReflectionClass $entityReflection
): string {
return $this->namespaceHelper->tidy(
$this->namespaceHelper->getNamespaceRootToDirectoryFromFqn(
$entityReflection->getName(),
AbstractGenerator::ENTITIES_FOLDER_NAME
)
);
} | php | public function getEntityNamespaceRootFromEntityReflection(
ReflectionClass $entityReflection
): string {
return $this->namespaceHelper->tidy(
$this->namespaceHelper->getNamespaceRootToDirectoryFromFqn(
$entityReflection->getName(),
AbstractGenerator::ENTITIES_FOLDER_NAME
)
);
} | [
"public",
"function",
"getEntityNamespaceRootFromEntityReflection",
"(",
"ReflectionClass",
"$",
"entityReflection",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"namespaceHelper",
"->",
"tidy",
"(",
"$",
"this",
"->",
"namespaceHelper",
"->",
"getNamespaceRootToDirectoryFromFqn",
"(",
"$",
"entityReflection",
"->",
"getName",
"(",
")",
",",
"AbstractGenerator",
"::",
"ENTITIES_FOLDER_NAME",
")",
")",
";",
"}"
] | Work out the entity namespace root from a single entity reflection object.
@param ReflectionClass $entityReflection
@return string | [
"Work",
"out",
"the",
"entity",
"namespace",
"root",
"from",
"a",
"single",
"entity",
"reflection",
"object",
"."
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/ReflectionHelper.php#L49-L58 |
31,740 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/ReflectionHelper.php | ReflectionHelper.getMethodBody | public function getMethodBody(string $methodName, ReflectionClass $reflectionClass): string
{
$method = $reflectionClass->getMethod($methodName);
$startLine = $method->getStartLine() - 1;
$length = $method->getEndLine() - $startLine;
$lines = file($reflectionClass->getFileName());
$methodLines = \array_slice($lines, $startLine, $length);
return implode('', $methodLines);
} | php | public function getMethodBody(string $methodName, ReflectionClass $reflectionClass): string
{
$method = $reflectionClass->getMethod($methodName);
$startLine = $method->getStartLine() - 1;
$length = $method->getEndLine() - $startLine;
$lines = file($reflectionClass->getFileName());
$methodLines = \array_slice($lines, $startLine, $length);
return implode('', $methodLines);
} | [
"public",
"function",
"getMethodBody",
"(",
"string",
"$",
"methodName",
",",
"ReflectionClass",
"$",
"reflectionClass",
")",
":",
"string",
"{",
"$",
"method",
"=",
"$",
"reflectionClass",
"->",
"getMethod",
"(",
"$",
"methodName",
")",
";",
"$",
"startLine",
"=",
"$",
"method",
"->",
"getStartLine",
"(",
")",
"-",
"1",
";",
"$",
"length",
"=",
"$",
"method",
"->",
"getEndLine",
"(",
")",
"-",
"$",
"startLine",
";",
"$",
"lines",
"=",
"file",
"(",
"$",
"reflectionClass",
"->",
"getFileName",
"(",
")",
")",
";",
"$",
"methodLines",
"=",
"\\",
"array_slice",
"(",
"$",
"lines",
",",
"$",
"startLine",
",",
"$",
"length",
")",
";",
"return",
"implode",
"(",
"''",
",",
"$",
"methodLines",
")",
";",
"}"
] | Get the full method body using reflection
@param string $methodName
@param ReflectionClass $reflectionClass
@return string | [
"Get",
"the",
"full",
"method",
"body",
"using",
"reflection"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/ReflectionHelper.php#L141-L150 |
31,741 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Client.php | OffAmazonPaymentsNotifications_Client.parseRawMessage | public function parseRawMessage($headers, $body)
{
// Is this json, is this
// an sns message, do we have the fields we require
$snsMessage = SnsMessageParser::parseNotification($headers, $body);
// security validation - check that this message is
// from amazon and that it has been signed correctly
$this->_snsMessageValidator->validateMessage($snsMessage);
// Convert to object - convert from basic class to object
$ipnMessage = IpnNotificationParser::parseSnsMessage($snsMessage);
return XmlNotificationParser::parseIpnMessage($ipnMessage);
} | php | public function parseRawMessage($headers, $body)
{
// Is this json, is this
// an sns message, do we have the fields we require
$snsMessage = SnsMessageParser::parseNotification($headers, $body);
// security validation - check that this message is
// from amazon and that it has been signed correctly
$this->_snsMessageValidator->validateMessage($snsMessage);
// Convert to object - convert from basic class to object
$ipnMessage = IpnNotificationParser::parseSnsMessage($snsMessage);
return XmlNotificationParser::parseIpnMessage($ipnMessage);
} | [
"public",
"function",
"parseRawMessage",
"(",
"$",
"headers",
",",
"$",
"body",
")",
"{",
"// Is this json, is this",
"// an sns message, do we have the fields we require",
"$",
"snsMessage",
"=",
"SnsMessageParser",
"::",
"parseNotification",
"(",
"$",
"headers",
",",
"$",
"body",
")",
";",
"// security validation - check that this message is",
"// from amazon and that it has been signed correctly",
"$",
"this",
"->",
"_snsMessageValidator",
"->",
"validateMessage",
"(",
"$",
"snsMessage",
")",
";",
"// Convert to object - convert from basic class to object",
"$",
"ipnMessage",
"=",
"IpnNotificationParser",
"::",
"parseSnsMessage",
"(",
"$",
"snsMessage",
")",
";",
"return",
"XmlNotificationParser",
"::",
"parseIpnMessage",
"(",
"$",
"ipnMessage",
")",
";",
"}"
] | Converts a http POST body and headers into
a notification object
@param array $headers post request headers
@param string $body post request body, should be json
@throws OffAmazonPaymentsNotifications_InvalidMessageException
@return OffAmazonPaymentsNotifications_Notification | [
"Converts",
"a",
"http",
"POST",
"body",
"and",
"headers",
"into",
"a",
"notification",
"object"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Client.php#L90-L103 |
31,742 | comporu/compo-core | src/Compo/Sonata/SeoBundle/Block/Breadcrumb/BaseBreadcrumbMenuBlockService.php | BaseBreadcrumbMenuBlockService.getRootMenu | protected function getRootMenu(BlockContextInterface $blockContext)
{
$settings = $blockContext->getSettings();
$menu = $this->getFactory()->createItem('breadcrumb');
$menu->setChildrenAttribute('class', 'breadcrumb');
if (!$settings['current_uri']) {
$settings['current_uri'] = $this->getRequest()->getRequestUri();
}
if (method_exists($menu, 'setCurrentUri')) {
$menu->setCurrentUri($settings['current_uri']);
}
if (method_exists($menu, 'setCurrent')) {
$menu->setCurrent($settings['current_uri']);
}
$uri = $this->getContainer()->get('router')->generate(
'page_slug',
['path' => '/']
);
if ($settings['include_homepage_link']) {
$menu->addChild('sonata_seo_homepage_breadcrumb', ['uri' => $uri]);
}
return $menu;
} | php | protected function getRootMenu(BlockContextInterface $blockContext)
{
$settings = $blockContext->getSettings();
$menu = $this->getFactory()->createItem('breadcrumb');
$menu->setChildrenAttribute('class', 'breadcrumb');
if (!$settings['current_uri']) {
$settings['current_uri'] = $this->getRequest()->getRequestUri();
}
if (method_exists($menu, 'setCurrentUri')) {
$menu->setCurrentUri($settings['current_uri']);
}
if (method_exists($menu, 'setCurrent')) {
$menu->setCurrent($settings['current_uri']);
}
$uri = $this->getContainer()->get('router')->generate(
'page_slug',
['path' => '/']
);
if ($settings['include_homepage_link']) {
$menu->addChild('sonata_seo_homepage_breadcrumb', ['uri' => $uri]);
}
return $menu;
} | [
"protected",
"function",
"getRootMenu",
"(",
"BlockContextInterface",
"$",
"blockContext",
")",
"{",
"$",
"settings",
"=",
"$",
"blockContext",
"->",
"getSettings",
"(",
")",
";",
"$",
"menu",
"=",
"$",
"this",
"->",
"getFactory",
"(",
")",
"->",
"createItem",
"(",
"'breadcrumb'",
")",
";",
"$",
"menu",
"->",
"setChildrenAttribute",
"(",
"'class'",
",",
"'breadcrumb'",
")",
";",
"if",
"(",
"!",
"$",
"settings",
"[",
"'current_uri'",
"]",
")",
"{",
"$",
"settings",
"[",
"'current_uri'",
"]",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getRequestUri",
"(",
")",
";",
"}",
"if",
"(",
"method_exists",
"(",
"$",
"menu",
",",
"'setCurrentUri'",
")",
")",
"{",
"$",
"menu",
"->",
"setCurrentUri",
"(",
"$",
"settings",
"[",
"'current_uri'",
"]",
")",
";",
"}",
"if",
"(",
"method_exists",
"(",
"$",
"menu",
",",
"'setCurrent'",
")",
")",
"{",
"$",
"menu",
"->",
"setCurrent",
"(",
"$",
"settings",
"[",
"'current_uri'",
"]",
")",
";",
"}",
"$",
"uri",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'router'",
")",
"->",
"generate",
"(",
"'page_slug'",
",",
"[",
"'path'",
"=>",
"'/'",
"]",
")",
";",
"if",
"(",
"$",
"settings",
"[",
"'include_homepage_link'",
"]",
")",
"{",
"$",
"menu",
"->",
"addChild",
"(",
"'sonata_seo_homepage_breadcrumb'",
",",
"[",
"'uri'",
"=>",
"$",
"uri",
"]",
")",
";",
"}",
"return",
"$",
"menu",
";",
"}"
] | Initialize breadcrumb menu.
@param BlockContextInterface $blockContext
@return \Knp\Menu\ItemInterface | [
"Initialize",
"breadcrumb",
"menu",
"."
] | ebaa9fe8a4b831506c78fdf637da6b4deadec1e2 | https://github.com/comporu/compo-core/blob/ebaa9fe8a4b831506c78fdf637da6b4deadec1e2/src/Compo/Sonata/SeoBundle/Block/Breadcrumb/BaseBreadcrumbMenuBlockService.php#L55-L85 |
31,743 | Erebot/Erebot | src/LineIO.php | LineIO.setSocket | public function setSocket($socket)
{
$this->socket = $socket;
$this->incomingData = "";
$this->rcvQueue = array();
$this->sndQueue = array();
} | php | public function setSocket($socket)
{
$this->socket = $socket;
$this->incomingData = "";
$this->rcvQueue = array();
$this->sndQueue = array();
} | [
"public",
"function",
"setSocket",
"(",
"$",
"socket",
")",
"{",
"$",
"this",
"->",
"socket",
"=",
"$",
"socket",
";",
"$",
"this",
"->",
"incomingData",
"=",
"\"\"",
";",
"$",
"this",
"->",
"rcvQueue",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"sndQueue",
"=",
"array",
"(",
")",
";",
"}"
] | Sets the socket this line reader operates on.
\param resource $socket
The socket this reader will use from now on. | [
"Sets",
"the",
"socket",
"this",
"line",
"reader",
"operates",
"on",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/LineIO.php#L97-L103 |
31,744 | Erebot/Erebot | src/LineIO.php | LineIO.getLine | protected function getLine()
{
$pos = false;
foreach ($this->eol as $eol) {
$pos = strpos($this->incomingData, $eol);
if ($pos !== false) {
break;
}
}
if ($pos === false) {
return false;
}
$len = strlen($eol);
$line = \Erebot\Utils::toUTF8(substr($this->incomingData, 0, $pos));
$this->incomingData = substr($this->incomingData, $pos + $len);
$this->rcvQueue[] = $line;
$logger = \Plop\Plop::getInstance();
$logger->debug(
'%(line)s',
array('line' => addcslashes($line, "\000..\037"))
);
return true;
} | php | protected function getLine()
{
$pos = false;
foreach ($this->eol as $eol) {
$pos = strpos($this->incomingData, $eol);
if ($pos !== false) {
break;
}
}
if ($pos === false) {
return false;
}
$len = strlen($eol);
$line = \Erebot\Utils::toUTF8(substr($this->incomingData, 0, $pos));
$this->incomingData = substr($this->incomingData, $pos + $len);
$this->rcvQueue[] = $line;
$logger = \Plop\Plop::getInstance();
$logger->debug(
'%(line)s',
array('line' => addcslashes($line, "\000..\037"))
);
return true;
} | [
"protected",
"function",
"getLine",
"(",
")",
"{",
"$",
"pos",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"eol",
"as",
"$",
"eol",
")",
"{",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"this",
"->",
"incomingData",
",",
"$",
"eol",
")",
";",
"if",
"(",
"$",
"pos",
"!==",
"false",
")",
"{",
"break",
";",
"}",
"}",
"if",
"(",
"$",
"pos",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"len",
"=",
"strlen",
"(",
"$",
"eol",
")",
";",
"$",
"line",
"=",
"\\",
"Erebot",
"\\",
"Utils",
"::",
"toUTF8",
"(",
"substr",
"(",
"$",
"this",
"->",
"incomingData",
",",
"0",
",",
"$",
"pos",
")",
")",
";",
"$",
"this",
"->",
"incomingData",
"=",
"substr",
"(",
"$",
"this",
"->",
"incomingData",
",",
"$",
"pos",
"+",
"$",
"len",
")",
";",
"$",
"this",
"->",
"rcvQueue",
"[",
"]",
"=",
"$",
"line",
";",
"$",
"logger",
"=",
"\\",
"Plop",
"\\",
"Plop",
"::",
"getInstance",
"(",
")",
";",
"$",
"logger",
"->",
"debug",
"(",
"'%(line)s'",
",",
"array",
"(",
"'line'",
"=>",
"addcslashes",
"(",
"$",
"line",
",",
"\"\\000..\\037\"",
")",
")",
")",
";",
"return",
"true",
";",
"}"
] | Retrieves a single line of text from the incoming buffer
and puts it in the incoming FIFO.
\retval true
Whether a line could be fetched from the buffer.
\retval false
... or not.
\note
Lines fetched by this method are always UTF-8 encoded. | [
"Retrieves",
"a",
"single",
"line",
"of",
"text",
"from",
"the",
"incoming",
"buffer",
"and",
"puts",
"it",
"in",
"the",
"incoming",
"FIFO",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/LineIO.php#L175-L199 |
31,745 | Erebot/Erebot | src/LineIO.php | LineIO.read | public function read()
{
if ($this->socket === null) {
return false;
}
if (feof($this->socket)) {
return false;
}
$received = fread($this->socket, 4096);
if ($received === false) {
return false;
}
$this->incomingData .= $received;
// Workaround for issue #8.
$metadata = stream_get_meta_data($this->socket);
if ($metadata['stream_type'] == 'tcp_socket/ssl' && !feof($this->socket)) {
$blocking = (int) $metadata['blocked'];
stream_set_blocking($this->socket, 0);
$received = fread($this->socket, 4096);
stream_set_blocking($this->socket, $blocking);
if ($received !== false) {
$this->incomingData .= $received;
}
}
// Read all messages currently in the input buffer.
while ($this->getLine()) {
; // Nothing more to do.
}
return true;
} | php | public function read()
{
if ($this->socket === null) {
return false;
}
if (feof($this->socket)) {
return false;
}
$received = fread($this->socket, 4096);
if ($received === false) {
return false;
}
$this->incomingData .= $received;
// Workaround for issue #8.
$metadata = stream_get_meta_data($this->socket);
if ($metadata['stream_type'] == 'tcp_socket/ssl' && !feof($this->socket)) {
$blocking = (int) $metadata['blocked'];
stream_set_blocking($this->socket, 0);
$received = fread($this->socket, 4096);
stream_set_blocking($this->socket, $blocking);
if ($received !== false) {
$this->incomingData .= $received;
}
}
// Read all messages currently in the input buffer.
while ($this->getLine()) {
; // Nothing more to do.
}
return true;
} | [
"public",
"function",
"read",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"socket",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"feof",
"(",
"$",
"this",
"->",
"socket",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"received",
"=",
"fread",
"(",
"$",
"this",
"->",
"socket",
",",
"4096",
")",
";",
"if",
"(",
"$",
"received",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"incomingData",
".=",
"$",
"received",
";",
"// Workaround for issue #8.",
"$",
"metadata",
"=",
"stream_get_meta_data",
"(",
"$",
"this",
"->",
"socket",
")",
";",
"if",
"(",
"$",
"metadata",
"[",
"'stream_type'",
"]",
"==",
"'tcp_socket/ssl'",
"&&",
"!",
"feof",
"(",
"$",
"this",
"->",
"socket",
")",
")",
"{",
"$",
"blocking",
"=",
"(",
"int",
")",
"$",
"metadata",
"[",
"'blocked'",
"]",
";",
"stream_set_blocking",
"(",
"$",
"this",
"->",
"socket",
",",
"0",
")",
";",
"$",
"received",
"=",
"fread",
"(",
"$",
"this",
"->",
"socket",
",",
"4096",
")",
";",
"stream_set_blocking",
"(",
"$",
"this",
"->",
"socket",
",",
"$",
"blocking",
")",
";",
"if",
"(",
"$",
"received",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"incomingData",
".=",
"$",
"received",
";",
"}",
"}",
"// Read all messages currently in the input buffer.",
"while",
"(",
"$",
"this",
"->",
"getLine",
"(",
")",
")",
"{",
";",
"// Nothing more to do.",
"}",
"return",
"true",
";",
"}"
] | Reads as many lines from the socket
as possible.
\retval bool
\b true if lines were successfully read,
\b false is returned whenever EOF is reached
or if this method has been called while
the socket was still uninitialized..
\note
This method blocks until lines have
been read of EOF is reached (whichever
comes first). | [
"Reads",
"as",
"many",
"lines",
"from",
"the",
"socket",
"as",
"possible",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/LineIO.php#L216-L250 |
31,746 | Erebot/Erebot | src/LineIO.php | LineIO.push | public function push($line)
{
if ($this->socket === null) {
throw new \Erebot\IllegalActionException('Uninitialized socket');
}
if (strcspn($line, "\r\n") != strlen($line)) {
throw new \Erebot\InvalidValueException(
'Line contains forbidden characters'
);
}
$this->sndQueue[] = $line;
} | php | public function push($line)
{
if ($this->socket === null) {
throw new \Erebot\IllegalActionException('Uninitialized socket');
}
if (strcspn($line, "\r\n") != strlen($line)) {
throw new \Erebot\InvalidValueException(
'Line contains forbidden characters'
);
}
$this->sndQueue[] = $line;
} | [
"public",
"function",
"push",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"socket",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"IllegalActionException",
"(",
"'Uninitialized socket'",
")",
";",
"}",
"if",
"(",
"strcspn",
"(",
"$",
"line",
",",
"\"\\r\\n\"",
")",
"!=",
"strlen",
"(",
"$",
"line",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"InvalidValueException",
"(",
"'Line contains forbidden characters'",
")",
";",
"}",
"$",
"this",
"->",
"sndQueue",
"[",
"]",
"=",
"$",
"line",
";",
"}"
] | Adds a given line to the outgoing FIFO.
\param string $line
The line of text to send.
\throw Erebot::InvalidValueException
The $line contains invalid characters. | [
"Adds",
"a",
"given",
"line",
"to",
"the",
"outgoing",
"FIFO",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/LineIO.php#L279-L291 |
31,747 | Erebot/Erebot | src/LineIO.php | LineIO.write | public function write()
{
if (!count($this->sndQueue)) {
return false;
}
$line = array_shift($this->sndQueue);
$logger = \Plop\Plop::getInstance();
// Make sure we send the whole line,
// with a trailing CR LF sequence.
$eol = $this->eol[count($this->eol) - 1];
$line .= $eol;
$len = strlen($line);
for ($written = 0; $written < $len; $written += $fwrite) {
$fwrite = @fwrite($this->socket, substr($line, $written));
if ($fwrite === false) {
return false;
}
}
$line = substr($line, 0, -strlen($eol));
$logger->debug(
'%(line)s',
array('line' => addcslashes($line, "\000..\037"))
);
return $written;
} | php | public function write()
{
if (!count($this->sndQueue)) {
return false;
}
$line = array_shift($this->sndQueue);
$logger = \Plop\Plop::getInstance();
// Make sure we send the whole line,
// with a trailing CR LF sequence.
$eol = $this->eol[count($this->eol) - 1];
$line .= $eol;
$len = strlen($line);
for ($written = 0; $written < $len; $written += $fwrite) {
$fwrite = @fwrite($this->socket, substr($line, $written));
if ($fwrite === false) {
return false;
}
}
$line = substr($line, 0, -strlen($eol));
$logger->debug(
'%(line)s',
array('line' => addcslashes($line, "\000..\037"))
);
return $written;
} | [
"public",
"function",
"write",
"(",
")",
"{",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"sndQueue",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"line",
"=",
"array_shift",
"(",
"$",
"this",
"->",
"sndQueue",
")",
";",
"$",
"logger",
"=",
"\\",
"Plop",
"\\",
"Plop",
"::",
"getInstance",
"(",
")",
";",
"// Make sure we send the whole line,",
"// with a trailing CR LF sequence.",
"$",
"eol",
"=",
"$",
"this",
"->",
"eol",
"[",
"count",
"(",
"$",
"this",
"->",
"eol",
")",
"-",
"1",
"]",
";",
"$",
"line",
".=",
"$",
"eol",
";",
"$",
"len",
"=",
"strlen",
"(",
"$",
"line",
")",
";",
"for",
"(",
"$",
"written",
"=",
"0",
";",
"$",
"written",
"<",
"$",
"len",
";",
"$",
"written",
"+=",
"$",
"fwrite",
")",
"{",
"$",
"fwrite",
"=",
"@",
"fwrite",
"(",
"$",
"this",
"->",
"socket",
",",
"substr",
"(",
"$",
"line",
",",
"$",
"written",
")",
")",
";",
"if",
"(",
"$",
"fwrite",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"}",
"$",
"line",
"=",
"substr",
"(",
"$",
"line",
",",
"0",
",",
"-",
"strlen",
"(",
"$",
"eol",
")",
")",
";",
"$",
"logger",
"->",
"debug",
"(",
"'%(line)s'",
",",
"array",
"(",
"'line'",
"=>",
"addcslashes",
"(",
"$",
"line",
",",
"\"\\000..\\037\"",
")",
")",
")",
";",
"return",
"$",
"written",
";",
"}"
] | Writes a single line from the output buffer
to the socket.
\retval int
The number of bytes successfully
written on the socket.
\retval false
The connection was lost while trying
to send the line or the output buffer
was empty. | [
"Writes",
"a",
"single",
"line",
"from",
"the",
"output",
"buffer",
"to",
"the",
"socket",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/LineIO.php#L306-L332 |
31,748 | chameleon-system/chameleon-shop | src/ShopRatingService/Util/CacheUtil.php | CacheUtil.getCacheDirectory | public function getCacheDirectory()
{
$dir = $this->cacheBaseDir.'/RatingServicesCache/';
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
if (!file_exists($dir)) {
$dir = null;
}
}
if (!is_dir($dir) || !is_writable($dir)) {
$dir = null;
}
return $dir;
} | php | public function getCacheDirectory()
{
$dir = $this->cacheBaseDir.'/RatingServicesCache/';
if (!file_exists($dir)) {
mkdir($dir, 0777, true);
if (!file_exists($dir)) {
$dir = null;
}
}
if (!is_dir($dir) || !is_writable($dir)) {
$dir = null;
}
return $dir;
} | [
"public",
"function",
"getCacheDirectory",
"(",
")",
"{",
"$",
"dir",
"=",
"$",
"this",
"->",
"cacheBaseDir",
".",
"'/RatingServicesCache/'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"dir",
")",
")",
"{",
"mkdir",
"(",
"$",
"dir",
",",
"0777",
",",
"true",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"dir",
")",
")",
"{",
"$",
"dir",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"dir",
")",
"||",
"!",
"is_writable",
"(",
"$",
"dir",
")",
")",
"{",
"$",
"dir",
"=",
"null",
";",
"}",
"return",
"$",
"dir",
";",
"}"
] | Returns the cache directory used for downloads.
@return string|null null if the directory could not be created or is not writable | [
"Returns",
"the",
"cache",
"directory",
"used",
"for",
"downloads",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopRatingService/Util/CacheUtil.php#L34-L48 |
31,749 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Filesystem/File/Writer.php | Writer.write | public function write(File $file): string
{
$this->createDirectoryIfRequired($file);
$file->create();
$file->putContents();
return $file->getPath();
} | php | public function write(File $file): string
{
$this->createDirectoryIfRequired($file);
$file->create();
$file->putContents();
return $file->getPath();
} | [
"public",
"function",
"write",
"(",
"File",
"$",
"file",
")",
":",
"string",
"{",
"$",
"this",
"->",
"createDirectoryIfRequired",
"(",
"$",
"file",
")",
";",
"$",
"file",
"->",
"create",
"(",
")",
";",
"$",
"file",
"->",
"putContents",
"(",
")",
";",
"return",
"$",
"file",
"->",
"getPath",
"(",
")",
";",
"}"
] | Write a file object to the filesystem and return the created path
@param File $file
@return string
@throws \EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException | [
"Write",
"a",
"file",
"object",
"to",
"the",
"filesystem",
"and",
"return",
"the",
"created",
"path"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Filesystem/File/Writer.php#L17-L24 |
31,750 | chameleon-system/chameleon-shop | src/ShopArticleReviewBundle/objects/db/TPkgShopArticleReviewShopArticleReviewList.class.php | TPkgShopArticleReviewShopArticleReviewList.GetReviewsForArticleSortedByRate | public static function GetReviewsForArticleSortedByRate($iShopArticleId)
{
$sQuery = "SELECT * FROM `shop_article_review`
WHERE `shop_article_review`.`shop_article_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopArticleId)."'
AND `shop_article_review`.`publish` = '1'
ORDER BY `shop_article_review`.`helpful_count` DESC , `shop_article_review`.`datecreated` DESC";
$oList = &TdbShopArticleReviewList::GetList($sQuery);
return $oList;
} | php | public static function GetReviewsForArticleSortedByRate($iShopArticleId)
{
$sQuery = "SELECT * FROM `shop_article_review`
WHERE `shop_article_review`.`shop_article_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($iShopArticleId)."'
AND `shop_article_review`.`publish` = '1'
ORDER BY `shop_article_review`.`helpful_count` DESC , `shop_article_review`.`datecreated` DESC";
$oList = &TdbShopArticleReviewList::GetList($sQuery);
return $oList;
} | [
"public",
"static",
"function",
"GetReviewsForArticleSortedByRate",
"(",
"$",
"iShopArticleId",
")",
"{",
"$",
"sQuery",
"=",
"\"SELECT * FROM `shop_article_review`\n WHERE `shop_article_review`.`shop_article_id` = '\"",
".",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"iShopArticleId",
")",
".",
"\"'\n AND `shop_article_review`.`publish` = '1'\n ORDER BY `shop_article_review`.`helpful_count` DESC , `shop_article_review`.`datecreated` DESC\"",
";",
"$",
"oList",
"=",
"&",
"TdbShopArticleReviewList",
"::",
"GetList",
"(",
"$",
"sQuery",
")",
";",
"return",
"$",
"oList",
";",
"}"
] | Get reviews for aarticel sorted by positive rate.
@param $iShopArticleId
@return TdbShopArticleReviewList | [
"Get",
"reviews",
"for",
"aarticel",
"sorted",
"by",
"positive",
"rate",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopArticleReviewBundle/objects/db/TPkgShopArticleReviewShopArticleReviewList.class.php#L21-L30 |
31,751 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerOgone.class.php | TShopPaymentHandlerOgone.GetExternalPaymentHandlerURL | protected function GetExternalPaymentHandlerURL(TdbShopOrder $oOrder)
{
$oUser = TdbDataExtranetUser::GetInstance();
$oCountry = $oUser->GetCountry();
$sActiveFrontEndLanguageCode = self::getLanguageService()->getLanguageIsoCode();
$aParameter = array(
'PSPID' => $this->GetPSPID(),
'ORDERID' => $oOrder->fieldOrdernumber,
'AMOUNT' => $oOrder->fieldValueTotal * 100,
'CURRENCY' => $this->GetCurrency(),
'LANGUAGE' => strtolower($sActiveFrontEndLanguageCode).'_'.strtoupper($sActiveFrontEndLanguageCode),
'CN' => $oUser->fieldFirstname.' '.$oUser->fieldLastname,
'EMAIL' => $oUser->fieldName,
'OWNERADDRESS' => $oUser->fieldStreet.' '.$oUser->fieldStreetnr,
'OWNERCTY' => $oCountry->fieldName,
'OWNERTOWN' => $oUser->fieldCity,
'OWNERZIP' => $oUser->fieldPostalcode,
'PARAMPLUS' => 'PAYCALL='.self::URL_IDENTIFIER.'&PAYHAID='.$this->sqlData['cmsident'], 'PARAMVAR' => self::URL_IDENTIFIER_NOTIFY, );
$this->AddCustomParameter($aParameter);
$sOgonePaymentLayoutPageURL = $this->GetOgonePaymentLayoutPage();
if ($sOgonePaymentLayoutPageURL) {
$aParameter['TP'] = $sOgonePaymentLayoutPageURL;
}
$aParameter['ACCEPTURL'] = $this->GetResponseURL('success');
$aParameter['DECLINEURL'] = $this->GetResponseURL('decline');
$aParameter['SHASIGN'] = $this->BuildOutgoingHash($aParameter);
$sExternalHandlerURL = $this->GetPaymentURL().'?'.str_replace('&', '&', TTools::GetArrayAsURL($aParameter));
return $sExternalHandlerURL;
} | php | protected function GetExternalPaymentHandlerURL(TdbShopOrder $oOrder)
{
$oUser = TdbDataExtranetUser::GetInstance();
$oCountry = $oUser->GetCountry();
$sActiveFrontEndLanguageCode = self::getLanguageService()->getLanguageIsoCode();
$aParameter = array(
'PSPID' => $this->GetPSPID(),
'ORDERID' => $oOrder->fieldOrdernumber,
'AMOUNT' => $oOrder->fieldValueTotal * 100,
'CURRENCY' => $this->GetCurrency(),
'LANGUAGE' => strtolower($sActiveFrontEndLanguageCode).'_'.strtoupper($sActiveFrontEndLanguageCode),
'CN' => $oUser->fieldFirstname.' '.$oUser->fieldLastname,
'EMAIL' => $oUser->fieldName,
'OWNERADDRESS' => $oUser->fieldStreet.' '.$oUser->fieldStreetnr,
'OWNERCTY' => $oCountry->fieldName,
'OWNERTOWN' => $oUser->fieldCity,
'OWNERZIP' => $oUser->fieldPostalcode,
'PARAMPLUS' => 'PAYCALL='.self::URL_IDENTIFIER.'&PAYHAID='.$this->sqlData['cmsident'], 'PARAMVAR' => self::URL_IDENTIFIER_NOTIFY, );
$this->AddCustomParameter($aParameter);
$sOgonePaymentLayoutPageURL = $this->GetOgonePaymentLayoutPage();
if ($sOgonePaymentLayoutPageURL) {
$aParameter['TP'] = $sOgonePaymentLayoutPageURL;
}
$aParameter['ACCEPTURL'] = $this->GetResponseURL('success');
$aParameter['DECLINEURL'] = $this->GetResponseURL('decline');
$aParameter['SHASIGN'] = $this->BuildOutgoingHash($aParameter);
$sExternalHandlerURL = $this->GetPaymentURL().'?'.str_replace('&', '&', TTools::GetArrayAsURL($aParameter));
return $sExternalHandlerURL;
} | [
"protected",
"function",
"GetExternalPaymentHandlerURL",
"(",
"TdbShopOrder",
"$",
"oOrder",
")",
"{",
"$",
"oUser",
"=",
"TdbDataExtranetUser",
"::",
"GetInstance",
"(",
")",
";",
"$",
"oCountry",
"=",
"$",
"oUser",
"->",
"GetCountry",
"(",
")",
";",
"$",
"sActiveFrontEndLanguageCode",
"=",
"self",
"::",
"getLanguageService",
"(",
")",
"->",
"getLanguageIsoCode",
"(",
")",
";",
"$",
"aParameter",
"=",
"array",
"(",
"'PSPID'",
"=>",
"$",
"this",
"->",
"GetPSPID",
"(",
")",
",",
"'ORDERID'",
"=>",
"$",
"oOrder",
"->",
"fieldOrdernumber",
",",
"'AMOUNT'",
"=>",
"$",
"oOrder",
"->",
"fieldValueTotal",
"*",
"100",
",",
"'CURRENCY'",
"=>",
"$",
"this",
"->",
"GetCurrency",
"(",
")",
",",
"'LANGUAGE'",
"=>",
"strtolower",
"(",
"$",
"sActiveFrontEndLanguageCode",
")",
".",
"'_'",
".",
"strtoupper",
"(",
"$",
"sActiveFrontEndLanguageCode",
")",
",",
"'CN'",
"=>",
"$",
"oUser",
"->",
"fieldFirstname",
".",
"' '",
".",
"$",
"oUser",
"->",
"fieldLastname",
",",
"'EMAIL'",
"=>",
"$",
"oUser",
"->",
"fieldName",
",",
"'OWNERADDRESS'",
"=>",
"$",
"oUser",
"->",
"fieldStreet",
".",
"' '",
".",
"$",
"oUser",
"->",
"fieldStreetnr",
",",
"'OWNERCTY'",
"=>",
"$",
"oCountry",
"->",
"fieldName",
",",
"'OWNERTOWN'",
"=>",
"$",
"oUser",
"->",
"fieldCity",
",",
"'OWNERZIP'",
"=>",
"$",
"oUser",
"->",
"fieldPostalcode",
",",
"'PARAMPLUS'",
"=>",
"'PAYCALL='",
".",
"self",
"::",
"URL_IDENTIFIER",
".",
"'&PAYHAID='",
".",
"$",
"this",
"->",
"sqlData",
"[",
"'cmsident'",
"]",
",",
"'PARAMVAR'",
"=>",
"self",
"::",
"URL_IDENTIFIER_NOTIFY",
",",
")",
";",
"$",
"this",
"->",
"AddCustomParameter",
"(",
"$",
"aParameter",
")",
";",
"$",
"sOgonePaymentLayoutPageURL",
"=",
"$",
"this",
"->",
"GetOgonePaymentLayoutPage",
"(",
")",
";",
"if",
"(",
"$",
"sOgonePaymentLayoutPageURL",
")",
"{",
"$",
"aParameter",
"[",
"'TP'",
"]",
"=",
"$",
"sOgonePaymentLayoutPageURL",
";",
"}",
"$",
"aParameter",
"[",
"'ACCEPTURL'",
"]",
"=",
"$",
"this",
"->",
"GetResponseURL",
"(",
"'success'",
")",
";",
"$",
"aParameter",
"[",
"'DECLINEURL'",
"]",
"=",
"$",
"this",
"->",
"GetResponseURL",
"(",
"'decline'",
")",
";",
"$",
"aParameter",
"[",
"'SHASIGN'",
"]",
"=",
"$",
"this",
"->",
"BuildOutgoingHash",
"(",
"$",
"aParameter",
")",
";",
"$",
"sExternalHandlerURL",
"=",
"$",
"this",
"->",
"GetPaymentURL",
"(",
")",
".",
"'?'",
".",
"str_replace",
"(",
"'&'",
",",
"'&'",
",",
"TTools",
"::",
"GetArrayAsURL",
"(",
"$",
"aParameter",
")",
")",
";",
"return",
"$",
"sExternalHandlerURL",
";",
"}"
] | return url to ogone payment service with all needed parameter.
@param TdbShopOrder $oOrder
@return string | [
"return",
"url",
"to",
"ogone",
"payment",
"service",
"with",
"all",
"needed",
"parameter",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerOgone.class.php#L50-L79 |
31,752 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerOgone.class.php | TShopPaymentHandlerOgone.GetPSPID | protected function GetPSPID()
{
if (IPkgShopOrderPaymentConfig::ENVIRONMENT_PRODUCTION === $this->getEnvironment()) {
$sPSPID = $this->GetConfigParameter('user_id');
} else {
$sPSPID = $this->GetConfigParameter('user_id_test');
}
return $sPSPID;
} | php | protected function GetPSPID()
{
if (IPkgShopOrderPaymentConfig::ENVIRONMENT_PRODUCTION === $this->getEnvironment()) {
$sPSPID = $this->GetConfigParameter('user_id');
} else {
$sPSPID = $this->GetConfigParameter('user_id_test');
}
return $sPSPID;
} | [
"protected",
"function",
"GetPSPID",
"(",
")",
"{",
"if",
"(",
"IPkgShopOrderPaymentConfig",
"::",
"ENVIRONMENT_PRODUCTION",
"===",
"$",
"this",
"->",
"getEnvironment",
"(",
")",
")",
"{",
"$",
"sPSPID",
"=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'user_id'",
")",
";",
"}",
"else",
"{",
"$",
"sPSPID",
"=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'user_id_test'",
")",
";",
"}",
"return",
"$",
"sPSPID",
";",
"}"
] | Returns the PSPID for test or live modus.
@return string | [
"Returns",
"the",
"PSPID",
"for",
"test",
"or",
"live",
"modus",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerOgone.class.php#L90-L99 |
31,753 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerOgone.class.php | TShopPaymentHandlerOgone.GetOgonePaymentLayoutPage | protected function GetOgonePaymentLayoutPage()
{
$sOgonePaymentLayoutSystemPage = trim($this->GetConfigParameter('layout_system_page'));
$sOgonePaymentLayoutPageURL = false;
if (!empty($sOgonePaymentLayoutSystemPage)) {
$oShop = TdbShop::GetInstance();
$sOgonePaymentLayoutPageURL = $oShop->GetLinkToSystemPage($sOgonePaymentLayoutSystemPage, null, true);
$sOgonePaymentLayoutPageURL = str_replace('https://', '', $sOgonePaymentLayoutPageURL);
$sOgonePaymentLayoutPageURL = str_replace('http://', '', $sOgonePaymentLayoutPageURL);
$sOgonePaymentLayoutPageURL = 'https://'.$sOgonePaymentLayoutPageURL;
}
return $sOgonePaymentLayoutPageURL;
} | php | protected function GetOgonePaymentLayoutPage()
{
$sOgonePaymentLayoutSystemPage = trim($this->GetConfigParameter('layout_system_page'));
$sOgonePaymentLayoutPageURL = false;
if (!empty($sOgonePaymentLayoutSystemPage)) {
$oShop = TdbShop::GetInstance();
$sOgonePaymentLayoutPageURL = $oShop->GetLinkToSystemPage($sOgonePaymentLayoutSystemPage, null, true);
$sOgonePaymentLayoutPageURL = str_replace('https://', '', $sOgonePaymentLayoutPageURL);
$sOgonePaymentLayoutPageURL = str_replace('http://', '', $sOgonePaymentLayoutPageURL);
$sOgonePaymentLayoutPageURL = 'https://'.$sOgonePaymentLayoutPageURL;
}
return $sOgonePaymentLayoutPageURL;
} | [
"protected",
"function",
"GetOgonePaymentLayoutPage",
"(",
")",
"{",
"$",
"sOgonePaymentLayoutSystemPage",
"=",
"trim",
"(",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'layout_system_page'",
")",
")",
";",
"$",
"sOgonePaymentLayoutPageURL",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"sOgonePaymentLayoutSystemPage",
")",
")",
"{",
"$",
"oShop",
"=",
"TdbShop",
"::",
"GetInstance",
"(",
")",
";",
"$",
"sOgonePaymentLayoutPageURL",
"=",
"$",
"oShop",
"->",
"GetLinkToSystemPage",
"(",
"$",
"sOgonePaymentLayoutSystemPage",
",",
"null",
",",
"true",
")",
";",
"$",
"sOgonePaymentLayoutPageURL",
"=",
"str_replace",
"(",
"'https://'",
",",
"''",
",",
"$",
"sOgonePaymentLayoutPageURL",
")",
";",
"$",
"sOgonePaymentLayoutPageURL",
"=",
"str_replace",
"(",
"'http://'",
",",
"''",
",",
"$",
"sOgonePaymentLayoutPageURL",
")",
";",
"$",
"sOgonePaymentLayoutPageURL",
"=",
"'https://'",
".",
"$",
"sOgonePaymentLayoutPageURL",
";",
"}",
"return",
"$",
"sOgonePaymentLayoutPageURL",
";",
"}"
] | Get the URL to the payment layout.
Return false if not configured.
@return bool|mixed|string | [
"Get",
"the",
"URL",
"to",
"the",
"payment",
"layout",
".",
"Return",
"false",
"if",
"not",
"configured",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerOgone.class.php#L107-L120 |
31,754 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Filesystem/File.php | File.getSplFileObject | public function getSplFileObject(): \SplFileObject
{
$this->assertExists();
if (null !== $this->splFileObject && $this->path === $this->splFileObject->getRealPath()) {
return $this->splFileObject;
}
$this->splFileObject = new \SplFileObject($this->path);
return $this->splFileObject;
} | php | public function getSplFileObject(): \SplFileObject
{
$this->assertExists();
if (null !== $this->splFileObject && $this->path === $this->splFileObject->getRealPath()) {
return $this->splFileObject;
}
$this->splFileObject = new \SplFileObject($this->path);
return $this->splFileObject;
} | [
"public",
"function",
"getSplFileObject",
"(",
")",
":",
"\\",
"SplFileObject",
"{",
"$",
"this",
"->",
"assertExists",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"splFileObject",
"&&",
"$",
"this",
"->",
"path",
"===",
"$",
"this",
"->",
"splFileObject",
"->",
"getRealPath",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"splFileObject",
";",
"}",
"$",
"this",
"->",
"splFileObject",
"=",
"new",
"\\",
"SplFileObject",
"(",
"$",
"this",
"->",
"path",
")",
";",
"return",
"$",
"this",
"->",
"splFileObject",
";",
"}"
] | Provide an SplFileObject object, asserting that the path exists
@return \SplFileObject
@throws \EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException | [
"Provide",
"an",
"SplFileObject",
"object",
"asserting",
"that",
"the",
"path",
"exists"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Filesystem/File.php#L105-L114 |
31,755 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php | MTShopOrderHistory.getOrderList | protected function getOrderList(TdbShopOrderList $oOrderList, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager)
{
$aOrderList = array();
while ($oOrder = &$oOrderList->Next()) {
if ($bCachingEnabled) {
$oCacheTriggerManager->addTrigger($oOrder->table, $oOrder->id);
}
$aOrder = $this->getOrder($oOrder, $bCachingEnabled, $oCacheTriggerManager);
$aOrder['bActive'] = $this->showDetail($oOrder);
$aOrderList[] = $aOrder;
}
return $aOrderList;
} | php | protected function getOrderList(TdbShopOrderList $oOrderList, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager)
{
$aOrderList = array();
while ($oOrder = &$oOrderList->Next()) {
if ($bCachingEnabled) {
$oCacheTriggerManager->addTrigger($oOrder->table, $oOrder->id);
}
$aOrder = $this->getOrder($oOrder, $bCachingEnabled, $oCacheTriggerManager);
$aOrder['bActive'] = $this->showDetail($oOrder);
$aOrderList[] = $aOrder;
}
return $aOrderList;
} | [
"protected",
"function",
"getOrderList",
"(",
"TdbShopOrderList",
"$",
"oOrderList",
",",
"$",
"bCachingEnabled",
",",
"IMapperCacheTriggerRestricted",
"$",
"oCacheTriggerManager",
")",
"{",
"$",
"aOrderList",
"=",
"array",
"(",
")",
";",
"while",
"(",
"$",
"oOrder",
"=",
"&",
"$",
"oOrderList",
"->",
"Next",
"(",
")",
")",
"{",
"if",
"(",
"$",
"bCachingEnabled",
")",
"{",
"$",
"oCacheTriggerManager",
"->",
"addTrigger",
"(",
"$",
"oOrder",
"->",
"table",
",",
"$",
"oOrder",
"->",
"id",
")",
";",
"}",
"$",
"aOrder",
"=",
"$",
"this",
"->",
"getOrder",
"(",
"$",
"oOrder",
",",
"$",
"bCachingEnabled",
",",
"$",
"oCacheTriggerManager",
")",
";",
"$",
"aOrder",
"[",
"'bActive'",
"]",
"=",
"$",
"this",
"->",
"showDetail",
"(",
"$",
"oOrder",
")",
";",
"$",
"aOrderList",
"[",
"]",
"=",
"$",
"aOrder",
";",
"}",
"return",
"$",
"aOrderList",
";",
"}"
] | get the value list for the whole order list.
@param TdbShopOrderList $oOrderList
@param bool $bCachingEnabled
@param IMapperCacheTriggerRestricted $oCacheTriggerManager
@return array | [
"get",
"the",
"value",
"list",
"for",
"the",
"whole",
"order",
"list",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php#L46-L59 |
31,756 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php | MTShopOrderHistory.GetActiveOrderRequest | protected function GetActiveOrderRequest()
{
$sActiveOrderParameter = false;
$oGlobal = TGlobal::instance();
if ($oGlobal->UserDataExists($this->getActiveOrderParameter())) {
$sActiveOrderParameter = $oGlobal->GetUserData($this->getActiveOrderParameter());
}
return $sActiveOrderParameter;
} | php | protected function GetActiveOrderRequest()
{
$sActiveOrderParameter = false;
$oGlobal = TGlobal::instance();
if ($oGlobal->UserDataExists($this->getActiveOrderParameter())) {
$sActiveOrderParameter = $oGlobal->GetUserData($this->getActiveOrderParameter());
}
return $sActiveOrderParameter;
} | [
"protected",
"function",
"GetActiveOrderRequest",
"(",
")",
"{",
"$",
"sActiveOrderParameter",
"=",
"false",
";",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"$",
"oGlobal",
"->",
"UserDataExists",
"(",
"$",
"this",
"->",
"getActiveOrderParameter",
"(",
")",
")",
")",
"{",
"$",
"sActiveOrderParameter",
"=",
"$",
"oGlobal",
"->",
"GetUserData",
"(",
"$",
"this",
"->",
"getActiveOrderParameter",
"(",
")",
")",
";",
"}",
"return",
"$",
"sActiveOrderParameter",
";",
"}"
] | Retuirns the active order parameter from url parameter.
@return bool | [
"Retuirns",
"the",
"active",
"order",
"parameter",
"from",
"url",
"parameter",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php#L96-L105 |
31,757 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php | MTShopOrderHistory.showDetail | protected function showDetail(TdbShopOrder $oOrder)
{
$oGlobal = TGlobal::instance();
return true === $oGlobal->UserDataExists($this->getActiveOrderParameter()) && $oOrder->fieldOrdernumber == $oGlobal->GetUserData($this->getActiveOrderParameter());
} | php | protected function showDetail(TdbShopOrder $oOrder)
{
$oGlobal = TGlobal::instance();
return true === $oGlobal->UserDataExists($this->getActiveOrderParameter()) && $oOrder->fieldOrdernumber == $oGlobal->GetUserData($this->getActiveOrderParameter());
} | [
"protected",
"function",
"showDetail",
"(",
"TdbShopOrder",
"$",
"oOrder",
")",
"{",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"return",
"true",
"===",
"$",
"oGlobal",
"->",
"UserDataExists",
"(",
"$",
"this",
"->",
"getActiveOrderParameter",
"(",
")",
")",
"&&",
"$",
"oOrder",
"->",
"fieldOrdernumber",
"==",
"$",
"oGlobal",
"->",
"GetUserData",
"(",
"$",
"this",
"->",
"getActiveOrderParameter",
"(",
")",
")",
";",
"}"
] | returns true if order number of given order is equal to the parameter in the url.
@param TdbShopOrder $oOrder
@return bool | [
"returns",
"true",
"if",
"order",
"number",
"of",
"given",
"order",
"is",
"equal",
"to",
"the",
"parameter",
"in",
"the",
"url",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php#L114-L119 |
31,758 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php | MTShopOrderHistory.getOrder | private function getOrder(TdbShopOrder $oOrder, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager)
{
$aOrder = array();
$oLocal = TCMSLocal::GetActive();
$aOrder['sOrderDate'] = $oLocal->FormatDate($oOrder->fieldDatecreated, TCMSLocal::DATEFORMAT_SHOW_DATE);
$aOrder['sOrdernumber'] = $oOrder->fieldOrdernumber;
$aOrder['sSumGrandTotal'] = $oOrder->fieldValueTotalFormated;
$aOrder['sShippingAddress'] = $this->getShippingAddress($oOrder, $bCachingEnabled, $oCacheTriggerManager);
$aOrder['sDetailLink'] = $this->getDetailLink($oOrder);
$orderCurrency = $oOrder->GetFieldPkgShopCurrency();
if (null !== $orderCurrency) {
$aOrder['currencyIso'] = $orderCurrency->fieldIso4217;
$aOrder['currencySymbol'] = $orderCurrency->fieldSymbol;
}
$aOrder['bActive'] = false;
return $aOrder;
} | php | private function getOrder(TdbShopOrder $oOrder, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager)
{
$aOrder = array();
$oLocal = TCMSLocal::GetActive();
$aOrder['sOrderDate'] = $oLocal->FormatDate($oOrder->fieldDatecreated, TCMSLocal::DATEFORMAT_SHOW_DATE);
$aOrder['sOrdernumber'] = $oOrder->fieldOrdernumber;
$aOrder['sSumGrandTotal'] = $oOrder->fieldValueTotalFormated;
$aOrder['sShippingAddress'] = $this->getShippingAddress($oOrder, $bCachingEnabled, $oCacheTriggerManager);
$aOrder['sDetailLink'] = $this->getDetailLink($oOrder);
$orderCurrency = $oOrder->GetFieldPkgShopCurrency();
if (null !== $orderCurrency) {
$aOrder['currencyIso'] = $orderCurrency->fieldIso4217;
$aOrder['currencySymbol'] = $orderCurrency->fieldSymbol;
}
$aOrder['bActive'] = false;
return $aOrder;
} | [
"private",
"function",
"getOrder",
"(",
"TdbShopOrder",
"$",
"oOrder",
",",
"$",
"bCachingEnabled",
",",
"IMapperCacheTriggerRestricted",
"$",
"oCacheTriggerManager",
")",
"{",
"$",
"aOrder",
"=",
"array",
"(",
")",
";",
"$",
"oLocal",
"=",
"TCMSLocal",
"::",
"GetActive",
"(",
")",
";",
"$",
"aOrder",
"[",
"'sOrderDate'",
"]",
"=",
"$",
"oLocal",
"->",
"FormatDate",
"(",
"$",
"oOrder",
"->",
"fieldDatecreated",
",",
"TCMSLocal",
"::",
"DATEFORMAT_SHOW_DATE",
")",
";",
"$",
"aOrder",
"[",
"'sOrdernumber'",
"]",
"=",
"$",
"oOrder",
"->",
"fieldOrdernumber",
";",
"$",
"aOrder",
"[",
"'sSumGrandTotal'",
"]",
"=",
"$",
"oOrder",
"->",
"fieldValueTotalFormated",
";",
"$",
"aOrder",
"[",
"'sShippingAddress'",
"]",
"=",
"$",
"this",
"->",
"getShippingAddress",
"(",
"$",
"oOrder",
",",
"$",
"bCachingEnabled",
",",
"$",
"oCacheTriggerManager",
")",
";",
"$",
"aOrder",
"[",
"'sDetailLink'",
"]",
"=",
"$",
"this",
"->",
"getDetailLink",
"(",
"$",
"oOrder",
")",
";",
"$",
"orderCurrency",
"=",
"$",
"oOrder",
"->",
"GetFieldPkgShopCurrency",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"orderCurrency",
")",
"{",
"$",
"aOrder",
"[",
"'currencyIso'",
"]",
"=",
"$",
"orderCurrency",
"->",
"fieldIso4217",
";",
"$",
"aOrder",
"[",
"'currencySymbol'",
"]",
"=",
"$",
"orderCurrency",
"->",
"fieldSymbol",
";",
"}",
"$",
"aOrder",
"[",
"'bActive'",
"]",
"=",
"false",
";",
"return",
"$",
"aOrder",
";",
"}"
] | value map for one order.
@param TdbShopOrder $oOrder
@param bool $bCachingEnabled
@param IMapperCacheTriggerRestricted $oCacheTriggerManager
@return array | [
"value",
"map",
"for",
"one",
"order",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php#L130-L149 |
31,759 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php | MTShopOrderHistory.getDetailLink | protected function getDetailLink(TdbShopOrder $oOrder)
{
$aParameters = array(
$this->getActiveOrderParameter() => $oOrder->fieldOrdernumber,
);
return '?'.TTools::GetArrayAsURL($aParameters);
} | php | protected function getDetailLink(TdbShopOrder $oOrder)
{
$aParameters = array(
$this->getActiveOrderParameter() => $oOrder->fieldOrdernumber,
);
return '?'.TTools::GetArrayAsURL($aParameters);
} | [
"protected",
"function",
"getDetailLink",
"(",
"TdbShopOrder",
"$",
"oOrder",
")",
"{",
"$",
"aParameters",
"=",
"array",
"(",
"$",
"this",
"->",
"getActiveOrderParameter",
"(",
")",
"=>",
"$",
"oOrder",
"->",
"fieldOrdernumber",
",",
")",
";",
"return",
"'?'",
".",
"TTools",
"::",
"GetArrayAsURL",
"(",
"$",
"aParameters",
")",
";",
"}"
] | get the detail link for the given order
takes active page as base url and adds only the parameter for the active order.
@param TdbShopOrder $oOrder
@return string | [
"get",
"the",
"detail",
"link",
"for",
"the",
"given",
"order",
"takes",
"active",
"page",
"as",
"base",
"url",
"and",
"adds",
"only",
"the",
"parameter",
"for",
"the",
"active",
"order",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopOrderHistory.class.php#L225-L232 |
31,760 | PGB-LIV/php-ms | src/Core/Spectra/IonTrait.php | IonTrait.setIntensity | public function setIntensity($intensity)
{
if (! (is_int($intensity) || is_float($intensity))) {
throw new \InvalidArgumentException(
'Argument 1 must be of type int or float. Value is of type ' . gettype($intensity));
}
$this->intensity = $intensity;
} | php | public function setIntensity($intensity)
{
if (! (is_int($intensity) || is_float($intensity))) {
throw new \InvalidArgumentException(
'Argument 1 must be of type int or float. Value is of type ' . gettype($intensity));
}
$this->intensity = $intensity;
} | [
"public",
"function",
"setIntensity",
"(",
"$",
"intensity",
")",
"{",
"if",
"(",
"!",
"(",
"is_int",
"(",
"$",
"intensity",
")",
"||",
"is_float",
"(",
"$",
"intensity",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Argument 1 must be of type int or float. Value is of type '",
".",
"gettype",
"(",
"$",
"intensity",
")",
")",
";",
"}",
"$",
"this",
"->",
"intensity",
"=",
"$",
"intensity",
";",
"}"
] | Sets the intensity value for this ion
@param float $intensity
The intensity value to set
@throws \InvalidArgumentException If the intensity is not of type float | [
"Sets",
"the",
"intensity",
"value",
"for",
"this",
"ion"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Core/Spectra/IonTrait.php#L76-L84 |
31,761 | PGB-LIV/php-ms | src/Core/Spectra/IonTrait.php | IonTrait.setRetentionTime | public function setRetentionTime($retentionTime)
{
if (! (is_int($retentionTime) || is_float($retentionTime))) {
throw new \InvalidArgumentException(
'Argument 1 must be of type int or float. Value is of type ' . gettype($retentionTime));
}
$this->retentionTimeWindow = $retentionTime;
} | php | public function setRetentionTime($retentionTime)
{
if (! (is_int($retentionTime) || is_float($retentionTime))) {
throw new \InvalidArgumentException(
'Argument 1 must be of type int or float. Value is of type ' . gettype($retentionTime));
}
$this->retentionTimeWindow = $retentionTime;
} | [
"public",
"function",
"setRetentionTime",
"(",
"$",
"retentionTime",
")",
"{",
"if",
"(",
"!",
"(",
"is_int",
"(",
"$",
"retentionTime",
")",
"||",
"is_float",
"(",
"$",
"retentionTime",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Argument 1 must be of type int or float. Value is of type '",
".",
"gettype",
"(",
"$",
"retentionTime",
")",
")",
";",
"}",
"$",
"this",
"->",
"retentionTimeWindow",
"=",
"$",
"retentionTime",
";",
"}"
] | Sets the spectra elements retention time
@param float $retentionTime
Retention time of fragment | [
"Sets",
"the",
"spectra",
"elements",
"retention",
"time"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Core/Spectra/IonTrait.php#L102-L110 |
31,762 | PGB-LIV/php-ms | src/Core/Spectra/IonTrait.php | IonTrait.setRetentionTimeWindow | public function setRetentionTimeWindow($retentionTimeStart, $retentionTimeEnd)
{
if (! (is_int($retentionTimeStart) || is_float($retentionTimeStart))) {
throw new \InvalidArgumentException(
'Argument 1 must be of type int or float. Value is of type ' . gettype($retentionTimeStart));
}
if (! (is_int($retentionTimeEnd) || is_float($retentionTimeEnd))) {
throw new \InvalidArgumentException(
'Argument 2 must be of type int or float. Value is of type ' . gettype($retentionTimeEnd));
}
$this->retentionTimeWindow = array();
$this->retentionTimeWindow[static::RETENTION_TIME_START] = $retentionTimeStart;
$this->retentionTimeWindow[static::RETENTION_TIME_END] = $retentionTimeEnd;
} | php | public function setRetentionTimeWindow($retentionTimeStart, $retentionTimeEnd)
{
if (! (is_int($retentionTimeStart) || is_float($retentionTimeStart))) {
throw new \InvalidArgumentException(
'Argument 1 must be of type int or float. Value is of type ' . gettype($retentionTimeStart));
}
if (! (is_int($retentionTimeEnd) || is_float($retentionTimeEnd))) {
throw new \InvalidArgumentException(
'Argument 2 must be of type int or float. Value is of type ' . gettype($retentionTimeEnd));
}
$this->retentionTimeWindow = array();
$this->retentionTimeWindow[static::RETENTION_TIME_START] = $retentionTimeStart;
$this->retentionTimeWindow[static::RETENTION_TIME_END] = $retentionTimeEnd;
} | [
"public",
"function",
"setRetentionTimeWindow",
"(",
"$",
"retentionTimeStart",
",",
"$",
"retentionTimeEnd",
")",
"{",
"if",
"(",
"!",
"(",
"is_int",
"(",
"$",
"retentionTimeStart",
")",
"||",
"is_float",
"(",
"$",
"retentionTimeStart",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Argument 1 must be of type int or float. Value is of type '",
".",
"gettype",
"(",
"$",
"retentionTimeStart",
")",
")",
";",
"}",
"if",
"(",
"!",
"(",
"is_int",
"(",
"$",
"retentionTimeEnd",
")",
"||",
"is_float",
"(",
"$",
"retentionTimeEnd",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Argument 2 must be of type int or float. Value is of type '",
".",
"gettype",
"(",
"$",
"retentionTimeEnd",
")",
")",
";",
"}",
"$",
"this",
"->",
"retentionTimeWindow",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"retentionTimeWindow",
"[",
"static",
"::",
"RETENTION_TIME_START",
"]",
"=",
"$",
"retentionTimeStart",
";",
"$",
"this",
"->",
"retentionTimeWindow",
"[",
"static",
"::",
"RETENTION_TIME_END",
"]",
"=",
"$",
"retentionTimeEnd",
";",
"}"
] | Sets the spectra elements retention time or retention time window
@param float $retentionTimeStart
Retention time of fragment or start of retention time window
@param float $retentionTimeEnd
End of retention time window, or null if equal to start | [
"Sets",
"the",
"spectra",
"elements",
"retention",
"time",
"or",
"retention",
"time",
"window"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Core/Spectra/IonTrait.php#L120-L135 |
31,763 | PGB-LIV/php-ms | src/Core/Spectra/IonTrait.php | IonTrait.getRetentionTime | public function getRetentionTime()
{
if (is_array($this->retentionTimeWindow)) {
return ($this->retentionTimeWindow[static::RETENTION_TIME_START] +
$this->retentionTimeWindow[static::RETENTION_TIME_END]) / 2;
}
return $this->retentionTimeWindow;
} | php | public function getRetentionTime()
{
if (is_array($this->retentionTimeWindow)) {
return ($this->retentionTimeWindow[static::RETENTION_TIME_START] +
$this->retentionTimeWindow[static::RETENTION_TIME_END]) / 2;
}
return $this->retentionTimeWindow;
} | [
"public",
"function",
"getRetentionTime",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"retentionTimeWindow",
")",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"retentionTimeWindow",
"[",
"static",
"::",
"RETENTION_TIME_START",
"]",
"+",
"$",
"this",
"->",
"retentionTimeWindow",
"[",
"static",
"::",
"RETENTION_TIME_END",
"]",
")",
"/",
"2",
";",
"}",
"return",
"$",
"this",
"->",
"retentionTimeWindow",
";",
"}"
] | Gets the retention time in seconds, or the average if a window has been set
@return float | [
"Gets",
"the",
"retention",
"time",
"in",
"seconds",
"or",
"the",
"average",
"if",
"a",
"window",
"has",
"been",
"set"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Core/Spectra/IonTrait.php#L142-L150 |
31,764 | PGB-LIV/php-ms | src/Core/Spectra/IonTrait.php | IonTrait.getRetentionTimeWindow | public function getRetentionTimeWindow()
{
if (is_array($this->retentionTimeWindow)) {
return $this->retentionTimeWindow;
}
return array(
$this->retentionTimeWindow,
$this->retentionTimeWindow
);
} | php | public function getRetentionTimeWindow()
{
if (is_array($this->retentionTimeWindow)) {
return $this->retentionTimeWindow;
}
return array(
$this->retentionTimeWindow,
$this->retentionTimeWindow
);
} | [
"public",
"function",
"getRetentionTimeWindow",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"retentionTimeWindow",
")",
")",
"{",
"return",
"$",
"this",
"->",
"retentionTimeWindow",
";",
"}",
"return",
"array",
"(",
"$",
"this",
"->",
"retentionTimeWindow",
",",
"$",
"this",
"->",
"retentionTimeWindow",
")",
";",
"}"
] | Gets the retention time window in seconds
@return array | [
"Gets",
"the",
"retention",
"time",
"window",
"in",
"seconds"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Core/Spectra/IonTrait.php#L157-L167 |
31,765 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Filesystem/File/FindReplace.php | FindReplace.findReplaceName | public function findReplaceName(
string $singularFindName,
string $singularReplaceName
): self {
$singularFindName = Inflector::classify($singularFindName);
$singularReplaceName = Inflector::classify($singularReplaceName);
$this->findReplace($singularFindName, $singularReplaceName);
$this->findReplace(\lcfirst($singularFindName), \lcfirst($singularReplaceName));
$this->findReplace(\strtoupper($singularFindName), \strtoupper($singularReplaceName));
$this->findReplace(
\strtoupper(Inflector::tableize($singularFindName)),
\strtoupper(Inflector::tableize($singularReplaceName))
);
$pluralFindName = $this->getPlural($singularFindName);
$pluralReplaceName = $this->getPlural($singularReplaceName);
$this->findReplace($pluralFindName, $pluralReplaceName);
$this->findReplace(\lcfirst($pluralFindName), \lcfirst($pluralReplaceName));
$this->findReplace(\strtoupper($pluralFindName), \strtoupper($pluralReplaceName));
$this->findReplace(
\strtoupper(Inflector::tableize($pluralFindName)),
\strtoupper(Inflector::tableize($pluralReplaceName))
);
return $this;
} | php | public function findReplaceName(
string $singularFindName,
string $singularReplaceName
): self {
$singularFindName = Inflector::classify($singularFindName);
$singularReplaceName = Inflector::classify($singularReplaceName);
$this->findReplace($singularFindName, $singularReplaceName);
$this->findReplace(\lcfirst($singularFindName), \lcfirst($singularReplaceName));
$this->findReplace(\strtoupper($singularFindName), \strtoupper($singularReplaceName));
$this->findReplace(
\strtoupper(Inflector::tableize($singularFindName)),
\strtoupper(Inflector::tableize($singularReplaceName))
);
$pluralFindName = $this->getPlural($singularFindName);
$pluralReplaceName = $this->getPlural($singularReplaceName);
$this->findReplace($pluralFindName, $pluralReplaceName);
$this->findReplace(\lcfirst($pluralFindName), \lcfirst($pluralReplaceName));
$this->findReplace(\strtoupper($pluralFindName), \strtoupper($pluralReplaceName));
$this->findReplace(
\strtoupper(Inflector::tableize($pluralFindName)),
\strtoupper(Inflector::tableize($pluralReplaceName))
);
return $this;
} | [
"public",
"function",
"findReplaceName",
"(",
"string",
"$",
"singularFindName",
",",
"string",
"$",
"singularReplaceName",
")",
":",
"self",
"{",
"$",
"singularFindName",
"=",
"Inflector",
"::",
"classify",
"(",
"$",
"singularFindName",
")",
";",
"$",
"singularReplaceName",
"=",
"Inflector",
"::",
"classify",
"(",
"$",
"singularReplaceName",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"$",
"singularFindName",
",",
"$",
"singularReplaceName",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"\\",
"lcfirst",
"(",
"$",
"singularFindName",
")",
",",
"\\",
"lcfirst",
"(",
"$",
"singularReplaceName",
")",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"\\",
"strtoupper",
"(",
"$",
"singularFindName",
")",
",",
"\\",
"strtoupper",
"(",
"$",
"singularReplaceName",
")",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"\\",
"strtoupper",
"(",
"Inflector",
"::",
"tableize",
"(",
"$",
"singularFindName",
")",
")",
",",
"\\",
"strtoupper",
"(",
"Inflector",
"::",
"tableize",
"(",
"$",
"singularReplaceName",
")",
")",
")",
";",
"$",
"pluralFindName",
"=",
"$",
"this",
"->",
"getPlural",
"(",
"$",
"singularFindName",
")",
";",
"$",
"pluralReplaceName",
"=",
"$",
"this",
"->",
"getPlural",
"(",
"$",
"singularReplaceName",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"$",
"pluralFindName",
",",
"$",
"pluralReplaceName",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"\\",
"lcfirst",
"(",
"$",
"pluralFindName",
")",
",",
"\\",
"lcfirst",
"(",
"$",
"pluralReplaceName",
")",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"\\",
"strtoupper",
"(",
"$",
"pluralFindName",
")",
",",
"\\",
"strtoupper",
"(",
"$",
"pluralReplaceName",
")",
")",
";",
"$",
"this",
"->",
"findReplace",
"(",
"\\",
"strtoupper",
"(",
"Inflector",
"::",
"tableize",
"(",
"$",
"pluralFindName",
")",
")",
",",
"\\",
"strtoupper",
"(",
"Inflector",
"::",
"tableize",
"(",
"$",
"pluralReplaceName",
")",
")",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Find all instances of a name in the various code styles
Handles replacing both singular and plural replacements
@param string $singularFindName
@param string $singularReplaceName
@return FindReplace | [
"Find",
"all",
"instances",
"of",
"a",
"name",
"in",
"the",
"various",
"code",
"styles"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Filesystem/File/FindReplace.php#L37-L62 |
31,766 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Filesystem/File/FindReplace.php | FindReplace.findReplace | public function findReplace(string $find, string $replace)
{
$contents = $this->file->getContents();
$contents = \str_replace($find, $replace, $contents);
$this->file->setContents($contents);
return $this;
} | php | public function findReplace(string $find, string $replace)
{
$contents = $this->file->getContents();
$contents = \str_replace($find, $replace, $contents);
$this->file->setContents($contents);
return $this;
} | [
"public",
"function",
"findReplace",
"(",
"string",
"$",
"find",
",",
"string",
"$",
"replace",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"->",
"file",
"->",
"getContents",
"(",
")",
";",
"$",
"contents",
"=",
"\\",
"str_replace",
"(",
"$",
"find",
",",
"$",
"replace",
",",
"$",
"contents",
")",
";",
"$",
"this",
"->",
"file",
"->",
"setContents",
"(",
"$",
"contents",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Find and replace using simple case sensitive str_replace
@param string $find
@param string $replace
@return FindReplace | [
"Find",
"and",
"replace",
"using",
"simple",
"case",
"sensitive",
"str_replace"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Filesystem/File/FindReplace.php#L72-L79 |
31,767 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/Filesystem/File/FindReplace.php | FindReplace.findReplaceRegex | public function findReplaceRegex(string $find, string $replace)
{
$contents = $this->file->getContents();
$contents = \preg_replace($find, $replace, $contents, -1/*, $count*/);
$this->file->setContents($contents);
} | php | public function findReplaceRegex(string $find, string $replace)
{
$contents = $this->file->getContents();
$contents = \preg_replace($find, $replace, $contents, -1/*, $count*/);
$this->file->setContents($contents);
} | [
"public",
"function",
"findReplaceRegex",
"(",
"string",
"$",
"find",
",",
"string",
"$",
"replace",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"->",
"file",
"->",
"getContents",
"(",
")",
";",
"$",
"contents",
"=",
"\\",
"preg_replace",
"(",
"$",
"find",
",",
"$",
"replace",
",",
"$",
"contents",
",",
"-",
"1",
"/*, $count*/",
")",
";",
"$",
"this",
"->",
"file",
"->",
"setContents",
"(",
"$",
"contents",
")",
";",
"}"
] | Find and replace using preg_replace
@param string $find
@param string $replace | [
"Find",
"and",
"replace",
"using",
"preg_replace"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/Filesystem/File/FindReplace.php#L97-L103 |
31,768 | chameleon-system/chameleon-shop | src/ShopListFilterBundle/objects/db/ListfilterItems/TPkgShopListfilterItemShopAttributeNumeric.class.php | TPkgShopListfilterItemShopAttributeNumeric.GetActiveStartValue | public function GetActiveStartValue()
{
$sStartValue = false;
if (is_array($this->aActiveFilterData) && array_key_exists(self::URL_PARAMETER_FILTER_START_VALUE, $this->aActiveFilterData)) {
$sStartValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_START_VALUE];
}
return $sStartValue;
} | php | public function GetActiveStartValue()
{
$sStartValue = false;
if (is_array($this->aActiveFilterData) && array_key_exists(self::URL_PARAMETER_FILTER_START_VALUE, $this->aActiveFilterData)) {
$sStartValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_START_VALUE];
}
return $sStartValue;
} | [
"public",
"function",
"GetActiveStartValue",
"(",
")",
"{",
"$",
"sStartValue",
"=",
"false",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"aActiveFilterData",
")",
"&&",
"array_key_exists",
"(",
"self",
"::",
"URL_PARAMETER_FILTER_START_VALUE",
",",
"$",
"this",
"->",
"aActiveFilterData",
")",
")",
"{",
"$",
"sStartValue",
"=",
"$",
"this",
"->",
"aActiveFilterData",
"[",
"self",
"::",
"URL_PARAMETER_FILTER_START_VALUE",
"]",
";",
"}",
"return",
"$",
"sStartValue",
";",
"}"
] | return active start value.
@return float | [
"return",
"active",
"start",
"value",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopListFilterBundle/objects/db/ListfilterItems/TPkgShopListfilterItemShopAttributeNumeric.class.php#L38-L46 |
31,769 | chameleon-system/chameleon-shop | src/ShopListFilterBundle/objects/db/ListfilterItems/TPkgShopListfilterItemShopAttributeNumeric.class.php | TPkgShopListfilterItemShopAttributeNumeric.GetActiveEndValue | public function GetActiveEndValue()
{
$sEndValue = false;
if (is_array($this->aActiveFilterData) && array_key_exists(self::URL_PARAMETER_FILTER_END_VALUE, $this->aActiveFilterData)) {
$sEndValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_END_VALUE];
}
return $sEndValue;
} | php | public function GetActiveEndValue()
{
$sEndValue = false;
if (is_array($this->aActiveFilterData) && array_key_exists(self::URL_PARAMETER_FILTER_END_VALUE, $this->aActiveFilterData)) {
$sEndValue = $this->aActiveFilterData[self::URL_PARAMETER_FILTER_END_VALUE];
}
return $sEndValue;
} | [
"public",
"function",
"GetActiveEndValue",
"(",
")",
"{",
"$",
"sEndValue",
"=",
"false",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"aActiveFilterData",
")",
"&&",
"array_key_exists",
"(",
"self",
"::",
"URL_PARAMETER_FILTER_END_VALUE",
",",
"$",
"this",
"->",
"aActiveFilterData",
")",
")",
"{",
"$",
"sEndValue",
"=",
"$",
"this",
"->",
"aActiveFilterData",
"[",
"self",
"::",
"URL_PARAMETER_FILTER_END_VALUE",
"]",
";",
"}",
"return",
"$",
"sEndValue",
";",
"}"
] | return active end value.
@return float | [
"return",
"active",
"end",
"value",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopListFilterBundle/objects/db/ListfilterItems/TPkgShopListfilterItemShopAttributeNumeric.class.php#L53-L61 |
31,770 | chameleon-system/chameleon-shop | src/ShopListFilterBundle/objects/db/ListfilterItems/TPkgShopListfilterItemShopAttributeNumeric.class.php | TPkgShopListfilterItemShopAttributeNumeric.GetSQLQueryForQueryRestrictionForActiveFilter | protected function GetSQLQueryForQueryRestrictionForActiveFilter()
{
$dStartValue = $this->GetActiveStartValue();
$dEndValue = $this->GetActiveEndValue();
$sQuery = '';
if (false !== $dStartValue && false !== $dEndValue) {
$sEscapedTargetTable = MySqlLegacySupport::getInstance()->real_escape_string($this->sItemTableName);
$sEscapedTargetMLTTable = MySqlLegacySupport::getInstance()->real_escape_string('shop_article_'.$this->sItemTableName.'_mlt');
$oShopAttribute = $this->GetFieldShopAttribute();
$sQuery = "SELECT `{$sEscapedTargetMLTTable}`.*
FROM `{$sEscapedTargetTable}`
INNER JOIN `{$sEscapedTargetMLTTable}` ON `{$sEscapedTargetTable}`.`id` = `{$sEscapedTargetMLTTable}`.`target_id`
WHERE ".$this->GetTargetTableNameField().' >= '.MySqlLegacySupport::getInstance()->real_escape_string($dStartValue).'
AND '.$this->GetTargetTableNameField().' <= '.MySqlLegacySupport::getInstance()->real_escape_string($dEndValue)."
AND `{$sEscapedTargetTable}`.`shop_attribute_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($oShopAttribute->id)."'";
}
return $sQuery;
} | php | protected function GetSQLQueryForQueryRestrictionForActiveFilter()
{
$dStartValue = $this->GetActiveStartValue();
$dEndValue = $this->GetActiveEndValue();
$sQuery = '';
if (false !== $dStartValue && false !== $dEndValue) {
$sEscapedTargetTable = MySqlLegacySupport::getInstance()->real_escape_string($this->sItemTableName);
$sEscapedTargetMLTTable = MySqlLegacySupport::getInstance()->real_escape_string('shop_article_'.$this->sItemTableName.'_mlt');
$oShopAttribute = $this->GetFieldShopAttribute();
$sQuery = "SELECT `{$sEscapedTargetMLTTable}`.*
FROM `{$sEscapedTargetTable}`
INNER JOIN `{$sEscapedTargetMLTTable}` ON `{$sEscapedTargetTable}`.`id` = `{$sEscapedTargetMLTTable}`.`target_id`
WHERE ".$this->GetTargetTableNameField().' >= '.MySqlLegacySupport::getInstance()->real_escape_string($dStartValue).'
AND '.$this->GetTargetTableNameField().' <= '.MySqlLegacySupport::getInstance()->real_escape_string($dEndValue)."
AND `{$sEscapedTargetTable}`.`shop_attribute_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($oShopAttribute->id)."'";
}
return $sQuery;
} | [
"protected",
"function",
"GetSQLQueryForQueryRestrictionForActiveFilter",
"(",
")",
"{",
"$",
"dStartValue",
"=",
"$",
"this",
"->",
"GetActiveStartValue",
"(",
")",
";",
"$",
"dEndValue",
"=",
"$",
"this",
"->",
"GetActiveEndValue",
"(",
")",
";",
"$",
"sQuery",
"=",
"''",
";",
"if",
"(",
"false",
"!==",
"$",
"dStartValue",
"&&",
"false",
"!==",
"$",
"dEndValue",
")",
"{",
"$",
"sEscapedTargetTable",
"=",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"this",
"->",
"sItemTableName",
")",
";",
"$",
"sEscapedTargetMLTTable",
"=",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"'shop_article_'",
".",
"$",
"this",
"->",
"sItemTableName",
".",
"'_mlt'",
")",
";",
"$",
"oShopAttribute",
"=",
"$",
"this",
"->",
"GetFieldShopAttribute",
"(",
")",
";",
"$",
"sQuery",
"=",
"\"SELECT `{$sEscapedTargetMLTTable}`.*\n FROM `{$sEscapedTargetTable}`\n INNER JOIN `{$sEscapedTargetMLTTable}` ON `{$sEscapedTargetTable}`.`id` = `{$sEscapedTargetMLTTable}`.`target_id`\n WHERE \"",
".",
"$",
"this",
"->",
"GetTargetTableNameField",
"(",
")",
".",
"' >= '",
".",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"dStartValue",
")",
".",
"'\n AND '",
".",
"$",
"this",
"->",
"GetTargetTableNameField",
"(",
")",
".",
"' <= '",
".",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"dEndValue",
")",
".",
"\"\n AND `{$sEscapedTargetTable}`.`shop_attribute_id` = '\"",
".",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"oShopAttribute",
"->",
"id",
")",
".",
"\"'\"",
";",
"}",
"return",
"$",
"sQuery",
";",
"}"
] | builds the sql query for the GetItemName method that is usual used as callback in the GetOptions method
we only want to show results that are values of the selected shop attribute in the filter item.
@return string | [
"builds",
"the",
"sql",
"query",
"for",
"the",
"GetItemName",
"method",
"that",
"is",
"usual",
"used",
"as",
"callback",
"in",
"the",
"GetOptions",
"method",
"we",
"only",
"want",
"to",
"show",
"results",
"that",
"are",
"values",
"of",
"the",
"selected",
"shop",
"attribute",
"in",
"the",
"filter",
"item",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopListFilterBundle/objects/db/ListfilterItems/TPkgShopListfilterItemShopAttributeNumeric.class.php#L85-L104 |
31,771 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingType.class.php | TShopShippingType.isValidForCurrentPortal | public function isValidForCurrentPortal()
{
$aPortalIdList = $this->getShopShippingTypeDataAccess()->getPermittedPortalIds($this->id);
if (!is_array($aPortalIdList) || count($aPortalIdList) < 1) {
$bIsValidForPortal = true;
} else {
$oActivePortal = $this->getPortalDomainService()->getActivePortal();
if (null === $oActivePortal) {
$bIsValidForPortal = false;
} else {
$bIsValidForPortal = in_array($oActivePortal->id, $aPortalIdList);
}
}
return $bIsValidForPortal;
} | php | public function isValidForCurrentPortal()
{
$aPortalIdList = $this->getShopShippingTypeDataAccess()->getPermittedPortalIds($this->id);
if (!is_array($aPortalIdList) || count($aPortalIdList) < 1) {
$bIsValidForPortal = true;
} else {
$oActivePortal = $this->getPortalDomainService()->getActivePortal();
if (null === $oActivePortal) {
$bIsValidForPortal = false;
} else {
$bIsValidForPortal = in_array($oActivePortal->id, $aPortalIdList);
}
}
return $bIsValidForPortal;
} | [
"public",
"function",
"isValidForCurrentPortal",
"(",
")",
"{",
"$",
"aPortalIdList",
"=",
"$",
"this",
"->",
"getShopShippingTypeDataAccess",
"(",
")",
"->",
"getPermittedPortalIds",
"(",
"$",
"this",
"->",
"id",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"aPortalIdList",
")",
"||",
"count",
"(",
"$",
"aPortalIdList",
")",
"<",
"1",
")",
"{",
"$",
"bIsValidForPortal",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"oActivePortal",
"=",
"$",
"this",
"->",
"getPortalDomainService",
"(",
")",
"->",
"getActivePortal",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"oActivePortal",
")",
"{",
"$",
"bIsValidForPortal",
"=",
"false",
";",
"}",
"else",
"{",
"$",
"bIsValidForPortal",
"=",
"in_array",
"(",
"$",
"oActivePortal",
"->",
"id",
",",
"$",
"aPortalIdList",
")",
";",
"}",
"}",
"return",
"$",
"bIsValidForPortal",
";",
"}"
] | return true if the shipping group is allowed for the current portal.
If no active portal was found and group was restricted to portal return false.
@return bool | [
"return",
"true",
"if",
"the",
"shipping",
"group",
"is",
"allowed",
"for",
"the",
"current",
"portal",
".",
"If",
"no",
"active",
"portal",
"was",
"found",
"and",
"group",
"was",
"restricted",
"to",
"portal",
"return",
"false",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingType.class.php#L173-L188 |
31,772 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingType.class.php | TShopShippingType.IsValidForBasket | public function IsValidForBasket()
{
$bValidForBasket = false;
$oArticles = &$this->GetAffectedBasketArticles();
$bValidForBasket = ($oArticles->Length() > 0);
return $bValidForBasket;
} | php | public function IsValidForBasket()
{
$bValidForBasket = false;
$oArticles = &$this->GetAffectedBasketArticles();
$bValidForBasket = ($oArticles->Length() > 0);
return $bValidForBasket;
} | [
"public",
"function",
"IsValidForBasket",
"(",
")",
"{",
"$",
"bValidForBasket",
"=",
"false",
";",
"$",
"oArticles",
"=",
"&",
"$",
"this",
"->",
"GetAffectedBasketArticles",
"(",
")",
";",
"$",
"bValidForBasket",
"=",
"(",
"$",
"oArticles",
"->",
"Length",
"(",
")",
">",
"0",
")",
";",
"return",
"$",
"bValidForBasket",
";",
"}"
] | checks if the current shipping type is available for the current basket
affected articles in the basket will be marked with the shipping type.
@return bool | [
"checks",
"if",
"the",
"current",
"shipping",
"type",
"is",
"available",
"for",
"the",
"current",
"basket",
"affected",
"articles",
"in",
"the",
"basket",
"will",
"be",
"marked",
"with",
"the",
"shipping",
"type",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingType.class.php#L196-L203 |
31,773 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingType.class.php | TShopShippingType.ArticleAffected | public function ArticleAffected(TShopBasketArticle &$oArticle)
{
$shopShippingTypeDataAccess = $this->getShopShippingTypeDataAccess();
$bAffected = false;
$oArticleShippingType = &$oArticle->GetActingShippingType();
// if the article is already marked with this shipping type, then we keep it
if (!is_null($oArticleShippingType) && $oArticleShippingType->id == $this->id) {
$bAffected = true;
} elseif (is_null($oArticleShippingType)) {
// article has no shipping type yet...
// check article groups
$bArticleGroupValid = false;
$aGroupRestriction = $shopShippingTypeDataAccess->getPermittedArticleGroupIds($this->id);
if (!is_array($aGroupRestriction) || count($aGroupRestriction) < 1) {
$bArticleGroupValid = true;
} else {
$bArticleGroupValid = $oArticle->IsInArticleGroups($aGroupRestriction);
}
// check product categories
$bArticleCategoryValid = false;
if ($bArticleGroupValid) {
$aCategoryRestriction = $shopShippingTypeDataAccess->getPermittedCategoryIds($this->id);
if (!is_array($aCategoryRestriction) || count($aCategoryRestriction) < 1) {
$bArticleCategoryValid = true;
} else {
$bArticleCategoryValid = $oArticle->IsInCategory($aCategoryRestriction);
}
}
// check articles
$bArticleValid = false;
if ($bArticleGroupValid && $bArticleCategoryValid) {
$aArticleRestriction = $shopShippingTypeDataAccess->getPermittedArticleIds($this->id);
if (!is_array($aArticleRestriction) || count($aArticleRestriction) < 1) {
$bArticleValid = true;
} else {
if (in_array($oArticle->id, $aArticleRestriction)) {
$bArticleValid = true;
}
}
}
$bAffected = ($bArticleGroupValid && $bArticleCategoryValid && $bArticleValid);
}
return $bAffected;
} | php | public function ArticleAffected(TShopBasketArticle &$oArticle)
{
$shopShippingTypeDataAccess = $this->getShopShippingTypeDataAccess();
$bAffected = false;
$oArticleShippingType = &$oArticle->GetActingShippingType();
// if the article is already marked with this shipping type, then we keep it
if (!is_null($oArticleShippingType) && $oArticleShippingType->id == $this->id) {
$bAffected = true;
} elseif (is_null($oArticleShippingType)) {
// article has no shipping type yet...
// check article groups
$bArticleGroupValid = false;
$aGroupRestriction = $shopShippingTypeDataAccess->getPermittedArticleGroupIds($this->id);
if (!is_array($aGroupRestriction) || count($aGroupRestriction) < 1) {
$bArticleGroupValid = true;
} else {
$bArticleGroupValid = $oArticle->IsInArticleGroups($aGroupRestriction);
}
// check product categories
$bArticleCategoryValid = false;
if ($bArticleGroupValid) {
$aCategoryRestriction = $shopShippingTypeDataAccess->getPermittedCategoryIds($this->id);
if (!is_array($aCategoryRestriction) || count($aCategoryRestriction) < 1) {
$bArticleCategoryValid = true;
} else {
$bArticleCategoryValid = $oArticle->IsInCategory($aCategoryRestriction);
}
}
// check articles
$bArticleValid = false;
if ($bArticleGroupValid && $bArticleCategoryValid) {
$aArticleRestriction = $shopShippingTypeDataAccess->getPermittedArticleIds($this->id);
if (!is_array($aArticleRestriction) || count($aArticleRestriction) < 1) {
$bArticleValid = true;
} else {
if (in_array($oArticle->id, $aArticleRestriction)) {
$bArticleValid = true;
}
}
}
$bAffected = ($bArticleGroupValid && $bArticleCategoryValid && $bArticleValid);
}
return $bAffected;
} | [
"public",
"function",
"ArticleAffected",
"(",
"TShopBasketArticle",
"&",
"$",
"oArticle",
")",
"{",
"$",
"shopShippingTypeDataAccess",
"=",
"$",
"this",
"->",
"getShopShippingTypeDataAccess",
"(",
")",
";",
"$",
"bAffected",
"=",
"false",
";",
"$",
"oArticleShippingType",
"=",
"&",
"$",
"oArticle",
"->",
"GetActingShippingType",
"(",
")",
";",
"// if the article is already marked with this shipping type, then we keep it",
"if",
"(",
"!",
"is_null",
"(",
"$",
"oArticleShippingType",
")",
"&&",
"$",
"oArticleShippingType",
"->",
"id",
"==",
"$",
"this",
"->",
"id",
")",
"{",
"$",
"bAffected",
"=",
"true",
";",
"}",
"elseif",
"(",
"is_null",
"(",
"$",
"oArticleShippingType",
")",
")",
"{",
"// article has no shipping type yet...",
"// check article groups",
"$",
"bArticleGroupValid",
"=",
"false",
";",
"$",
"aGroupRestriction",
"=",
"$",
"shopShippingTypeDataAccess",
"->",
"getPermittedArticleGroupIds",
"(",
"$",
"this",
"->",
"id",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"aGroupRestriction",
")",
"||",
"count",
"(",
"$",
"aGroupRestriction",
")",
"<",
"1",
")",
"{",
"$",
"bArticleGroupValid",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"bArticleGroupValid",
"=",
"$",
"oArticle",
"->",
"IsInArticleGroups",
"(",
"$",
"aGroupRestriction",
")",
";",
"}",
"// check product categories",
"$",
"bArticleCategoryValid",
"=",
"false",
";",
"if",
"(",
"$",
"bArticleGroupValid",
")",
"{",
"$",
"aCategoryRestriction",
"=",
"$",
"shopShippingTypeDataAccess",
"->",
"getPermittedCategoryIds",
"(",
"$",
"this",
"->",
"id",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"aCategoryRestriction",
")",
"||",
"count",
"(",
"$",
"aCategoryRestriction",
")",
"<",
"1",
")",
"{",
"$",
"bArticleCategoryValid",
"=",
"true",
";",
"}",
"else",
"{",
"$",
"bArticleCategoryValid",
"=",
"$",
"oArticle",
"->",
"IsInCategory",
"(",
"$",
"aCategoryRestriction",
")",
";",
"}",
"}",
"// check articles",
"$",
"bArticleValid",
"=",
"false",
";",
"if",
"(",
"$",
"bArticleGroupValid",
"&&",
"$",
"bArticleCategoryValid",
")",
"{",
"$",
"aArticleRestriction",
"=",
"$",
"shopShippingTypeDataAccess",
"->",
"getPermittedArticleIds",
"(",
"$",
"this",
"->",
"id",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"aArticleRestriction",
")",
"||",
"count",
"(",
"$",
"aArticleRestriction",
")",
"<",
"1",
")",
"{",
"$",
"bArticleValid",
"=",
"true",
";",
"}",
"else",
"{",
"if",
"(",
"in_array",
"(",
"$",
"oArticle",
"->",
"id",
",",
"$",
"aArticleRestriction",
")",
")",
"{",
"$",
"bArticleValid",
"=",
"true",
";",
"}",
"}",
"}",
"$",
"bAffected",
"=",
"(",
"$",
"bArticleGroupValid",
"&&",
"$",
"bArticleCategoryValid",
"&&",
"$",
"bArticleValid",
")",
";",
"}",
"return",
"$",
"bAffected",
";",
"}"
] | checks if a basket article should be affected by this shipping type
this can only happen if the article is not affected by any other shipping type.
@param TShopBasketArticle $oArticle
@return bool | [
"checks",
"if",
"a",
"basket",
"article",
"should",
"be",
"affected",
"by",
"this",
"shipping",
"type",
"this",
"can",
"only",
"happen",
"if",
"the",
"article",
"is",
"not",
"affected",
"by",
"any",
"other",
"shipping",
"type",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingType.class.php#L238-L285 |
31,774 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingType.class.php | TShopShippingType.GetPrice | public function GetPrice()
{
if (is_null($this->dPrice)) {
$this->dPrice = 0;
// price based on basket
if ($this->fieldValueBasedOnEntireBasket) {
$oBasket = TShopBasket::GetInstance();
$iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
$iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
$oItemList = $oBasket->GetBasketContents();
$oItemList->GoToStart();
while ($oItem = &$oItemList->Next()) {
if ($oItem->fieldExcludeFromShippingCostCalculation) {
$iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dAmount;
$iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dPriceTotalAfterDiscount;
}
}
$oItemList->GoToStart();
if ('absolut' == $this->fieldValueType) {
$this->dPrice = $this->fieldValue;
if ($this->fieldAddValueForEachArticle ||
($iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation > 0 &&
$oBasket->dTotalNumberOfArticles == $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation
)
) {
$this->dPrice = ($oBasket->dTotalNumberOfArticles - $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
}
} else {
$this->dPrice = round($this->ApplyPriceModifiers(($oBasket->dCostArticlesTotalAfterDiscounts - $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
}
} else {
// price based on current list
/** @var $oArticleList TShopBasketArticleList */
$oArticleList = &$this->GetAffectedBasketArticles();
if (!is_null($oArticleList)) {
$iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
$iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
$oArticleList->GoToStart();
while ($oArticle = &$oArticleList->Next()) {
if ($oArticle->fieldExcludeFromShippingCostCalculation) {
$iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dAmount;
$iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dPriceTotalAfterDiscount;
}
}
$oArticleList->GoToStart();
if ('absolut' == $this->fieldValueType) {
$this->dPrice = $this->fieldValue;
if ($this->fieldAddValueForEachArticle ||
($iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation > 0 &&
$oArticleList->dNumberOfItems == $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation
)
) {
$this->dPrice = ($oArticleList->dNumberOfItems - $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
}
} else {
$this->dPrice = round($this->ApplyPriceModifiers(($oArticleList->dProductPrice - $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
}
}
}
}
return $this->dPrice;
} | php | public function GetPrice()
{
if (is_null($this->dPrice)) {
$this->dPrice = 0;
// price based on basket
if ($this->fieldValueBasedOnEntireBasket) {
$oBasket = TShopBasket::GetInstance();
$iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
$iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation = 0;
$oItemList = $oBasket->GetBasketContents();
$oItemList->GoToStart();
while ($oItem = &$oItemList->Next()) {
if ($oItem->fieldExcludeFromShippingCostCalculation) {
$iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dAmount;
$iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation += $oItem->dPriceTotalAfterDiscount;
}
}
$oItemList->GoToStart();
if ('absolut' == $this->fieldValueType) {
$this->dPrice = $this->fieldValue;
if ($this->fieldAddValueForEachArticle ||
($iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation > 0 &&
$oBasket->dTotalNumberOfArticles == $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation
)
) {
$this->dPrice = ($oBasket->dTotalNumberOfArticles - $iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
}
} else {
$this->dPrice = round($this->ApplyPriceModifiers(($oBasket->dCostArticlesTotalAfterDiscounts - $iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
}
} else {
// price based on current list
/** @var $oArticleList TShopBasketArticleList */
$oArticleList = &$this->GetAffectedBasketArticles();
if (!is_null($oArticleList)) {
$iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
$iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation = 0;
$oArticleList->GoToStart();
while ($oArticle = &$oArticleList->Next()) {
if ($oArticle->fieldExcludeFromShippingCostCalculation) {
$iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dAmount;
$iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation += $oArticle->dPriceTotalAfterDiscount;
}
}
$oArticleList->GoToStart();
if ('absolut' == $this->fieldValueType) {
$this->dPrice = $this->fieldValue;
if ($this->fieldAddValueForEachArticle ||
($iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation > 0 &&
$oArticleList->dNumberOfItems == $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation
)
) {
$this->dPrice = ($oArticleList->dNumberOfItems - $iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation) * $this->dPrice;
}
} else {
$this->dPrice = round($this->ApplyPriceModifiers(($oArticleList->dProductPrice - $iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation) * ($this->fieldValue / 100)), 2);
}
}
}
}
return $this->dPrice;
} | [
"public",
"function",
"GetPrice",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dPrice",
")",
")",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"0",
";",
"// price based on basket",
"if",
"(",
"$",
"this",
"->",
"fieldValueBasedOnEntireBasket",
")",
"{",
"$",
"oBasket",
"=",
"TShopBasket",
"::",
"GetInstance",
"(",
")",
";",
"$",
"iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
"=",
"0",
";",
"$",
"iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
"=",
"0",
";",
"$",
"oItemList",
"=",
"$",
"oBasket",
"->",
"GetBasketContents",
"(",
")",
";",
"$",
"oItemList",
"->",
"GoToStart",
"(",
")",
";",
"while",
"(",
"$",
"oItem",
"=",
"&",
"$",
"oItemList",
"->",
"Next",
"(",
")",
")",
"{",
"if",
"(",
"$",
"oItem",
"->",
"fieldExcludeFromShippingCostCalculation",
")",
"{",
"$",
"iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
"+=",
"$",
"oItem",
"->",
"dAmount",
";",
"$",
"iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
"+=",
"$",
"oItem",
"->",
"dPriceTotalAfterDiscount",
";",
"}",
"}",
"$",
"oItemList",
"->",
"GoToStart",
"(",
")",
";",
"if",
"(",
"'absolut'",
"==",
"$",
"this",
"->",
"fieldValueType",
")",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"$",
"this",
"->",
"fieldValue",
";",
"if",
"(",
"$",
"this",
"->",
"fieldAddValueForEachArticle",
"||",
"(",
"$",
"iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
">",
"0",
"&&",
"$",
"oBasket",
"->",
"dTotalNumberOfArticles",
"==",
"$",
"iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
")",
")",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"(",
"$",
"oBasket",
"->",
"dTotalNumberOfArticles",
"-",
"$",
"iTotalNumberOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
")",
"*",
"$",
"this",
"->",
"dPrice",
";",
"}",
"}",
"else",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"round",
"(",
"$",
"this",
"->",
"ApplyPriceModifiers",
"(",
"(",
"$",
"oBasket",
"->",
"dCostArticlesTotalAfterDiscounts",
"-",
"$",
"iTotalDiscountedPriceOfArticlesInBasketThatAreExcludedFromShippingCostCalculation",
")",
"*",
"(",
"$",
"this",
"->",
"fieldValue",
"/",
"100",
")",
")",
",",
"2",
")",
";",
"}",
"}",
"else",
"{",
"// price based on current list",
"/** @var $oArticleList TShopBasketArticleList */",
"$",
"oArticleList",
"=",
"&",
"$",
"this",
"->",
"GetAffectedBasketArticles",
"(",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"oArticleList",
")",
")",
"{",
"$",
"iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation",
"=",
"0",
";",
"$",
"iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation",
"=",
"0",
";",
"$",
"oArticleList",
"->",
"GoToStart",
"(",
")",
";",
"while",
"(",
"$",
"oArticle",
"=",
"&",
"$",
"oArticleList",
"->",
"Next",
"(",
")",
")",
"{",
"if",
"(",
"$",
"oArticle",
"->",
"fieldExcludeFromShippingCostCalculation",
")",
"{",
"$",
"iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation",
"+=",
"$",
"oArticle",
"->",
"dAmount",
";",
"$",
"iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation",
"+=",
"$",
"oArticle",
"->",
"dPriceTotalAfterDiscount",
";",
"}",
"}",
"$",
"oArticleList",
"->",
"GoToStart",
"(",
")",
";",
"if",
"(",
"'absolut'",
"==",
"$",
"this",
"->",
"fieldValueType",
")",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"$",
"this",
"->",
"fieldValue",
";",
"if",
"(",
"$",
"this",
"->",
"fieldAddValueForEachArticle",
"||",
"(",
"$",
"iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation",
">",
"0",
"&&",
"$",
"oArticleList",
"->",
"dNumberOfItems",
"==",
"$",
"iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation",
")",
")",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"(",
"$",
"oArticleList",
"->",
"dNumberOfItems",
"-",
"$",
"iTotalNumberOfArticlesInListThatAreExcludedFromShippingCostCalculation",
")",
"*",
"$",
"this",
"->",
"dPrice",
";",
"}",
"}",
"else",
"{",
"$",
"this",
"->",
"dPrice",
"=",
"round",
"(",
"$",
"this",
"->",
"ApplyPriceModifiers",
"(",
"(",
"$",
"oArticleList",
"->",
"dProductPrice",
"-",
"$",
"iTotalDiscountedPriceOfArticlesInListThatAreExcludedFromShippingCostCalculation",
")",
"*",
"(",
"$",
"this",
"->",
"fieldValue",
"/",
"100",
")",
")",
",",
"2",
")",
";",
"}",
"}",
"}",
"}",
"return",
"$",
"this",
"->",
"dPrice",
";",
"}"
] | return shipping type cost.
@return float | [
"return",
"shipping",
"type",
"cost",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingType.class.php#L332-L397 |
31,775 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopShippingType.class.php | TShopShippingType.ApplyPriceModifiers | protected function ApplyPriceModifiers($dPrice)
{
if ($this->fieldValueMin > 0 && $dPrice < $this->fieldValueMin) {
$dPrice = $this->fieldValueMin;
}
if ($this->fieldValueMax > 0 && $dPrice > $this->fieldValueMax) {
$dPrice = $this->fieldValueMax;
}
if ($this->fieldValueAdditional > 0) {
$dPrice = $dPrice + $this->fieldValueAdditional;
}
return $dPrice;
} | php | protected function ApplyPriceModifiers($dPrice)
{
if ($this->fieldValueMin > 0 && $dPrice < $this->fieldValueMin) {
$dPrice = $this->fieldValueMin;
}
if ($this->fieldValueMax > 0 && $dPrice > $this->fieldValueMax) {
$dPrice = $this->fieldValueMax;
}
if ($this->fieldValueAdditional > 0) {
$dPrice = $dPrice + $this->fieldValueAdditional;
}
return $dPrice;
} | [
"protected",
"function",
"ApplyPriceModifiers",
"(",
"$",
"dPrice",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fieldValueMin",
">",
"0",
"&&",
"$",
"dPrice",
"<",
"$",
"this",
"->",
"fieldValueMin",
")",
"{",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"fieldValueMin",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"fieldValueMax",
">",
"0",
"&&",
"$",
"dPrice",
">",
"$",
"this",
"->",
"fieldValueMax",
")",
"{",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"fieldValueMax",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"fieldValueAdditional",
">",
"0",
")",
"{",
"$",
"dPrice",
"=",
"$",
"dPrice",
"+",
"$",
"this",
"->",
"fieldValueAdditional",
";",
"}",
"return",
"$",
"dPrice",
";",
"}"
] | Applies additional price modifiers as defined in the shipping type
record.
@param float $dPrice
@return float $dPrice | [
"Applies",
"additional",
"price",
"modifiers",
"as",
"defined",
"in",
"the",
"shipping",
"type",
"record",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopShippingType.class.php#L456-L469 |
31,776 | PGB-LIV/php-ms | src/Reader/FastaEntry/PeffFastaEntry.php | PeffFastaEntry.parseAttributes | private function parseAttributes(Protein $protein, array $attributes)
{
if (isset($attributes[PsiVerb::NCBI_TAX_ID])) {
$organism = Organism::getInstance($attributes[PsiVerb::NCBI_TAX_ID]);
$protein->setOrganism($organism);
}
if (isset($attributes[PsiVerb::TAX_NAME])) {
if (! $protein->getOrganism()) {
$protein->setOrganism(new Organism());
}
$protein->getOrganism()->setName($attributes[PsiVerb::TAX_NAME]);
}
foreach ($attributes as $key => $value) {
switch ($key) {
case 'DbUniqueId':
$protein->setAccession($value);
break;
case 'GName':
$gene = Gene::getInstance($value);
$protein->setGene($gene);
break;
case 'SV':
$protein->getDatabaseEntry()->setSequenceVersion($value);
break;
case 'EV':
$protein->getDatabaseEntry()->setEntryVersion($value);
break;
case 'PE':
$protein->getDatabaseEntry()->setEvidence($value);
break;
case 'PName':
$protein->setDescription($value);
break;
case 'ModRes':
case 'ModResPsi':
case 'ModResUnimod':
$modifications = self::parseModifications($value);
$protein->addModifications($modifications);
break;
case PsiVerb::NCBI_TAX_ID:
case PsiVerb::TAX_NAME:
// Safe to ignore - already handled
break;
case 'Length':
case 'VariantSimple ':
case 'VariantComplex':
case 'Processed':
// Not supported
break;
default:
// Not supported
break;
}
}
} | php | private function parseAttributes(Protein $protein, array $attributes)
{
if (isset($attributes[PsiVerb::NCBI_TAX_ID])) {
$organism = Organism::getInstance($attributes[PsiVerb::NCBI_TAX_ID]);
$protein->setOrganism($organism);
}
if (isset($attributes[PsiVerb::TAX_NAME])) {
if (! $protein->getOrganism()) {
$protein->setOrganism(new Organism());
}
$protein->getOrganism()->setName($attributes[PsiVerb::TAX_NAME]);
}
foreach ($attributes as $key => $value) {
switch ($key) {
case 'DbUniqueId':
$protein->setAccession($value);
break;
case 'GName':
$gene = Gene::getInstance($value);
$protein->setGene($gene);
break;
case 'SV':
$protein->getDatabaseEntry()->setSequenceVersion($value);
break;
case 'EV':
$protein->getDatabaseEntry()->setEntryVersion($value);
break;
case 'PE':
$protein->getDatabaseEntry()->setEvidence($value);
break;
case 'PName':
$protein->setDescription($value);
break;
case 'ModRes':
case 'ModResPsi':
case 'ModResUnimod':
$modifications = self::parseModifications($value);
$protein->addModifications($modifications);
break;
case PsiVerb::NCBI_TAX_ID:
case PsiVerb::TAX_NAME:
// Safe to ignore - already handled
break;
case 'Length':
case 'VariantSimple ':
case 'VariantComplex':
case 'Processed':
// Not supported
break;
default:
// Not supported
break;
}
}
} | [
"private",
"function",
"parseAttributes",
"(",
"Protein",
"$",
"protein",
",",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"PsiVerb",
"::",
"NCBI_TAX_ID",
"]",
")",
")",
"{",
"$",
"organism",
"=",
"Organism",
"::",
"getInstance",
"(",
"$",
"attributes",
"[",
"PsiVerb",
"::",
"NCBI_TAX_ID",
"]",
")",
";",
"$",
"protein",
"->",
"setOrganism",
"(",
"$",
"organism",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"PsiVerb",
"::",
"TAX_NAME",
"]",
")",
")",
"{",
"if",
"(",
"!",
"$",
"protein",
"->",
"getOrganism",
"(",
")",
")",
"{",
"$",
"protein",
"->",
"setOrganism",
"(",
"new",
"Organism",
"(",
")",
")",
";",
"}",
"$",
"protein",
"->",
"getOrganism",
"(",
")",
"->",
"setName",
"(",
"$",
"attributes",
"[",
"PsiVerb",
"::",
"TAX_NAME",
"]",
")",
";",
"}",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"key",
")",
"{",
"case",
"'DbUniqueId'",
":",
"$",
"protein",
"->",
"setAccession",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"'GName'",
":",
"$",
"gene",
"=",
"Gene",
"::",
"getInstance",
"(",
"$",
"value",
")",
";",
"$",
"protein",
"->",
"setGene",
"(",
"$",
"gene",
")",
";",
"break",
";",
"case",
"'SV'",
":",
"$",
"protein",
"->",
"getDatabaseEntry",
"(",
")",
"->",
"setSequenceVersion",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"'EV'",
":",
"$",
"protein",
"->",
"getDatabaseEntry",
"(",
")",
"->",
"setEntryVersion",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"'PE'",
":",
"$",
"protein",
"->",
"getDatabaseEntry",
"(",
")",
"->",
"setEvidence",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"'PName'",
":",
"$",
"protein",
"->",
"setDescription",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"'ModRes'",
":",
"case",
"'ModResPsi'",
":",
"case",
"'ModResUnimod'",
":",
"$",
"modifications",
"=",
"self",
"::",
"parseModifications",
"(",
"$",
"value",
")",
";",
"$",
"protein",
"->",
"addModifications",
"(",
"$",
"modifications",
")",
";",
"break",
";",
"case",
"PsiVerb",
"::",
"NCBI_TAX_ID",
":",
"case",
"PsiVerb",
"::",
"TAX_NAME",
":",
"// Safe to ignore - already handled",
"break",
";",
"case",
"'Length'",
":",
"case",
"'VariantSimple '",
":",
"case",
"'VariantComplex'",
":",
"case",
"'Processed'",
":",
"// Not supported",
"break",
";",
"default",
":",
"// Not supported",
"break",
";",
"}",
"}",
"}"
] | Parses the attribute array and inputs the data into the protein
@param Protein $protein
Object to input values to
@param array $attributes
Array to read from
@return void | [
"Parses",
"the",
"attribute",
"array",
"and",
"inputs",
"the",
"data",
"into",
"the",
"protein"
] | 091751eb12512f4bc6ada07bda745ce49331e24f | https://github.com/PGB-LIV/php-ms/blob/091751eb12512f4bc6ada07bda745ce49331e24f/src/Reader/FastaEntry/PeffFastaEntry.php#L89-L146 |
31,777 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/AddressConsentSample.php | AddressConsentSample.getOrderReferenceDetails | public function getOrderReferenceDetails($addressConsentToken = null)
{
$getOrderReferenceDetailsRequest = new OffAmazonPaymentsService_Model_GetOrderReferenceDetailsRequest();
$getOrderReferenceDetailsRequest->setSellerId($this->_sellerId);
$getOrderReferenceDetailsRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
if (is_null($addressConsentToken) == FALSE) {
$decodedToken = urldecode($addressConsentToken);
$getOrderReferenceDetailsRequest->setAddressConsentToken($decodedToken);
}
return $this->_service->getOrderReferenceDetails($getOrderReferenceDetailsRequest);
} | php | public function getOrderReferenceDetails($addressConsentToken = null)
{
$getOrderReferenceDetailsRequest = new OffAmazonPaymentsService_Model_GetOrderReferenceDetailsRequest();
$getOrderReferenceDetailsRequest->setSellerId($this->_sellerId);
$getOrderReferenceDetailsRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
if (is_null($addressConsentToken) == FALSE) {
$decodedToken = urldecode($addressConsentToken);
$getOrderReferenceDetailsRequest->setAddressConsentToken($decodedToken);
}
return $this->_service->getOrderReferenceDetails($getOrderReferenceDetailsRequest);
} | [
"public",
"function",
"getOrderReferenceDetails",
"(",
"$",
"addressConsentToken",
"=",
"null",
")",
"{",
"$",
"getOrderReferenceDetailsRequest",
"=",
"new",
"OffAmazonPaymentsService_Model_GetOrderReferenceDetailsRequest",
"(",
")",
";",
"$",
"getOrderReferenceDetailsRequest",
"->",
"setSellerId",
"(",
"$",
"this",
"->",
"_sellerId",
")",
";",
"$",
"getOrderReferenceDetailsRequest",
"->",
"setAmazonOrderReferenceId",
"(",
"$",
"this",
"->",
"_amazonOrderReferenceId",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"addressConsentToken",
")",
"==",
"FALSE",
")",
"{",
"$",
"decodedToken",
"=",
"urldecode",
"(",
"$",
"addressConsentToken",
")",
";",
"$",
"getOrderReferenceDetailsRequest",
"->",
"setAddressConsentToken",
"(",
"$",
"decodedToken",
")",
";",
"}",
"return",
"$",
"this",
"->",
"_service",
"->",
"getOrderReferenceDetails",
"(",
"$",
"getOrderReferenceDetailsRequest",
")",
";",
"}"
] | Use the order reference object to query the order information, including
the current physical delivery address as selected by the buyer
@return OffAmazonPaymentsService_Model_GetOrderReferenceDetailsResponse service response | [
"Use",
"the",
"order",
"reference",
"object",
"to",
"query",
"the",
"order",
"information",
"including",
"the",
"current",
"physical",
"delivery",
"address",
"as",
"selected",
"by",
"the",
"buyer"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/AddressConsentSample.php#L64-L76 |
31,778 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php | XmlNotificationParser.parseIpnMessage | public static function parseIpnMessage(Message $ipnMsg)
{
$xmlDocumentElement = self::_getXmlFromIpnMessage($ipnMsg);
return self::_createNotificationForNotificationType(
$ipnMsg,
$xmlDocumentElement
);
} | php | public static function parseIpnMessage(Message $ipnMsg)
{
$xmlDocumentElement = self::_getXmlFromIpnMessage($ipnMsg);
return self::_createNotificationForNotificationType(
$ipnMsg,
$xmlDocumentElement
);
} | [
"public",
"static",
"function",
"parseIpnMessage",
"(",
"Message",
"$",
"ipnMsg",
")",
"{",
"$",
"xmlDocumentElement",
"=",
"self",
"::",
"_getXmlFromIpnMessage",
"(",
"$",
"ipnMsg",
")",
";",
"return",
"self",
"::",
"_createNotificationForNotificationType",
"(",
"$",
"ipnMsg",
",",
"$",
"xmlDocumentElement",
")",
";",
"}"
] | Converts a ipn message into a
notification object
@param JsonMesssage $ipnMsg ipnMessage
@throws OffAmazonPaymentsNotifications if there is an error
@return Message | [
"Converts",
"a",
"ipn",
"message",
"into",
"a",
"notification",
"object"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php#L41-L49 |
31,779 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php | XmlNotificationParser._getXmlFromIpnMessage | private static function _getXmlFromIpnMessage(Message $ipnMsg)
{
// Try and load the notification data as xml
$notificationData = $ipnMsg->getMandatoryField("NotificationData");
$dom = new DOMDocument();
try {
$dom->loadXML($notificationData);
} catch (Exception $ex) {
throw new OffAmazonPaymentsNotifications_InvalidMessageException(
"Error with ipn message - NotificationData field does not contain xml, " .
"contents: " . $notificationData
);
}
return $dom->documentElement;
} | php | private static function _getXmlFromIpnMessage(Message $ipnMsg)
{
// Try and load the notification data as xml
$notificationData = $ipnMsg->getMandatoryField("NotificationData");
$dom = new DOMDocument();
try {
$dom->loadXML($notificationData);
} catch (Exception $ex) {
throw new OffAmazonPaymentsNotifications_InvalidMessageException(
"Error with ipn message - NotificationData field does not contain xml, " .
"contents: " . $notificationData
);
}
return $dom->documentElement;
} | [
"private",
"static",
"function",
"_getXmlFromIpnMessage",
"(",
"Message",
"$",
"ipnMsg",
")",
"{",
"// Try and load the notification data as xml",
"$",
"notificationData",
"=",
"$",
"ipnMsg",
"->",
"getMandatoryField",
"(",
"\"NotificationData\"",
")",
";",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
")",
";",
"try",
"{",
"$",
"dom",
"->",
"loadXML",
"(",
"$",
"notificationData",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"ex",
")",
"{",
"throw",
"new",
"OffAmazonPaymentsNotifications_InvalidMessageException",
"(",
"\"Error with ipn message - NotificationData field does not contain xml, \"",
".",
"\"contents: \"",
".",
"$",
"notificationData",
")",
";",
"}",
"return",
"$",
"dom",
"->",
"documentElement",
";",
"}"
] | Convert the xml message from the ipn payload
into an xml document
@param Message $ipnMsg ipn message
@throws OffAmazonPaymentsNotifications_InvalidMessageException
@return XmlElement xml document element | [
"Convert",
"the",
"xml",
"message",
"from",
"the",
"ipn",
"payload",
"into",
"an",
"xml",
"document"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php#L61-L77 |
31,780 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php | XmlNotificationParser._createNotificationForNotificationType | private static function _createNotificationForNotificationType(
Message $ipnMsg,
$xmlDocumentElement
) {
// Construct an instance of the notification class
switch ($ipnMsg->getMandatoryField("NotificationType")) {
case "OrderReferenceNotification":
$notification
= new OffAmazonPaymentsNotifications_Model_OrderReferenceNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "BillingAgreementNotification":
$notification
= new OffAmazonPaymentsNotifications_Model_BillingAgreementNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "PaymentAuthorize":
$notification
= new OffAmazonPaymentsNotifications_Model_AuthorizationNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "PaymentCapture":
$notification
= new OffAmazonPaymentsNotifications_Model_CaptureNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "PaymentRefund":
$notification
= new OffAmazonPaymentsNotifications_Model_RefundNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
default:
throw new OffAmazonPaymentsNotifications_InvalidMessageException(
"Error with IPN notification - unknown notification " .
$ipnMsg->getMandatoryField("NotificationType")
);
}
return $notification;
} | php | private static function _createNotificationForNotificationType(
Message $ipnMsg,
$xmlDocumentElement
) {
// Construct an instance of the notification class
switch ($ipnMsg->getMandatoryField("NotificationType")) {
case "OrderReferenceNotification":
$notification
= new OffAmazonPaymentsNotifications_Model_OrderReferenceNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "BillingAgreementNotification":
$notification
= new OffAmazonPaymentsNotifications_Model_BillingAgreementNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "PaymentAuthorize":
$notification
= new OffAmazonPaymentsNotifications_Model_AuthorizationNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "PaymentCapture":
$notification
= new OffAmazonPaymentsNotifications_Model_CaptureNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
case "PaymentRefund":
$notification
= new OffAmazonPaymentsNotifications_Model_RefundNotification(
$ipnMsg->getNotificationMetadata(),
$xmlDocumentElement
);
break;
default:
throw new OffAmazonPaymentsNotifications_InvalidMessageException(
"Error with IPN notification - unknown notification " .
$ipnMsg->getMandatoryField("NotificationType")
);
}
return $notification;
} | [
"private",
"static",
"function",
"_createNotificationForNotificationType",
"(",
"Message",
"$",
"ipnMsg",
",",
"$",
"xmlDocumentElement",
")",
"{",
"// Construct an instance of the notification class",
"switch",
"(",
"$",
"ipnMsg",
"->",
"getMandatoryField",
"(",
"\"NotificationType\"",
")",
")",
"{",
"case",
"\"OrderReferenceNotification\"",
":",
"$",
"notification",
"=",
"new",
"OffAmazonPaymentsNotifications_Model_OrderReferenceNotification",
"(",
"$",
"ipnMsg",
"->",
"getNotificationMetadata",
"(",
")",
",",
"$",
"xmlDocumentElement",
")",
";",
"break",
";",
"case",
"\"BillingAgreementNotification\"",
":",
"$",
"notification",
"=",
"new",
"OffAmazonPaymentsNotifications_Model_BillingAgreementNotification",
"(",
"$",
"ipnMsg",
"->",
"getNotificationMetadata",
"(",
")",
",",
"$",
"xmlDocumentElement",
")",
";",
"break",
";",
"case",
"\"PaymentAuthorize\"",
":",
"$",
"notification",
"=",
"new",
"OffAmazonPaymentsNotifications_Model_AuthorizationNotification",
"(",
"$",
"ipnMsg",
"->",
"getNotificationMetadata",
"(",
")",
",",
"$",
"xmlDocumentElement",
")",
";",
"break",
";",
"case",
"\"PaymentCapture\"",
":",
"$",
"notification",
"=",
"new",
"OffAmazonPaymentsNotifications_Model_CaptureNotification",
"(",
"$",
"ipnMsg",
"->",
"getNotificationMetadata",
"(",
")",
",",
"$",
"xmlDocumentElement",
")",
";",
"break",
";",
"case",
"\"PaymentRefund\"",
":",
"$",
"notification",
"=",
"new",
"OffAmazonPaymentsNotifications_Model_RefundNotification",
"(",
"$",
"ipnMsg",
"->",
"getNotificationMetadata",
"(",
")",
",",
"$",
"xmlDocumentElement",
")",
";",
"break",
";",
"default",
":",
"throw",
"new",
"OffAmazonPaymentsNotifications_InvalidMessageException",
"(",
"\"Error with IPN notification - unknown notification \"",
".",
"$",
"ipnMsg",
"->",
"getMandatoryField",
"(",
"\"NotificationType\"",
")",
")",
";",
"}",
"return",
"$",
"notification",
";",
"}"
] | Return a notification object initialised by the xml
@param Message $ipnMsg ipn message
@param XmlNode $xmlDocumentElement xml message
@throws OffAmazonPaymentsNotifications_InvalidMessageException
@return OffAmazonPaymentsNotifications_Notification | [
"Return",
"a",
"notification",
"object",
"initialised",
"by",
"the",
"xml"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/XmlNotificationParser.php#L91-L140 |
31,781 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php | TShopPaymentHandlerMontrada.GetMontradaRequstHash | protected function GetMontradaRequstHash($aInput)
{
$sDelimiter = '-';
$sString = $this->GetConfigParameter('secret').$sDelimiter;
$sString .= $this->GetConfigParameter('merchid').$sDelimiter;
$sString .= $aInput['orderid'].$sDelimiter;
$sString .= $this->GetConfigParameter('payments').$sDelimiter;
$sString .= $aInput['amount'].$sDelimiter;
$sString .= $aInput['currency'].$sDelimiter;
$sString .= $aInput['command'].$sDelimiter;
$sString .= $aInput['timestamp'];
return hash('sha256', $sString);
} | php | protected function GetMontradaRequstHash($aInput)
{
$sDelimiter = '-';
$sString = $this->GetConfigParameter('secret').$sDelimiter;
$sString .= $this->GetConfigParameter('merchid').$sDelimiter;
$sString .= $aInput['orderid'].$sDelimiter;
$sString .= $this->GetConfigParameter('payments').$sDelimiter;
$sString .= $aInput['amount'].$sDelimiter;
$sString .= $aInput['currency'].$sDelimiter;
$sString .= $aInput['command'].$sDelimiter;
$sString .= $aInput['timestamp'];
return hash('sha256', $sString);
} | [
"protected",
"function",
"GetMontradaRequstHash",
"(",
"$",
"aInput",
")",
"{",
"$",
"sDelimiter",
"=",
"'-'",
";",
"$",
"sString",
"=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'secret'",
")",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'merchid'",
")",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'orderid'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'payments'",
")",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'amount'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'currency'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'command'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'timestamp'",
"]",
";",
"return",
"hash",
"(",
"'sha256'",
",",
"$",
"sString",
")",
";",
"}"
] | calculate request hash.
@param array $aInput
@return string | [
"calculate",
"request",
"hash",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php#L64-L78 |
31,782 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php | TShopPaymentHandlerMontrada.GetMontradaResponseHash | protected function GetMontradaResponseHash($aInput)
{
$sDelimiter = '-';
$sString = $this->GetConfigParameter('secret').$sDelimiter;
$sString .= $this->GetConfigParameter('merchid').$sDelimiter;
$sString .= $aInput['orderid'].$sDelimiter;
$sString .= $aInput['amount'].$sDelimiter;
$sString .= $aInput['currency'].$sDelimiter;
$sString .= $aInput['result'].$sDelimiter;
if (array_key_exists('trefnum', $aInput) && !empty($aInput['trefnum'])) {
$sString .= $aInput['trefnum'].$sDelimiter;
}
$sString .= $aInput['timestamp'];
return hash('sha256', $sString);
} | php | protected function GetMontradaResponseHash($aInput)
{
$sDelimiter = '-';
$sString = $this->GetConfigParameter('secret').$sDelimiter;
$sString .= $this->GetConfigParameter('merchid').$sDelimiter;
$sString .= $aInput['orderid'].$sDelimiter;
$sString .= $aInput['amount'].$sDelimiter;
$sString .= $aInput['currency'].$sDelimiter;
$sString .= $aInput['result'].$sDelimiter;
if (array_key_exists('trefnum', $aInput) && !empty($aInput['trefnum'])) {
$sString .= $aInput['trefnum'].$sDelimiter;
}
$sString .= $aInput['timestamp'];
return hash('sha256', $sString);
} | [
"protected",
"function",
"GetMontradaResponseHash",
"(",
"$",
"aInput",
")",
"{",
"$",
"sDelimiter",
"=",
"'-'",
";",
"$",
"sString",
"=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'secret'",
")",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'merchid'",
")",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'orderid'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'amount'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'currency'",
"]",
".",
"$",
"sDelimiter",
";",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'result'",
"]",
".",
"$",
"sDelimiter",
";",
"if",
"(",
"array_key_exists",
"(",
"'trefnum'",
",",
"$",
"aInput",
")",
"&&",
"!",
"empty",
"(",
"$",
"aInput",
"[",
"'trefnum'",
"]",
")",
")",
"{",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'trefnum'",
"]",
".",
"$",
"sDelimiter",
";",
"}",
"$",
"sString",
".=",
"$",
"aInput",
"[",
"'timestamp'",
"]",
";",
"return",
"hash",
"(",
"'sha256'",
",",
"$",
"sString",
")",
";",
"}"
] | calculate response hash.
@param array $aInput
@return string | [
"calculate",
"response",
"hash",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php#L87-L103 |
31,783 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php | TShopPaymentHandlerMontrada.GetAnswerFromServer | public function GetAnswerFromServer($aData, $sMessageConsumer)
{
$bSuccess = false;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->GetConfigParameter('url'));
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
$aParameter = array();
foreach ($aData as $sKey => $sVal) {
if (!array_key_exists($sKey, $aParameter)) {
$aParameter[$sKey] = $sVal;
}
}
$sData = str_replace('&', '&', TTools::GetArrayAsURL($aParameter));
curl_setopt($ch, CURLOPT_POSTFIELDS, $sData);
$response = curl_exec($ch);
if (curl_errno($ch)) {
TTools::WriteLogEntry('Call Montrada Page: '.print_r($aData, true).' - '.curl_errno($ch).' - '.curl_error($ch), 1, __FILE__, __LINE__);
$oMsgManager = TCMSMessageManager::GetInstance();
$oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.payment_montrada.error_request'))));
return $bSuccess;
} else {
curl_close($ch);
}
$aParts = explode("\n", $response);
foreach ($aParts as $sHeader) {
header($sHeader);
}
return $bSuccess;
} | php | public function GetAnswerFromServer($aData, $sMessageConsumer)
{
$bSuccess = false;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->GetConfigParameter('url'));
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
$aParameter = array();
foreach ($aData as $sKey => $sVal) {
if (!array_key_exists($sKey, $aParameter)) {
$aParameter[$sKey] = $sVal;
}
}
$sData = str_replace('&', '&', TTools::GetArrayAsURL($aParameter));
curl_setopt($ch, CURLOPT_POSTFIELDS, $sData);
$response = curl_exec($ch);
if (curl_errno($ch)) {
TTools::WriteLogEntry('Call Montrada Page: '.print_r($aData, true).' - '.curl_errno($ch).' - '.curl_error($ch), 1, __FILE__, __LINE__);
$oMsgManager = TCMSMessageManager::GetInstance();
$oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => TGlobal::OutHTML(TGlobal::Translate('chameleon_system_shop.payment_montrada.error_request'))));
return $bSuccess;
} else {
curl_close($ch);
}
$aParts = explode("\n", $response);
foreach ($aParts as $sHeader) {
header($sHeader);
}
return $bSuccess;
} | [
"public",
"function",
"GetAnswerFromServer",
"(",
"$",
"aData",
",",
"$",
"sMessageConsumer",
")",
"{",
"$",
"bSuccess",
"=",
"false",
";",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
"$",
"this",
"->",
"GetConfigParameter",
"(",
"'url'",
")",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_VERBOSE",
",",
"1",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_SSL_VERIFYPEER",
",",
"true",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_SSL_VERIFYHOST",
",",
"2",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_RETURNTRANSFER",
",",
"true",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_POST",
",",
"1",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_HEADER",
",",
"1",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_USERAGENT",
",",
"'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_REFERER",
",",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
")",
";",
"$",
"aParameter",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"aData",
"as",
"$",
"sKey",
"=>",
"$",
"sVal",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"sKey",
",",
"$",
"aParameter",
")",
")",
"{",
"$",
"aParameter",
"[",
"$",
"sKey",
"]",
"=",
"$",
"sVal",
";",
"}",
"}",
"$",
"sData",
"=",
"str_replace",
"(",
"'&'",
",",
"'&'",
",",
"TTools",
"::",
"GetArrayAsURL",
"(",
"$",
"aParameter",
")",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_POSTFIELDS",
",",
"$",
"sData",
")",
";",
"$",
"response",
"=",
"curl_exec",
"(",
"$",
"ch",
")",
";",
"if",
"(",
"curl_errno",
"(",
"$",
"ch",
")",
")",
"{",
"TTools",
"::",
"WriteLogEntry",
"(",
"'Call Montrada Page: '",
".",
"print_r",
"(",
"$",
"aData",
",",
"true",
")",
".",
"' - '",
".",
"curl_errno",
"(",
"$",
"ch",
")",
".",
"' - '",
".",
"curl_error",
"(",
"$",
"ch",
")",
",",
"1",
",",
"__FILE__",
",",
"__LINE__",
")",
";",
"$",
"oMsgManager",
"=",
"TCMSMessageManager",
"::",
"GetInstance",
"(",
")",
";",
"$",
"oMsgManager",
"->",
"AddMessage",
"(",
"$",
"sMessageConsumer",
",",
"'ERROR-ORDER-REQUEST-PAYMENT-ERROR'",
",",
"array",
"(",
"'errorMsg'",
"=>",
"TGlobal",
"::",
"OutHTML",
"(",
"TGlobal",
"::",
"Translate",
"(",
"'chameleon_system_shop.payment_montrada.error_request'",
")",
")",
")",
")",
";",
"return",
"$",
"bSuccess",
";",
"}",
"else",
"{",
"curl_close",
"(",
"$",
"ch",
")",
";",
"}",
"$",
"aParts",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"response",
")",
";",
"foreach",
"(",
"$",
"aParts",
"as",
"$",
"sHeader",
")",
"{",
"header",
"(",
"$",
"sHeader",
")",
";",
"}",
"return",
"$",
"bSuccess",
";",
"}"
] | Send Call per POST to montrada. Response is a moved permanently header which we pass through.
@param array $aData - the post data to be send to montrada | [
"Send",
"Call",
"per",
"POST",
"to",
"montrada",
".",
"Response",
"is",
"a",
"moved",
"permanently",
"header",
"which",
"we",
"pass",
"through",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php#L193-L233 |
31,784 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php | TShopPaymentHandlerMontrada.ExecutePayment | public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
{
$bPaymentOk = parent::ExecutePayment($oOrder);
$aCommand = array('trefnum' => $this->sMontradaTransactionId, 'amount' => round($oOrder->fieldValueTotal * 100));
$aAnswer = $this->ExecuteRequestCall('capture', $aCommand);
if (array_key_exists('rc', $aAnswer) && '000' == $aAnswer['rc']) {
$bPaymentOk = true;
// add the response data to the order
foreach ($aAnswer as $sKey => $sVal) {
if (!array_key_exists($sKey, $this->aPaymentUserData)) {
$this->aPaymentUserData[$sKey] = $sVal;
}
}
$this->SaveUserPaymentDataToOrder($oOrder->id);
$oOrder->SetStatusPaid();
} else {
$bPaymentOk = false;
}
if (!$bPaymentOk) {
// error!
$sMsg = 'unbekannt';
if (array_key_exists('rmsg', $aAnswer)) {
$sMsg = $aAnswer['rmsg'];
}
$oMsgManager = TCMSMessageManager::GetInstance();
$oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $sMsg));
}
return $bPaymentOk;
} | php | public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
{
$bPaymentOk = parent::ExecutePayment($oOrder);
$aCommand = array('trefnum' => $this->sMontradaTransactionId, 'amount' => round($oOrder->fieldValueTotal * 100));
$aAnswer = $this->ExecuteRequestCall('capture', $aCommand);
if (array_key_exists('rc', $aAnswer) && '000' == $aAnswer['rc']) {
$bPaymentOk = true;
// add the response data to the order
foreach ($aAnswer as $sKey => $sVal) {
if (!array_key_exists($sKey, $this->aPaymentUserData)) {
$this->aPaymentUserData[$sKey] = $sVal;
}
}
$this->SaveUserPaymentDataToOrder($oOrder->id);
$oOrder->SetStatusPaid();
} else {
$bPaymentOk = false;
}
if (!$bPaymentOk) {
// error!
$sMsg = 'unbekannt';
if (array_key_exists('rmsg', $aAnswer)) {
$sMsg = $aAnswer['rmsg'];
}
$oMsgManager = TCMSMessageManager::GetInstance();
$oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $sMsg));
}
return $bPaymentOk;
} | [
"public",
"function",
"ExecutePayment",
"(",
"TdbShopOrder",
"&",
"$",
"oOrder",
",",
"$",
"sMessageConsumer",
"=",
"''",
")",
"{",
"$",
"bPaymentOk",
"=",
"parent",
"::",
"ExecutePayment",
"(",
"$",
"oOrder",
")",
";",
"$",
"aCommand",
"=",
"array",
"(",
"'trefnum'",
"=>",
"$",
"this",
"->",
"sMontradaTransactionId",
",",
"'amount'",
"=>",
"round",
"(",
"$",
"oOrder",
"->",
"fieldValueTotal",
"*",
"100",
")",
")",
";",
"$",
"aAnswer",
"=",
"$",
"this",
"->",
"ExecuteRequestCall",
"(",
"'capture'",
",",
"$",
"aCommand",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'rc'",
",",
"$",
"aAnswer",
")",
"&&",
"'000'",
"==",
"$",
"aAnswer",
"[",
"'rc'",
"]",
")",
"{",
"$",
"bPaymentOk",
"=",
"true",
";",
"// add the response data to the order",
"foreach",
"(",
"$",
"aAnswer",
"as",
"$",
"sKey",
"=>",
"$",
"sVal",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"sKey",
",",
"$",
"this",
"->",
"aPaymentUserData",
")",
")",
"{",
"$",
"this",
"->",
"aPaymentUserData",
"[",
"$",
"sKey",
"]",
"=",
"$",
"sVal",
";",
"}",
"}",
"$",
"this",
"->",
"SaveUserPaymentDataToOrder",
"(",
"$",
"oOrder",
"->",
"id",
")",
";",
"$",
"oOrder",
"->",
"SetStatusPaid",
"(",
")",
";",
"}",
"else",
"{",
"$",
"bPaymentOk",
"=",
"false",
";",
"}",
"if",
"(",
"!",
"$",
"bPaymentOk",
")",
"{",
"// error!",
"$",
"sMsg",
"=",
"'unbekannt'",
";",
"if",
"(",
"array_key_exists",
"(",
"'rmsg'",
",",
"$",
"aAnswer",
")",
")",
"{",
"$",
"sMsg",
"=",
"$",
"aAnswer",
"[",
"'rmsg'",
"]",
";",
"}",
"$",
"oMsgManager",
"=",
"TCMSMessageManager",
"::",
"GetInstance",
"(",
")",
";",
"$",
"oMsgManager",
"->",
"AddMessage",
"(",
"$",
"sMessageConsumer",
",",
"'ERROR-ORDER-REQUEST-PAYMENT-ERROR'",
",",
"array",
"(",
"'errorMsg'",
"=>",
"$",
"sMsg",
")",
")",
";",
"}",
"return",
"$",
"bPaymentOk",
";",
"}"
] | executes payment for order - in this case, we commit the montrada payment.
@param TdbShopOrder $oOrder
@param string $sMessageConsumer - send error messages here
@return bool | [
"executes",
"payment",
"for",
"order",
"-",
"in",
"this",
"case",
"we",
"commit",
"the",
"montrada",
"payment",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php#L290-L321 |
31,785 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/PostProcessor/FileOverrider.php | FileOverrider.createNewOverride | public function createNewOverride(string $pathToFileInProject): string
{
$relativePathToFileInProject = $this->getRelativePathToFile($pathToFileInProject);
if (null !== $this->getOverrideForPath($relativePathToFileInProject)) {
throw new \RuntimeException('Override already exists for path ' . $relativePathToFileInProject);
}
$overridePath =
$this->getOverrideDirectoryForFile($relativePathToFileInProject) .
'/' . $this->getFileNameNoExtensionForPathInProject($relativePathToFileInProject) .
'.' . $this->getProjectFileHash($relativePathToFileInProject) .
'.php.override';
$pathToFileInProject = $this->pathToProjectRoot . '/' . $relativePathToFileInProject;
if (false === is_file($pathToFileInProject)) {
throw new \RuntimeException('path ' . $pathToFileInProject . ' is not a file');
}
copy($pathToFileInProject, $overridePath);
return $this->getRelativePathToFile($overridePath);
} | php | public function createNewOverride(string $pathToFileInProject): string
{
$relativePathToFileInProject = $this->getRelativePathToFile($pathToFileInProject);
if (null !== $this->getOverrideForPath($relativePathToFileInProject)) {
throw new \RuntimeException('Override already exists for path ' . $relativePathToFileInProject);
}
$overridePath =
$this->getOverrideDirectoryForFile($relativePathToFileInProject) .
'/' . $this->getFileNameNoExtensionForPathInProject($relativePathToFileInProject) .
'.' . $this->getProjectFileHash($relativePathToFileInProject) .
'.php.override';
$pathToFileInProject = $this->pathToProjectRoot . '/' . $relativePathToFileInProject;
if (false === is_file($pathToFileInProject)) {
throw new \RuntimeException('path ' . $pathToFileInProject . ' is not a file');
}
copy($pathToFileInProject, $overridePath);
return $this->getRelativePathToFile($overridePath);
} | [
"public",
"function",
"createNewOverride",
"(",
"string",
"$",
"pathToFileInProject",
")",
":",
"string",
"{",
"$",
"relativePathToFileInProject",
"=",
"$",
"this",
"->",
"getRelativePathToFile",
"(",
"$",
"pathToFileInProject",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"getOverrideForPath",
"(",
"$",
"relativePathToFileInProject",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Override already exists for path '",
".",
"$",
"relativePathToFileInProject",
")",
";",
"}",
"$",
"overridePath",
"=",
"$",
"this",
"->",
"getOverrideDirectoryForFile",
"(",
"$",
"relativePathToFileInProject",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getFileNameNoExtensionForPathInProject",
"(",
"$",
"relativePathToFileInProject",
")",
".",
"'.'",
".",
"$",
"this",
"->",
"getProjectFileHash",
"(",
"$",
"relativePathToFileInProject",
")",
".",
"'.php.override'",
";",
"$",
"pathToFileInProject",
"=",
"$",
"this",
"->",
"pathToProjectRoot",
".",
"'/'",
".",
"$",
"relativePathToFileInProject",
";",
"if",
"(",
"false",
"===",
"is_file",
"(",
"$",
"pathToFileInProject",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'path '",
".",
"$",
"pathToFileInProject",
".",
"' is not a file'",
")",
";",
"}",
"copy",
"(",
"$",
"pathToFileInProject",
",",
"$",
"overridePath",
")",
";",
"return",
"$",
"this",
"->",
"getRelativePathToFile",
"(",
"$",
"overridePath",
")",
";",
"}"
] | Create a new Override File by copying the file from the project into the project's overrides directory
@param string $pathToFileInProject
@return string | [
"Create",
"a",
"new",
"Override",
"File",
"by",
"copying",
"the",
"file",
"from",
"the",
"project",
"into",
"the",
"project",
"s",
"overrides",
"directory"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/PostProcessor/FileOverrider.php#L74-L92 |
31,786 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/PostProcessor/FileOverrider.php | FileOverrider.updateOverrideFiles | public function updateOverrideFiles(): array
{
$filesUpdated = [];
$fileSame = [];
foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
$relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
$fileSame[] = $relativePathToFileInProject;
continue;
}
$pathToFileInProject = $this->pathToProjectRoot . $relativePathToFileInProject;
if (false === is_file($pathToFileInProject)) {
throw new \RuntimeException('path ' . $pathToFileInProject . ' is not a file');
}
copy($pathToFileInProject, $pathToFileInOverrides);
$filesUpdated[] = $relativePathToFileInProject;
}
return [$this->sortFiles($filesUpdated), $this->sortFiles($fileSame)];
} | php | public function updateOverrideFiles(): array
{
$filesUpdated = [];
$fileSame = [];
foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
$relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
$fileSame[] = $relativePathToFileInProject;
continue;
}
$pathToFileInProject = $this->pathToProjectRoot . $relativePathToFileInProject;
if (false === is_file($pathToFileInProject)) {
throw new \RuntimeException('path ' . $pathToFileInProject . ' is not a file');
}
copy($pathToFileInProject, $pathToFileInOverrides);
$filesUpdated[] = $relativePathToFileInProject;
}
return [$this->sortFiles($filesUpdated), $this->sortFiles($fileSame)];
} | [
"public",
"function",
"updateOverrideFiles",
"(",
")",
":",
"array",
"{",
"$",
"filesUpdated",
"=",
"[",
"]",
";",
"$",
"fileSame",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getOverridesIterator",
"(",
")",
"as",
"$",
"pathToFileInOverrides",
")",
"{",
"$",
"relativePathToFileInProject",
"=",
"$",
"this",
"->",
"getRelativePathInProjectFromOverridePath",
"(",
"$",
"pathToFileInOverrides",
")",
";",
"if",
"(",
"$",
"this",
"->",
"projectFileIsSameAsOverride",
"(",
"$",
"pathToFileInOverrides",
")",
")",
"{",
"$",
"fileSame",
"[",
"]",
"=",
"$",
"relativePathToFileInProject",
";",
"continue",
";",
"}",
"$",
"pathToFileInProject",
"=",
"$",
"this",
"->",
"pathToProjectRoot",
".",
"$",
"relativePathToFileInProject",
";",
"if",
"(",
"false",
"===",
"is_file",
"(",
"$",
"pathToFileInProject",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'path '",
".",
"$",
"pathToFileInProject",
".",
"' is not a file'",
")",
";",
"}",
"copy",
"(",
"$",
"pathToFileInProject",
",",
"$",
"pathToFileInOverrides",
")",
";",
"$",
"filesUpdated",
"[",
"]",
"=",
"$",
"relativePathToFileInProject",
";",
"}",
"return",
"[",
"$",
"this",
"->",
"sortFiles",
"(",
"$",
"filesUpdated",
")",
",",
"$",
"this",
"->",
"sortFiles",
"(",
"$",
"fileSame",
")",
"]",
";",
"}"
] | Loop over all the override files and update with the file contents from the project
@return array[] the file paths that have been updated | [
"Loop",
"over",
"all",
"the",
"override",
"files",
"and",
"update",
"with",
"the",
"file",
"contents",
"from",
"the",
"project"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/PostProcessor/FileOverrider.php#L170-L189 |
31,787 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/PostProcessor/FileOverrider.php | FileOverrider.getOverridesIterator | private function getOverridesIterator(): \Generator
{
try {
$recursiveIterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator(
$this->getPathToOverridesDirectory(),
\RecursiveDirectoryIterator::SKIP_DOTS
),
\RecursiveIteratorIterator::SELF_FIRST
);
foreach ($recursiveIterator as $fileInfo) {
/**
* @var \SplFileInfo $fileInfo
*/
if ($fileInfo->isFile()) {
if (self::OVERRIDE_EXTENSION !== substr(
$fileInfo->getFilename(),
-strlen(self::OVERRIDE_EXTENSION)
)
) {
continue;
}
yield $fileInfo->getPathname();
}
}
} finally {
$recursiveIterator = null;
unset($recursiveIterator);
}
} | php | private function getOverridesIterator(): \Generator
{
try {
$recursiveIterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator(
$this->getPathToOverridesDirectory(),
\RecursiveDirectoryIterator::SKIP_DOTS
),
\RecursiveIteratorIterator::SELF_FIRST
);
foreach ($recursiveIterator as $fileInfo) {
/**
* @var \SplFileInfo $fileInfo
*/
if ($fileInfo->isFile()) {
if (self::OVERRIDE_EXTENSION !== substr(
$fileInfo->getFilename(),
-strlen(self::OVERRIDE_EXTENSION)
)
) {
continue;
}
yield $fileInfo->getPathname();
}
}
} finally {
$recursiveIterator = null;
unset($recursiveIterator);
}
} | [
"private",
"function",
"getOverridesIterator",
"(",
")",
":",
"\\",
"Generator",
"{",
"try",
"{",
"$",
"recursiveIterator",
"=",
"new",
"\\",
"RecursiveIteratorIterator",
"(",
"new",
"\\",
"RecursiveDirectoryIterator",
"(",
"$",
"this",
"->",
"getPathToOverridesDirectory",
"(",
")",
",",
"\\",
"RecursiveDirectoryIterator",
"::",
"SKIP_DOTS",
")",
",",
"\\",
"RecursiveIteratorIterator",
"::",
"SELF_FIRST",
")",
";",
"foreach",
"(",
"$",
"recursiveIterator",
"as",
"$",
"fileInfo",
")",
"{",
"/**\n * @var \\SplFileInfo $fileInfo\n */",
"if",
"(",
"$",
"fileInfo",
"->",
"isFile",
"(",
")",
")",
"{",
"if",
"(",
"self",
"::",
"OVERRIDE_EXTENSION",
"!==",
"substr",
"(",
"$",
"fileInfo",
"->",
"getFilename",
"(",
")",
",",
"-",
"strlen",
"(",
"self",
"::",
"OVERRIDE_EXTENSION",
")",
")",
")",
"{",
"continue",
";",
"}",
"yield",
"$",
"fileInfo",
"->",
"getPathname",
"(",
")",
";",
"}",
"}",
"}",
"finally",
"{",
"$",
"recursiveIterator",
"=",
"null",
";",
"unset",
"(",
"$",
"recursiveIterator",
")",
";",
"}",
"}"
] | Yield file paths in the override folder
@return \Generator|string[] | [
"Yield",
"file",
"paths",
"in",
"the",
"override",
"folder"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/PostProcessor/FileOverrider.php#L196-L225 |
31,788 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/PostProcessor/FileOverrider.php | FileOverrider.projectFileIsSameAsOverride | private function projectFileIsSameAsOverride(string $pathToFileInOverrides): bool
{
$relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
return $this->getFileHash($this->pathToProjectRoot . '/' . $relativePathToFileInProject) ===
$this->getFileHash($pathToFileInOverrides);
} | php | private function projectFileIsSameAsOverride(string $pathToFileInOverrides): bool
{
$relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
return $this->getFileHash($this->pathToProjectRoot . '/' . $relativePathToFileInProject) ===
$this->getFileHash($pathToFileInOverrides);
} | [
"private",
"function",
"projectFileIsSameAsOverride",
"(",
"string",
"$",
"pathToFileInOverrides",
")",
":",
"bool",
"{",
"$",
"relativePathToFileInProject",
"=",
"$",
"this",
"->",
"getRelativePathInProjectFromOverridePath",
"(",
"$",
"pathToFileInOverrides",
")",
";",
"return",
"$",
"this",
"->",
"getFileHash",
"(",
"$",
"this",
"->",
"pathToProjectRoot",
".",
"'/'",
".",
"$",
"relativePathToFileInProject",
")",
"===",
"$",
"this",
"->",
"getFileHash",
"(",
"$",
"pathToFileInOverrides",
")",
";",
"}"
] | Is the file in the project the same as the override file already?
@param string $pathToFileInOverrides
@return bool | [
"Is",
"the",
"file",
"in",
"the",
"project",
"the",
"same",
"as",
"the",
"override",
"file",
"already?"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/PostProcessor/FileOverrider.php#L246-L252 |
31,789 | edmondscommerce/doctrine-static-meta | src/CodeGeneration/PostProcessor/FileOverrider.php | FileOverrider.applyOverrides | public function applyOverrides(): array
{
$filesUpdated = [];
$filesSame = [];
$errors = [];
foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
$relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
if ($this->overrideFileHashIsCorrect($pathToFileInOverrides)) {
if (false === is_file($pathToFileInOverrides)) {
throw new \RuntimeException('path ' . $pathToFileInOverrides . ' is not a file');
}
copy($pathToFileInOverrides, $this->pathToProjectRoot . $relativePathToFileInProject);
$filesUpdated[] = $relativePathToFileInProject;
continue;
}
if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
$filesSame[] = $relativePathToFileInProject;
continue;
}
$errors[$pathToFileInOverrides] = $this->getProjectFileHash($relativePathToFileInProject);
}
if ([] !== $errors) {
throw new \RuntimeException('These file hashes were not up to date:' . print_r($errors, true));
}
return [$this->sortFiles($filesUpdated), $this->sortFiles($filesSame)];
} | php | public function applyOverrides(): array
{
$filesUpdated = [];
$filesSame = [];
$errors = [];
foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
$relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
if ($this->overrideFileHashIsCorrect($pathToFileInOverrides)) {
if (false === is_file($pathToFileInOverrides)) {
throw new \RuntimeException('path ' . $pathToFileInOverrides . ' is not a file');
}
copy($pathToFileInOverrides, $this->pathToProjectRoot . $relativePathToFileInProject);
$filesUpdated[] = $relativePathToFileInProject;
continue;
}
if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
$filesSame[] = $relativePathToFileInProject;
continue;
}
$errors[$pathToFileInOverrides] = $this->getProjectFileHash($relativePathToFileInProject);
}
if ([] !== $errors) {
throw new \RuntimeException('These file hashes were not up to date:' . print_r($errors, true));
}
return [$this->sortFiles($filesUpdated), $this->sortFiles($filesSame)];
} | [
"public",
"function",
"applyOverrides",
"(",
")",
":",
"array",
"{",
"$",
"filesUpdated",
"=",
"[",
"]",
";",
"$",
"filesSame",
"=",
"[",
"]",
";",
"$",
"errors",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getOverridesIterator",
"(",
")",
"as",
"$",
"pathToFileInOverrides",
")",
"{",
"$",
"relativePathToFileInProject",
"=",
"$",
"this",
"->",
"getRelativePathInProjectFromOverridePath",
"(",
"$",
"pathToFileInOverrides",
")",
";",
"if",
"(",
"$",
"this",
"->",
"overrideFileHashIsCorrect",
"(",
"$",
"pathToFileInOverrides",
")",
")",
"{",
"if",
"(",
"false",
"===",
"is_file",
"(",
"$",
"pathToFileInOverrides",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'path '",
".",
"$",
"pathToFileInOverrides",
".",
"' is not a file'",
")",
";",
"}",
"copy",
"(",
"$",
"pathToFileInOverrides",
",",
"$",
"this",
"->",
"pathToProjectRoot",
".",
"$",
"relativePathToFileInProject",
")",
";",
"$",
"filesUpdated",
"[",
"]",
"=",
"$",
"relativePathToFileInProject",
";",
"continue",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"projectFileIsSameAsOverride",
"(",
"$",
"pathToFileInOverrides",
")",
")",
"{",
"$",
"filesSame",
"[",
"]",
"=",
"$",
"relativePathToFileInProject",
";",
"continue",
";",
"}",
"$",
"errors",
"[",
"$",
"pathToFileInOverrides",
"]",
"=",
"$",
"this",
"->",
"getProjectFileHash",
"(",
"$",
"relativePathToFileInProject",
")",
";",
"}",
"if",
"(",
"[",
"]",
"!==",
"$",
"errors",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'These file hashes were not up to date:'",
".",
"print_r",
"(",
"$",
"errors",
",",
"true",
")",
")",
";",
"}",
"return",
"[",
"$",
"this",
"->",
"sortFiles",
"(",
"$",
"filesUpdated",
")",
",",
"$",
"this",
"->",
"sortFiles",
"(",
"$",
"filesSame",
")",
"]",
";",
"}"
] | Loop over all the override files and copy into the project
@return array[] the file paths that have been updated | [
"Loop",
"over",
"all",
"the",
"override",
"files",
"and",
"copy",
"into",
"the",
"project"
] | c5b1caab0b2e3a84c34082af96529a274f0c3d7e | https://github.com/edmondscommerce/doctrine-static-meta/blob/c5b1caab0b2e3a84c34082af96529a274f0c3d7e/src/CodeGeneration/PostProcessor/FileOverrider.php#L266-L292 |
31,790 | chameleon-system/chameleon-shop | src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/SnsMessageParser.php | SnsMessageParser.parseNotification | public static function parseNotification($headers, $jsonString)
{
self::_validateHeaders($headers);
$snsMsg = new Message($jsonString);
self::_checkForCorrectMessageType($snsMsg);
self::_setMetadataForMessage($snsMsg);
return $snsMsg;
} | php | public static function parseNotification($headers, $jsonString)
{
self::_validateHeaders($headers);
$snsMsg = new Message($jsonString);
self::_checkForCorrectMessageType($snsMsg);
self::_setMetadataForMessage($snsMsg);
return $snsMsg;
} | [
"public",
"static",
"function",
"parseNotification",
"(",
"$",
"headers",
",",
"$",
"jsonString",
")",
"{",
"self",
"::",
"_validateHeaders",
"(",
"$",
"headers",
")",
";",
"$",
"snsMsg",
"=",
"new",
"Message",
"(",
"$",
"jsonString",
")",
";",
"self",
"::",
"_checkForCorrectMessageType",
"(",
"$",
"snsMsg",
")",
";",
"self",
"::",
"_setMetadataForMessage",
"(",
"$",
"snsMsg",
")",
";",
"return",
"$",
"snsMsg",
";",
"}"
] | Convert a json string to a json msg that
meets our expections of a SnsMessage
@param string $jsonString raw data as json string
@throws OffAmazonPaymentsNotifications_InvalidMessageException if not valid json
@return Message converted message | [
"Convert",
"a",
"json",
"string",
"to",
"a",
"json",
"msg",
"that",
"meets",
"our",
"expections",
"of",
"a",
"SnsMessage"
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsNotifications/Impl/SnsMessageParser.php#L37-L44 |
31,791 | chameleon-system/chameleon-shop | src/ShopBundle/objects/WebModules/MTShopInfoCore/MTShopInfoCore.class.php | MTShopInfoCore.& | protected function &GetModuleConfig()
{
if (is_null($this->oModuleConfig)) {
$this->oModuleConfig = TdbShopSystemInfoModuleConfig::GetNewInstance();
if (!$this->oModuleConfig->LoadFromField('cms_tpl_module_instance_id', $this->instanceID)) {
$this->oModuleConfig = null;
}
}
return $this->oModuleConfig;
} | php | protected function &GetModuleConfig()
{
if (is_null($this->oModuleConfig)) {
$this->oModuleConfig = TdbShopSystemInfoModuleConfig::GetNewInstance();
if (!$this->oModuleConfig->LoadFromField('cms_tpl_module_instance_id', $this->instanceID)) {
$this->oModuleConfig = null;
}
}
return $this->oModuleConfig;
} | [
"protected",
"function",
"&",
"GetModuleConfig",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"oModuleConfig",
")",
")",
"{",
"$",
"this",
"->",
"oModuleConfig",
"=",
"TdbShopSystemInfoModuleConfig",
"::",
"GetNewInstance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"oModuleConfig",
"->",
"LoadFromField",
"(",
"'cms_tpl_module_instance_id'",
",",
"$",
"this",
"->",
"instanceID",
")",
")",
"{",
"$",
"this",
"->",
"oModuleConfig",
"=",
"null",
";",
"}",
"}",
"return",
"$",
"this",
"->",
"oModuleConfig",
";",
"}"
] | return config record for modul instance.
@return TdbShopSystemInfoModuleConfig | [
"return",
"config",
"record",
"for",
"modul",
"instance",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/WebModules/MTShopInfoCore/MTShopInfoCore.class.php#L41-L51 |
31,792 | Erebot/Erebot | src/Prompt.php | Prompt.handleMessage | protected function handleMessage($line)
{
$pos = strpos($line, ' ');
if ($pos === false) {
return;
}
$pattern = preg_quote(substr($line, 0, $pos), '@');
$pattern = strtr($pattern, array('\\?' => '.?', '\\*' => '.*'));
$line = substr($line, $pos + 1);
if ($line === false) {
return;
}
foreach ($this->bot->getConnections() as $connection) {
if (!($connection instanceof \Erebot\Interfaces\SendingConnection) || $connection == $this) {
continue;
}
$config = $connection->getConfig(null);
$netConfig = $config->getNetworkCfg();
if (preg_match('@^'.$pattern.'$@Di', $netConfig->getName())) {
$connection->getIO()->push($line);
}
}
} | php | protected function handleMessage($line)
{
$pos = strpos($line, ' ');
if ($pos === false) {
return;
}
$pattern = preg_quote(substr($line, 0, $pos), '@');
$pattern = strtr($pattern, array('\\?' => '.?', '\\*' => '.*'));
$line = substr($line, $pos + 1);
if ($line === false) {
return;
}
foreach ($this->bot->getConnections() as $connection) {
if (!($connection instanceof \Erebot\Interfaces\SendingConnection) || $connection == $this) {
continue;
}
$config = $connection->getConfig(null);
$netConfig = $config->getNetworkCfg();
if (preg_match('@^'.$pattern.'$@Di', $netConfig->getName())) {
$connection->getIO()->push($line);
}
}
} | [
"protected",
"function",
"handleMessage",
"(",
"$",
"line",
")",
"{",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"line",
",",
"' '",
")",
";",
"if",
"(",
"$",
"pos",
"===",
"false",
")",
"{",
"return",
";",
"}",
"$",
"pattern",
"=",
"preg_quote",
"(",
"substr",
"(",
"$",
"line",
",",
"0",
",",
"$",
"pos",
")",
",",
"'@'",
")",
";",
"$",
"pattern",
"=",
"strtr",
"(",
"$",
"pattern",
",",
"array",
"(",
"'\\\\?'",
"=>",
"'.?'",
",",
"'\\\\*'",
"=>",
"'.*'",
")",
")",
";",
"$",
"line",
"=",
"substr",
"(",
"$",
"line",
",",
"$",
"pos",
"+",
"1",
")",
";",
"if",
"(",
"$",
"line",
"===",
"false",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"bot",
"->",
"getConnections",
"(",
")",
"as",
"$",
"connection",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"connection",
"instanceof",
"\\",
"Erebot",
"\\",
"Interfaces",
"\\",
"SendingConnection",
")",
"||",
"$",
"connection",
"==",
"$",
"this",
")",
"{",
"continue",
";",
"}",
"$",
"config",
"=",
"$",
"connection",
"->",
"getConfig",
"(",
"null",
")",
";",
"$",
"netConfig",
"=",
"$",
"config",
"->",
"getNetworkCfg",
"(",
")",
";",
"if",
"(",
"preg_match",
"(",
"'@^'",
".",
"$",
"pattern",
".",
"'$@Di'",
",",
"$",
"netConfig",
"->",
"getName",
"(",
")",
")",
")",
"{",
"$",
"connection",
"->",
"getIO",
"(",
")",
"->",
"push",
"(",
"$",
"line",
")",
";",
"}",
"}",
"}"
] | Handles a line received from the prompt.
\param string $line
A single line of text received from the prompt,
with the end-of-line sequence stripped. | [
"Handles",
"a",
"line",
"received",
"from",
"the",
"prompt",
"."
] | 691fc3fa8bc6f07061ff2b3798fec76bc3a039aa | https://github.com/Erebot/Erebot/blob/691fc3fa8bc6f07061ff2b3798fec76bc3a039aa/src/Prompt.php#L224-L249 |
31,793 | chameleon-system/chameleon-shop | src/ImageHotspotBundle/objects/db/TPkgImageHotspotItemSpot.class.php | TPkgImageHotspotItemSpot.& | public function &GetSpotObject()
{
$oObject = &$this->GetFromInternalCache('oObjectAssignedToSpot');
if (is_null($oObject)) {
$oObject = $this->GetFieldLinkedRecord();
$this->SetInternalCache('oObjectAssignedToSpot', $oObject);
}
return $oObject;
} | php | public function &GetSpotObject()
{
$oObject = &$this->GetFromInternalCache('oObjectAssignedToSpot');
if (is_null($oObject)) {
$oObject = $this->GetFieldLinkedRecord();
$this->SetInternalCache('oObjectAssignedToSpot', $oObject);
}
return $oObject;
} | [
"public",
"function",
"&",
"GetSpotObject",
"(",
")",
"{",
"$",
"oObject",
"=",
"&",
"$",
"this",
"->",
"GetFromInternalCache",
"(",
"'oObjectAssignedToSpot'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"oObject",
")",
")",
"{",
"$",
"oObject",
"=",
"$",
"this",
"->",
"GetFieldLinkedRecord",
"(",
")",
";",
"$",
"this",
"->",
"SetInternalCache",
"(",
"'oObjectAssignedToSpot'",
",",
"$",
"oObject",
")",
";",
"}",
"return",
"$",
"oObject",
";",
"}"
] | return a pointer to the object assigned to the spot.
@return TCMSRecord | [
"return",
"a",
"pointer",
"to",
"the",
"object",
"assigned",
"to",
"the",
"spot",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ImageHotspotBundle/objects/db/TPkgImageHotspotItemSpot.class.php#L21-L30 |
31,794 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopArticleList.class.php | TShopArticleList.LoadArticleList | public static function LoadArticleList($sOrderString = null, $iLimit = -1, $aFilter = array())
{
if (is_null($sOrderString)) {
$sOrderString = '`shop_article`.`list_rank` DESC, `shop_article`.`name` ASC';
}
$query = "SELECT `shop_article`.*
FROM `shop_article`
WHERE `shop_article`.`variant_parent_id` = ''
";
$sActiveArticleSnippid = TdbShopArticleList::GetActiveArticleQueryRestriction();
if (!empty($sActiveArticleSnippid)) {
$query .= ' AND ('.$sActiveArticleSnippid.')';
}
if (count($aFilter) > 0) {
$aTmpFilter = array();
foreach ($aFilter as $sKey => $sField) {
$aTmpFilter[] = MySqlLegacySupport::getInstance()->real_escape_string($sKey)."='".MySqlLegacySupport::getInstance()->real_escape_string($sField)."'";
}
$query .= ' AND ('.implode(' AND ', $aTmpFilter).')';
}
if (!empty($sOrderString)) {
$query .= ' ORDER BY '.$sOrderString;
}
if ($iLimit > 0) {
$query .= ' LIMIT 0,'.$iLimit;
}
$oList = &TdbShopArticleList::GetList($query);
return $oList;
} | php | public static function LoadArticleList($sOrderString = null, $iLimit = -1, $aFilter = array())
{
if (is_null($sOrderString)) {
$sOrderString = '`shop_article`.`list_rank` DESC, `shop_article`.`name` ASC';
}
$query = "SELECT `shop_article`.*
FROM `shop_article`
WHERE `shop_article`.`variant_parent_id` = ''
";
$sActiveArticleSnippid = TdbShopArticleList::GetActiveArticleQueryRestriction();
if (!empty($sActiveArticleSnippid)) {
$query .= ' AND ('.$sActiveArticleSnippid.')';
}
if (count($aFilter) > 0) {
$aTmpFilter = array();
foreach ($aFilter as $sKey => $sField) {
$aTmpFilter[] = MySqlLegacySupport::getInstance()->real_escape_string($sKey)."='".MySqlLegacySupport::getInstance()->real_escape_string($sField)."'";
}
$query .= ' AND ('.implode(' AND ', $aTmpFilter).')';
}
if (!empty($sOrderString)) {
$query .= ' ORDER BY '.$sOrderString;
}
if ($iLimit > 0) {
$query .= ' LIMIT 0,'.$iLimit;
}
$oList = &TdbShopArticleList::GetList($query);
return $oList;
} | [
"public",
"static",
"function",
"LoadArticleList",
"(",
"$",
"sOrderString",
"=",
"null",
",",
"$",
"iLimit",
"=",
"-",
"1",
",",
"$",
"aFilter",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"sOrderString",
")",
")",
"{",
"$",
"sOrderString",
"=",
"'`shop_article`.`list_rank` DESC, `shop_article`.`name` ASC'",
";",
"}",
"$",
"query",
"=",
"\"SELECT `shop_article`.*\n FROM `shop_article`\n WHERE `shop_article`.`variant_parent_id` = ''\n \"",
";",
"$",
"sActiveArticleSnippid",
"=",
"TdbShopArticleList",
"::",
"GetActiveArticleQueryRestriction",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"sActiveArticleSnippid",
")",
")",
"{",
"$",
"query",
".=",
"' AND ('",
".",
"$",
"sActiveArticleSnippid",
".",
"')'",
";",
"}",
"if",
"(",
"count",
"(",
"$",
"aFilter",
")",
">",
"0",
")",
"{",
"$",
"aTmpFilter",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"aFilter",
"as",
"$",
"sKey",
"=>",
"$",
"sField",
")",
"{",
"$",
"aTmpFilter",
"[",
"]",
"=",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"sKey",
")",
".",
"\"='\"",
".",
"MySqlLegacySupport",
"::",
"getInstance",
"(",
")",
"->",
"real_escape_string",
"(",
"$",
"sField",
")",
".",
"\"'\"",
";",
"}",
"$",
"query",
".=",
"' AND ('",
".",
"implode",
"(",
"' AND '",
",",
"$",
"aTmpFilter",
")",
".",
"')'",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"sOrderString",
")",
")",
"{",
"$",
"query",
".=",
"' ORDER BY '",
".",
"$",
"sOrderString",
";",
"}",
"if",
"(",
"$",
"iLimit",
">",
"0",
")",
"{",
"$",
"query",
".=",
"' LIMIT 0,'",
".",
"$",
"iLimit",
";",
"}",
"$",
"oList",
"=",
"&",
"TdbShopArticleList",
"::",
"GetList",
"(",
"$",
"query",
")",
";",
"return",
"$",
"oList",
";",
"}"
] | return active article list.
@param int $iCategoryId
@param string $sOrderString
@param int $iLimit
@param array $aFilter - any filters you want to add to the list
@return TdbShopArticleList | [
"return",
"active",
"article",
"list",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopArticleList.class.php#L168-L199 |
31,795 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopArticleList.class.php | TShopArticleList.Render | public function Render($sViewName = 'standard', $sViewType = 'Core', $aCallTimeVars = array())
{
$oView = new TViewParser();
$sViewIdentKey = $this->StoreListObjectInSession($sViewName, $sViewType, $aCallTimeVars);
$this->GoToStart();
$oView->AddVar('oArticleList', $this);
$oView->AddVar('aCallTimeVars', $aCallTimeVars);
$oView->AddVar('sViewIdentKey', $sViewIdentKey);
$aOtherParameters = $this->GetAdditionalViewVariables($sViewName, $sViewType);
$oView->AddVarArray($aOtherParameters);
return $oView->RenderObjectPackageView($sViewName, TdbShopArticleList::VIEW_PATH, $sViewType);
} | php | public function Render($sViewName = 'standard', $sViewType = 'Core', $aCallTimeVars = array())
{
$oView = new TViewParser();
$sViewIdentKey = $this->StoreListObjectInSession($sViewName, $sViewType, $aCallTimeVars);
$this->GoToStart();
$oView->AddVar('oArticleList', $this);
$oView->AddVar('aCallTimeVars', $aCallTimeVars);
$oView->AddVar('sViewIdentKey', $sViewIdentKey);
$aOtherParameters = $this->GetAdditionalViewVariables($sViewName, $sViewType);
$oView->AddVarArray($aOtherParameters);
return $oView->RenderObjectPackageView($sViewName, TdbShopArticleList::VIEW_PATH, $sViewType);
} | [
"public",
"function",
"Render",
"(",
"$",
"sViewName",
"=",
"'standard'",
",",
"$",
"sViewType",
"=",
"'Core'",
",",
"$",
"aCallTimeVars",
"=",
"array",
"(",
")",
")",
"{",
"$",
"oView",
"=",
"new",
"TViewParser",
"(",
")",
";",
"$",
"sViewIdentKey",
"=",
"$",
"this",
"->",
"StoreListObjectInSession",
"(",
"$",
"sViewName",
",",
"$",
"sViewType",
",",
"$",
"aCallTimeVars",
")",
";",
"$",
"this",
"->",
"GoToStart",
"(",
")",
";",
"$",
"oView",
"->",
"AddVar",
"(",
"'oArticleList'",
",",
"$",
"this",
")",
";",
"$",
"oView",
"->",
"AddVar",
"(",
"'aCallTimeVars'",
",",
"$",
"aCallTimeVars",
")",
";",
"$",
"oView",
"->",
"AddVar",
"(",
"'sViewIdentKey'",
",",
"$",
"sViewIdentKey",
")",
";",
"$",
"aOtherParameters",
"=",
"$",
"this",
"->",
"GetAdditionalViewVariables",
"(",
"$",
"sViewName",
",",
"$",
"sViewType",
")",
";",
"$",
"oView",
"->",
"AddVarArray",
"(",
"$",
"aOtherParameters",
")",
";",
"return",
"$",
"oView",
"->",
"RenderObjectPackageView",
"(",
"$",
"sViewName",
",",
"TdbShopArticleList",
"::",
"VIEW_PATH",
",",
"$",
"sViewType",
")",
";",
"}"
] | used to display the article list.
@param string $sViewName - the view to use
@param string $sViewType - where the view is located (Core, Custom-Core, Customer)
@param array $aCallTimeVars - place any custom vars that you want to pass through the call here
@return string | [
"used",
"to",
"display",
"the",
"article",
"list",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopArticleList.class.php#L210-L222 |
31,796 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopArticleList.class.php | TShopArticleList.GetListIdentKey | public function GetListIdentKey()
{
if (null === $this->sListIdentKey) {
$oGlobal = TGlobal::instance();
$oExecutingModule = &$oGlobal->GetExecutingModulePointer();
$this->sListIdentKey = $oExecutingModule->sModuleSpotName;
}
return $this->sListIdentKey;
} | php | public function GetListIdentKey()
{
if (null === $this->sListIdentKey) {
$oGlobal = TGlobal::instance();
$oExecutingModule = &$oGlobal->GetExecutingModulePointer();
$this->sListIdentKey = $oExecutingModule->sModuleSpotName;
}
return $this->sListIdentKey;
} | [
"public",
"function",
"GetListIdentKey",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"sListIdentKey",
")",
"{",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"$",
"oExecutingModule",
"=",
"&",
"$",
"oGlobal",
"->",
"GetExecutingModulePointer",
"(",
")",
";",
"$",
"this",
"->",
"sListIdentKey",
"=",
"$",
"oExecutingModule",
"->",
"sModuleSpotName",
";",
"}",
"return",
"$",
"this",
"->",
"sListIdentKey",
";",
"}"
] | return an IdentKey for this list.
@return string | [
"return",
"an",
"IdentKey",
"for",
"this",
"list",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopArticleList.class.php#L229-L238 |
31,797 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopArticleList.class.php | TShopArticleList.StoreListObjectInSession | public function StoreListObjectInSession($sViewName = null, $sViewType = null, $aCallTimeVars = null)
{
$oGlobal = TGlobal::instance();
$sItemKey = $this->GetListIdentKey();
$oExecutingModule = &$oGlobal->GetExecutingModulePointer();
if (!array_key_exists(TdbShopArticleList::SESSIN_DUMP_NAME, $_SESSION)) {
$_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME] = array();
}
if (!array_key_exists($sItemKey, $_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME])) {
$_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey] = array();
}
$aOldData = $_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey];
if (is_null($sViewName) && array_key_exists('sViewName', $aOldData)) {
$sViewName = $aOldData['sViewName'];
}
if (is_null($sViewType) && array_key_exists('sViewType', $aOldData)) {
$sViewType = $aOldData['sViewType'];
}
if (is_null($aCallTimeVars) && array_key_exists('aCallTimeVars', $aOldData)) {
$aCallTimeVars = $aOldData['aCallTimeVars'];
}
if (0 === $this->GetPageSize()) {
unset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey]);
} else {
$_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey] = array( // 'oExecutingModule'=>$oExecutingModule,
'lastchanged' => time(), 'sObjectDump' => base64_encode(serialize($this)), 'iStartRecord' => $this->GetStartRecordNumber(), 'iPageSize' => $this->GetPageSize(), 'sViewName' => $sViewName, 'sViewType' => $sViewType, 'aCallTimeVars' => $aCallTimeVars, );
}
return $sItemKey;
} | php | public function StoreListObjectInSession($sViewName = null, $sViewType = null, $aCallTimeVars = null)
{
$oGlobal = TGlobal::instance();
$sItemKey = $this->GetListIdentKey();
$oExecutingModule = &$oGlobal->GetExecutingModulePointer();
if (!array_key_exists(TdbShopArticleList::SESSIN_DUMP_NAME, $_SESSION)) {
$_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME] = array();
}
if (!array_key_exists($sItemKey, $_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME])) {
$_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey] = array();
}
$aOldData = $_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey];
if (is_null($sViewName) && array_key_exists('sViewName', $aOldData)) {
$sViewName = $aOldData['sViewName'];
}
if (is_null($sViewType) && array_key_exists('sViewType', $aOldData)) {
$sViewType = $aOldData['sViewType'];
}
if (is_null($aCallTimeVars) && array_key_exists('aCallTimeVars', $aOldData)) {
$aCallTimeVars = $aOldData['aCallTimeVars'];
}
if (0 === $this->GetPageSize()) {
unset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey]);
} else {
$_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sItemKey] = array( // 'oExecutingModule'=>$oExecutingModule,
'lastchanged' => time(), 'sObjectDump' => base64_encode(serialize($this)), 'iStartRecord' => $this->GetStartRecordNumber(), 'iPageSize' => $this->GetPageSize(), 'sViewName' => $sViewName, 'sViewType' => $sViewType, 'aCallTimeVars' => $aCallTimeVars, );
}
return $sItemKey;
} | [
"public",
"function",
"StoreListObjectInSession",
"(",
"$",
"sViewName",
"=",
"null",
",",
"$",
"sViewType",
"=",
"null",
",",
"$",
"aCallTimeVars",
"=",
"null",
")",
"{",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"$",
"sItemKey",
"=",
"$",
"this",
"->",
"GetListIdentKey",
"(",
")",
";",
"$",
"oExecutingModule",
"=",
"&",
"$",
"oGlobal",
"->",
"GetExecutingModulePointer",
"(",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
",",
"$",
"_SESSION",
")",
")",
"{",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"=",
"array",
"(",
")",
";",
"}",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"sItemKey",
",",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
")",
")",
"{",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"[",
"$",
"sItemKey",
"]",
"=",
"array",
"(",
")",
";",
"}",
"$",
"aOldData",
"=",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"[",
"$",
"sItemKey",
"]",
";",
"if",
"(",
"is_null",
"(",
"$",
"sViewName",
")",
"&&",
"array_key_exists",
"(",
"'sViewName'",
",",
"$",
"aOldData",
")",
")",
"{",
"$",
"sViewName",
"=",
"$",
"aOldData",
"[",
"'sViewName'",
"]",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"sViewType",
")",
"&&",
"array_key_exists",
"(",
"'sViewType'",
",",
"$",
"aOldData",
")",
")",
"{",
"$",
"sViewType",
"=",
"$",
"aOldData",
"[",
"'sViewType'",
"]",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"aCallTimeVars",
")",
"&&",
"array_key_exists",
"(",
"'aCallTimeVars'",
",",
"$",
"aOldData",
")",
")",
"{",
"$",
"aCallTimeVars",
"=",
"$",
"aOldData",
"[",
"'aCallTimeVars'",
"]",
";",
"}",
"if",
"(",
"0",
"===",
"$",
"this",
"->",
"GetPageSize",
"(",
")",
")",
"{",
"unset",
"(",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"[",
"$",
"sItemKey",
"]",
")",
";",
"}",
"else",
"{",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"[",
"$",
"sItemKey",
"]",
"=",
"array",
"(",
"// 'oExecutingModule'=>$oExecutingModule,",
"'lastchanged'",
"=>",
"time",
"(",
")",
",",
"'sObjectDump'",
"=>",
"base64_encode",
"(",
"serialize",
"(",
"$",
"this",
")",
")",
",",
"'iStartRecord'",
"=>",
"$",
"this",
"->",
"GetStartRecordNumber",
"(",
")",
",",
"'iPageSize'",
"=>",
"$",
"this",
"->",
"GetPageSize",
"(",
")",
",",
"'sViewName'",
"=>",
"$",
"sViewName",
",",
"'sViewType'",
"=>",
"$",
"sViewType",
",",
"'aCallTimeVars'",
"=>",
"$",
"aCallTimeVars",
",",
")",
";",
"}",
"return",
"$",
"sItemKey",
";",
"}"
] | restore serialized dump in session. returns id key for item. also calls
session cleanup method.
@return string | [
"restore",
"serialized",
"dump",
"in",
"session",
".",
"returns",
"id",
"key",
"for",
"item",
".",
"also",
"calls",
"session",
"cleanup",
"method",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopArticleList.class.php#L246-L277 |
31,798 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopArticleList.class.php | TShopArticleList.& | public static function &GetInstanceFromSession($sListSessionKey)
{
$oList = null;
$aListData = TdbShopArticleList::GetInstanceDataFromSession($sListSessionKey);
if (!is_null($aListData)) {
if (array_key_exists('sObjectDump', $aListData)) {
$oList = unserialize(base64_decode($aListData['sObjectDump']));
$oGlobal = TGlobal::instance();
if ($oGlobal->UserDataExists(TdbShopArticleList::URL_LIST_KEY_NAME)) {
$callingIdentKey = $oGlobal->GetUserData(TdbShopArticleList::URL_LIST_KEY_NAME);
if ($sListSessionKey == $callingIdentKey) {
$sRequest = $oGlobal->GetUserData(TdbShopArticleList::URL_LIST_REQUEST);
$oList->HandleURLRequest($sRequest);
}
}
}
}
return $oList;
} | php | public static function &GetInstanceFromSession($sListSessionKey)
{
$oList = null;
$aListData = TdbShopArticleList::GetInstanceDataFromSession($sListSessionKey);
if (!is_null($aListData)) {
if (array_key_exists('sObjectDump', $aListData)) {
$oList = unserialize(base64_decode($aListData['sObjectDump']));
$oGlobal = TGlobal::instance();
if ($oGlobal->UserDataExists(TdbShopArticleList::URL_LIST_KEY_NAME)) {
$callingIdentKey = $oGlobal->GetUserData(TdbShopArticleList::URL_LIST_KEY_NAME);
if ($sListSessionKey == $callingIdentKey) {
$sRequest = $oGlobal->GetUserData(TdbShopArticleList::URL_LIST_REQUEST);
$oList->HandleURLRequest($sRequest);
}
}
}
}
return $oList;
} | [
"public",
"static",
"function",
"&",
"GetInstanceFromSession",
"(",
"$",
"sListSessionKey",
")",
"{",
"$",
"oList",
"=",
"null",
";",
"$",
"aListData",
"=",
"TdbShopArticleList",
"::",
"GetInstanceDataFromSession",
"(",
"$",
"sListSessionKey",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"aListData",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'sObjectDump'",
",",
"$",
"aListData",
")",
")",
"{",
"$",
"oList",
"=",
"unserialize",
"(",
"base64_decode",
"(",
"$",
"aListData",
"[",
"'sObjectDump'",
"]",
")",
")",
";",
"$",
"oGlobal",
"=",
"TGlobal",
"::",
"instance",
"(",
")",
";",
"if",
"(",
"$",
"oGlobal",
"->",
"UserDataExists",
"(",
"TdbShopArticleList",
"::",
"URL_LIST_KEY_NAME",
")",
")",
"{",
"$",
"callingIdentKey",
"=",
"$",
"oGlobal",
"->",
"GetUserData",
"(",
"TdbShopArticleList",
"::",
"URL_LIST_KEY_NAME",
")",
";",
"if",
"(",
"$",
"sListSessionKey",
"==",
"$",
"callingIdentKey",
")",
"{",
"$",
"sRequest",
"=",
"$",
"oGlobal",
"->",
"GetUserData",
"(",
"TdbShopArticleList",
"::",
"URL_LIST_REQUEST",
")",
";",
"$",
"oList",
"->",
"HandleURLRequest",
"(",
"$",
"sRequest",
")",
";",
"}",
"}",
"}",
"}",
"return",
"$",
"oList",
";",
"}"
] | create a list based on the session data for the session key passed
returns NULL if the object can not be found.
@param string $sSessionKey
@return TdbShopArticleList | [
"create",
"a",
"list",
"based",
"on",
"the",
"session",
"data",
"for",
"the",
"session",
"key",
"passed",
"returns",
"NULL",
"if",
"the",
"object",
"can",
"not",
"be",
"found",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopArticleList.class.php#L308-L327 |
31,799 | chameleon-system/chameleon-shop | src/ShopBundle/objects/db/TShopArticleList.class.php | TShopArticleList.removeInstanceFromSession | public static function removeInstanceFromSession($sListSessionKey)
{
if (isset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME]) &&
isset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sListSessionKey])) {
unset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sListSessionKey]);
}
} | php | public static function removeInstanceFromSession($sListSessionKey)
{
if (isset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME]) &&
isset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sListSessionKey])) {
unset($_SESSION[TdbShopArticleList::SESSIN_DUMP_NAME][$sListSessionKey]);
}
} | [
"public",
"static",
"function",
"removeInstanceFromSession",
"(",
"$",
"sListSessionKey",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
")",
"&&",
"isset",
"(",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"[",
"$",
"sListSessionKey",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"_SESSION",
"[",
"TdbShopArticleList",
"::",
"SESSIN_DUMP_NAME",
"]",
"[",
"$",
"sListSessionKey",
"]",
")",
";",
"}",
"}"
] | remove serialized dump from session.
@param string $sListSessionKey | [
"remove",
"serialized",
"dump",
"from",
"session",
"."
] | 2e47f4eeab604449605ee1867180c9a37a8c208e | https://github.com/chameleon-system/chameleon-shop/blob/2e47f4eeab604449605ee1867180c9a37a8c208e/src/ShopBundle/objects/db/TShopArticleList.class.php#L334-L340 |
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.