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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,200 | SIELOnline/libAcumulus | src/PrestaShop/Invoice/Creator.php | Creator.getItemLine | protected function getItemLine(array $item)
{
$result = array();
$this->addPropertySource('item', $item);
$this->addProductInfo($result);
$sign = $this->invoiceSource->getSign();
// Check for cost price and margin scheme.
if (!empty($line['costPrice']) && $this->al... | php | protected function getItemLine(array $item)
{
$result = array();
$this->addPropertySource('item', $item);
$this->addProductInfo($result);
$sign = $this->invoiceSource->getSign();
// Check for cost price and margin scheme.
if (!empty($line['costPrice']) && $this->al... | [
"protected",
"function",
"getItemLine",
"(",
"array",
"$",
"item",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"addPropertySource",
"(",
"'item'",
",",
"$",
"item",
")",
";",
"$",
"this",
"->",
"addProductInfo",
"(",
"$",
... | Returns 1 item line, both for an order or credit slip.
@param array $item
An array of an OrderDetail line combined with a tax detail line OR
an array with an OrderSlipDetail line.
@return array
@throws \PrestaShopDatabaseException | [
"Returns",
"1",
"item",
"line",
"both",
"for",
"an",
"order",
"or",
"credit",
"slip",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Invoice/Creator.php#L150-L201 |
30,201 | SIELOnline/libAcumulus | src/PrestaShop/Invoice/Creator.php | Creator.getItemLineTaxRuleGroupId | protected function getItemLineTaxRuleGroupId(array $item)
{
if (isset($item['id_tax_rules_group'])) {
return (int) $item['id_tax_rules_group'];
} elseif (isset($item['id_tax'])) {
$query = 'select distinct id_tax_rules_group from ps_tax_rule where id_tax = ' . (int) $item['id... | php | protected function getItemLineTaxRuleGroupId(array $item)
{
if (isset($item['id_tax_rules_group'])) {
return (int) $item['id_tax_rules_group'];
} elseif (isset($item['id_tax'])) {
$query = 'select distinct id_tax_rules_group from ps_tax_rule where id_tax = ' . (int) $item['id... | [
"protected",
"function",
"getItemLineTaxRuleGroupId",
"(",
"array",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
"'id_tax_rules_group'",
"]",
")",
")",
"{",
"return",
"(",
"int",
")",
"$",
"item",
"[",
"'id_tax_rules_group'",
"]",
";",... | Returns the tax rule group id of the product in the given order line.
@param array $item
@return int
The id of the tax rule group, or 0 if none or multiple were found.
@throws \PrestaShopDatabaseException | [
"Returns",
"the",
"tax",
"rule",
"group",
"id",
"of",
"the",
"product",
"in",
"the",
"given",
"order",
"line",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Invoice/Creator.php#L213-L223 |
30,202 | SIELOnline/libAcumulus | src/PrestaShop/Invoice/Creator.php | Creator.getDiscountLinesOrder | protected function getDiscountLinesOrder()
{
$result = array();
foreach ($this->order->getCartRules() as $line) {
$result[] = $this->getDiscountLineOrder($line);
}
return $result;
} | php | protected function getDiscountLinesOrder()
{
$result = array();
foreach ($this->order->getCartRules() as $line) {
$result[] = $this->getDiscountLineOrder($line);
}
return $result;
} | [
"protected",
"function",
"getDiscountLinesOrder",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"order",
"->",
"getCartRules",
"(",
")",
"as",
"$",
"line",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
... | In a Prestashop order the discount lines are specified in Order cart
rules.
@return array[] | [
"In",
"a",
"Prestashop",
"order",
"the",
"discount",
"lines",
"are",
"specified",
"in",
"Order",
"cart",
"rules",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Invoice/Creator.php#L364-L373 |
30,203 | SIELOnline/libAcumulus | src/PrestaShop/Invoice/Creator.php | Creator.getDiscountLinesCreditNote | protected function getDiscountLinesCreditNote()
{
$result = array();
// Get total amount credited.
/** @noinspection PhpUndefinedFieldInspection */
$creditSlipAmountInc = $this->creditSlip->total_products_tax_incl;
// Get sum of product lines.
$lines = $this->credit... | php | protected function getDiscountLinesCreditNote()
{
$result = array();
// Get total amount credited.
/** @noinspection PhpUndefinedFieldInspection */
$creditSlipAmountInc = $this->creditSlip->total_products_tax_incl;
// Get sum of product lines.
$lines = $this->credit... | [
"protected",
"function",
"getDiscountLinesCreditNote",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// Get total amount credited.",
"/** @noinspection PhpUndefinedFieldInspection */",
"$",
"creditSlipAmountInc",
"=",
"$",
"this",
"->",
"creditSlip",
"->",
... | In a Prestashop credit slip, the discounts are not visible anymore, but
can be computed by looking at the difference between the value of
total_products_tax_incl and the sum of the OrderSlipDetail amounts.
@return array[] | [
"In",
"a",
"Prestashop",
"credit",
"slip",
"the",
"discounts",
"are",
"not",
"visible",
"anymore",
"but",
"can",
"be",
"computed",
"by",
"looking",
"at",
"the",
"difference",
"between",
"the",
"value",
"of",
"total_products_tax_incl",
"and",
"the",
"sum",
"of"... | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Invoice/Creator.php#L418-L479 |
30,204 | SIELOnline/libAcumulus | src/PrestaShop/Invoice/Creator.php | Creator.getVatRateLookupMetadata | protected function getVatRateLookupMetadata($addressId, $taxRulesGroupId)
{
try {
$taxRulesGroup = new TaxRulesGroup($taxRulesGroupId);
$address = new Address($addressId);
$taxManager = TaxManagerFactory::getManager($address, $taxRulesGroupId);
$taxCalculator ... | php | protected function getVatRateLookupMetadata($addressId, $taxRulesGroupId)
{
try {
$taxRulesGroup = new TaxRulesGroup($taxRulesGroupId);
$address = new Address($addressId);
$taxManager = TaxManagerFactory::getManager($address, $taxRulesGroupId);
$taxCalculator ... | [
"protected",
"function",
"getVatRateLookupMetadata",
"(",
"$",
"addressId",
",",
"$",
"taxRulesGroupId",
")",
"{",
"try",
"{",
"$",
"taxRulesGroup",
"=",
"new",
"TaxRulesGroup",
"(",
"$",
"taxRulesGroupId",
")",
";",
"$",
"address",
"=",
"new",
"Address",
"(",... | Looks up and returns vat rate metadata.
@param int $addressId
@param int $taxRulesGroupId
@return array
An empty array or an array with keys:
- Meta::VatClassId: int
- Meta::VatClassName: string
- Meta::VatRateLookup: float
- Meta::VatRateLookupLabel: string | [
"Looks",
"up",
"and",
"returns",
"vat",
"rate",
"metadata",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Invoice/Creator.php#L495-L512 |
30,205 | SIELOnline/libAcumulus | src/Helpers/Number.php | Number.getDivisionRange | static public function getDivisionRange($numerator, $denominator, $numeratorPrecision, $denominatorPrecision)
{
// The actual value can be half the precision lower or higher.
// To err on the save side, we take 60% of it (instead of 50%).
$numeratorHalfRange = 0.6 * (float) $numeratorPrecisi... | php | static public function getDivisionRange($numerator, $denominator, $numeratorPrecision, $denominatorPrecision)
{
// The actual value can be half the precision lower or higher.
// To err on the save side, we take 60% of it (instead of 50%).
$numeratorHalfRange = 0.6 * (float) $numeratorPrecisi... | [
"static",
"public",
"function",
"getDivisionRange",
"(",
"$",
"numerator",
",",
"$",
"denominator",
",",
"$",
"numeratorPrecision",
",",
"$",
"denominatorPrecision",
")",
"{",
"// The actual value can be half the precision lower or higher.",
"// To err on the save side, we take... | Returns the range within which the result of the division should fall given
the precision range for the 2 numbers to divide.
@param float $numerator
@param float $denominator
@param float $numeratorPrecision
The precision used when rounding the number. This means that the
original numerator will not differ more than h... | [
"Returns",
"the",
"range",
"within",
"which",
"the",
"result",
"of",
"the",
"division",
"should",
"fall",
"given",
"the",
"precision",
"range",
"for",
"the",
"2",
"numbers",
"to",
"divide",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/Number.php#L40-L68 |
30,206 | SIELOnline/libAcumulus | src/Helpers/Number.php | Number.floatsAreEqual | static public function floatsAreEqual($f1, $f2, $maxDiff = 0.005)
{
return abs((float) $f2 - (float) $f1) < $maxDiff;
} | php | static public function floatsAreEqual($f1, $f2, $maxDiff = 0.005)
{
return abs((float) $f2 - (float) $f1) < $maxDiff;
} | [
"static",
"public",
"function",
"floatsAreEqual",
"(",
"$",
"f1",
",",
"$",
"f2",
",",
"$",
"maxDiff",
"=",
"0.005",
")",
"{",
"return",
"abs",
"(",
"(",
"float",
")",
"$",
"f2",
"-",
"(",
"float",
")",
"$",
"f1",
")",
"<",
"$",
"maxDiff",
";",
... | Helper method to do a float comparison.
@param float $f1
@param float $f2
@param float $maxDiff
@return bool
True if the the floats are "equal", i.e. do not differ more than the
specified maximum difference. | [
"Helper",
"method",
"to",
"do",
"a",
"float",
"comparison",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/Number.php#L81-L84 |
30,207 | SIELOnline/libAcumulus | src/PrestaShop/Helpers/FormMapper.php | FormMapper.field | protected function field(array $field)
{
if (!empty($field['fields'])) {
$result = $this->fieldset($field);
} else {
$result = $this->element($field);
}
return $result;
} | php | protected function field(array $field)
{
if (!empty($field['fields'])) {
$result = $this->fieldset($field);
} else {
$result = $this->element($field);
}
return $result;
} | [
"protected",
"function",
"field",
"(",
"array",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"field",
"[",
"'fields'",
"]",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"fieldset",
"(",
"$",
"field",
")",
";",
"}",
"else",
... | Maps a single field definition, possibly a fieldset.
@param array $field
Field(set) definition.
@return array | [
"Maps",
"a",
"single",
"field",
"definition",
"possibly",
"a",
"fieldset",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Helpers/FormMapper.php#L54-L62 |
30,208 | SIELOnline/libAcumulus | src/PrestaShop/Helpers/FormMapper.php | FormMapper.fieldset | protected function fieldset(array $field)
{
$result = array(
'form' => array(
'legend' => array(
'title' => !empty($field['summary']) ? $field['summary'] : $field['legend'],
),
'input' => $this->fields($field['fields']),
... | php | protected function fieldset(array $field)
{
$result = array(
'form' => array(
'legend' => array(
'title' => !empty($field['summary']) ? $field['summary'] : $field['legend'],
),
'input' => $this->fields($field['fields']),
... | [
"protected",
"function",
"fieldset",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'form'",
"=>",
"array",
"(",
"'legend'",
"=>",
"array",
"(",
"'title'",
"=>",
"!",
"empty",
"(",
"$",
"field",
"[",
"'summary'",
"]",
")",
"... | Returns a mapped fieldset.
@param array $field
@return array[] | [
"Returns",
"a",
"mapped",
"fieldset",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Helpers/FormMapper.php#L71-L92 |
30,209 | SIELOnline/libAcumulus | src/PrestaShop/Helpers/FormMapper.php | FormMapper.element | protected function element(array $field)
{
$result = array(
'type' => $this->getPrestaShopType($field['type']),
'label' => isset($field['label']) ? $field['label'] : '',
'name' => $field['name'],
'required' => isset($field['attributes']['required']) ? $field['... | php | protected function element(array $field)
{
$result = array(
'type' => $this->getPrestaShopType($field['type']),
'label' => isset($field['label']) ? $field['label'] : '',
'name' => $field['name'],
'required' => isset($field['attributes']['required']) ? $field['... | [
"protected",
"function",
"element",
"(",
"array",
"$",
"field",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'type'",
"=>",
"$",
"this",
"->",
"getPrestaShopType",
"(",
"$",
"field",
"[",
"'type'",
"]",
")",
",",
"'label'",
"=>",
"isset",
"(",
"$",
"... | Returns a mapped simple element.
@param array $field
@return array | [
"Returns",
"a",
"mapped",
"simple",
"element",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/PrestaShop/Helpers/FormMapper.php#L102-L131 |
30,210 | SIELOnline/libAcumulus | src/Joomla/Helpers/Log.php | Log.getJoomlaSeverity | protected function getJoomlaSeverity($severity)
{
switch ($severity) {
case Log::Error:
return JLog::ERROR;
case Log::Warning:
return JLog::WARNING;
case Log::Notice:
return JLog::NOTICE;
case Log::Info:
... | php | protected function getJoomlaSeverity($severity)
{
switch ($severity) {
case Log::Error:
return JLog::ERROR;
case Log::Warning:
return JLog::WARNING;
case Log::Notice:
return JLog::NOTICE;
case Log::Info:
... | [
"protected",
"function",
"getJoomlaSeverity",
"(",
"$",
"severity",
")",
"{",
"switch",
"(",
"$",
"severity",
")",
"{",
"case",
"Log",
"::",
"Error",
":",
"return",
"JLog",
"::",
"ERROR",
";",
"case",
"Log",
"::",
"Warning",
":",
"return",
"JLog",
"::",
... | Returns the joomla equivalent of the severity.
@param int $severity
One of the constants of the base Log class.
@return int
the Joomla equivalent of the severity. | [
"Returns",
"the",
"joomla",
"equivalent",
"of",
"the",
"severity",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Joomla/Helpers/Log.php#L45-L60 |
30,211 | ipunkt/rancherize | app/Blueprint/Infrastructure/Service/Service.php | Service.addLinksFrom | public function addLinksFrom(Service $service) {
$links = $service->getLinks();
foreach($links as $name => $link) {
if (is_numeric($name)) {
$this->addLink($link);
} else {
$this->addLink($link, $name);
}
}
$externalLinks = $ser... | php | public function addLinksFrom(Service $service) {
$links = $service->getLinks();
foreach($links as $name => $link) {
if (is_numeric($name)) {
$this->addLink($link);
} else {
$this->addLink($link, $name);
}
}
$externalLinks = $ser... | [
"public",
"function",
"addLinksFrom",
"(",
"Service",
"$",
"service",
")",
"{",
"$",
"links",
"=",
"$",
"service",
"->",
"getLinks",
"(",
")",
";",
"foreach",
"(",
"$",
"links",
"as",
"$",
"name",
"=>",
"$",
"link",
")",
"{",
"if",
"(",
"is_numeric",... | Add internal and external links from other service
@param Service $service | [
"Add",
"internal",
"and",
"external",
"links",
"from",
"other",
"service"
] | 3c226da686b283e7fef961a9a79b54db53b8757b | https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Blueprint/Infrastructure/Service/Service.php#L384-L403 |
30,212 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Base.setupClient | public function setupClient()
{
/* Return if already set */
if ($this->client)
return $this;
/* Set the options for the SOAP request */
$sslContext = array(
'ssl' => array(
'allow_self_signed' => false,
'verify_peer' => false /... | php | public function setupClient()
{
/* Return if already set */
if ($this->client)
return $this;
/* Set the options for the SOAP request */
$sslContext = array(
'ssl' => array(
'allow_self_signed' => false,
'verify_peer' => false /... | [
"public",
"function",
"setupClient",
"(",
")",
"{",
"/* Return if already set */",
"if",
"(",
"$",
"this",
"->",
"client",
")",
"return",
"$",
"this",
";",
"/* Set the options for the SOAP request */",
"$",
"sslContext",
"=",
"array",
"(",
"'ssl'",
"=>",
"array",
... | Make connection with the soap client
@since 2.1.0
@access public
@return \Icepay_Webservice_Base | [
"Make",
"connection",
"with",
"the",
"soap",
"client"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L169-L197 |
30,213 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Base.arrangeObject | public function arrangeObject($object, $order = array())
{
if (!is_object($object))
throw new Exception("Please provide a valid Object for the arrangeObject method");
if (!is_array($order) || empty($order))
throw new Exception("Please provide a valid orderArray for the arran... | php | public function arrangeObject($object, $order = array())
{
if (!is_object($object))
throw new Exception("Please provide a valid Object for the arrangeObject method");
if (!is_array($order) || empty($order))
throw new Exception("Please provide a valid orderArray for the arran... | [
"public",
"function",
"arrangeObject",
"(",
"$",
"object",
",",
"$",
"order",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"throw",
"new",
"Exception",
"(",
"\"Please provide a valid Object for the arrangeObject ... | Arrange the object in given order
@since 1.0.2
@access public
@param object $object !required
@param array $order !required
@return object $obj | [
"Arrange",
"the",
"object",
"in",
"given",
"order"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L232-L246 |
30,214 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Base.parseForChecksum | public function parseForChecksum($mainObject, $subObject, $arrange = false, $order = array())
{
if (!is_object($mainObject))
throw new Exception("Please provide a valid Object");
$mainObject = $mainObject;
$i = 1;
$subObject = $this->forceArray($subObject);
f... | php | public function parseForChecksum($mainObject, $subObject, $arrange = false, $order = array())
{
if (!is_object($mainObject))
throw new Exception("Please provide a valid Object");
$mainObject = $mainObject;
$i = 1;
$subObject = $this->forceArray($subObject);
f... | [
"public",
"function",
"parseForChecksum",
"(",
"$",
"mainObject",
",",
"$",
"subObject",
",",
"$",
"arrange",
"=",
"false",
",",
"$",
"order",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"mainObject",
")",
")",
"throw",
"... | Inserts properties of sub object into mainobject as property
@since version 1.0.2
@access public
@param object $mainObject !required
@param object $subObject !required
@param bool $arrange
@param array $order !required if $arrange == true
@return object $obj | [
"Inserts",
"properties",
"of",
"sub",
"object",
"into",
"mainobject",
"as",
"property"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L259-L288 |
30,215 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Base.generateChecksum | public function generateChecksum($obj = null, $secretCode = null,$isautocheckout = false)
{
$arr = array();
if ($secretCode)
array_push($arr, $secretCode);
foreach ($obj as $val) {
$insert = $val;
if (is_bool($val)) {
if ($isautocheckout)... | php | public function generateChecksum($obj = null, $secretCode = null,$isautocheckout = false)
{
$arr = array();
if ($secretCode)
array_push($arr, $secretCode);
foreach ($obj as $val) {
$insert = $val;
if (is_bool($val)) {
if ($isautocheckout)... | [
"public",
"function",
"generateChecksum",
"(",
"$",
"obj",
"=",
"null",
",",
"$",
"secretCode",
"=",
"null",
",",
"$",
"isautocheckout",
"=",
"false",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"secretCode",
")",
"array_push",
... | Generates the checksum
@since 2.1.0
@access public
@param object $obj
@param string $secretCode
@param bool $isautocheckout
@return string | [
"Generates",
"the",
"checksum"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L300-L321 |
30,216 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Base.forceArray | protected function forceArray($obj)
{
if (is_array($obj))
return $obj;
$arr = array();
array_push($arr, $obj);
return $arr;
} | php | protected function forceArray($obj)
{
if (is_array($obj))
return $obj;
$arr = array();
array_push($arr, $obj);
return $arr;
} | [
"protected",
"function",
"forceArray",
"(",
"$",
"obj",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"obj",
")",
")",
"return",
"$",
"obj",
";",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"array_push",
"(",
"$",
"arr",
",",
"$",
"obj",
")",
";",
"r... | Force object into array
@since 2.1.0
@access protected
@param object $obj
@return array | [
"Force",
"object",
"into",
"array"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L331-L339 |
30,217 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethods.retrieveAllPaymentmethods | public function retrieveAllPaymentmethods()
{
if (isset($this->_paymentMethodsArray))
return $this;
$obj = new stdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->_merchantID;
$obj->SecretCode = $this->_secretCode;
$o... | php | public function retrieveAllPaymentmethods()
{
if (isset($this->_paymentMethodsArray))
return $this;
$obj = new stdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->_merchantID;
$obj->SecretCode = $this->_secretCode;
$o... | [
"public",
"function",
"retrieveAllPaymentmethods",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_paymentMethodsArray",
")",
")",
"return",
"$",
"this",
";",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for che... | Retrieve all payment methods
@since 2.1.0
@access public
@return \Icepay_Webservice_Paymentmethods | [
"Retrieve",
"all",
"payment",
"methods"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L366-L387 |
30,218 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethods.clean | protected function clean($obj)
{
$methods = array();
foreach ($this->forceArray($obj->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod) as $value) {
array_push($methods, array(
'PaymentMethodCode' => $value->PaymentMethodCode,
'Description' => $va... | php | protected function clean($obj)
{
$methods = array();
foreach ($this->forceArray($obj->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod) as $value) {
array_push($methods, array(
'PaymentMethodCode' => $value->PaymentMethodCode,
'Description' => $va... | [
"protected",
"function",
"clean",
"(",
"$",
"obj",
")",
"{",
"$",
"methods",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"forceArray",
"(",
"$",
"obj",
"->",
"GetMyPaymentMethodsResult",
"->",
"PaymentMethods",
"->",
"PaymentMethod",
")... | Return clean array
@since 2.1.0
@access protected
@param object $obj
@return array | [
"Return",
"clean",
"array"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L397-L410 |
30,219 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethods.saveToFile | public function saveToFile($fileName = "wsdata", $directory = "")
{
if ($directory == "")
$directory = dirname(__FILE__);
date_default_timezone_set("Europe/Paris");
$line = sprintf("Paymentmethods %s,%s\r\n", date("H:i:s", time()), $this->exportAsString());
$filename = ... | php | public function saveToFile($fileName = "wsdata", $directory = "")
{
if ($directory == "")
$directory = dirname(__FILE__);
date_default_timezone_set("Europe/Paris");
$line = sprintf("Paymentmethods %s,%s\r\n", date("H:i:s", time()), $this->exportAsString());
$filename = ... | [
"public",
"function",
"saveToFile",
"(",
"$",
"fileName",
"=",
"\"wsdata\"",
",",
"$",
"directory",
"=",
"\"\"",
")",
"{",
"if",
"(",
"$",
"directory",
"==",
"\"\"",
")",
"$",
"directory",
"=",
"dirname",
"(",
"__FILE__",
")",
";",
"date_default_timezone_s... | Save ws to File
@since 2.1.0
@access public
@param string $fileName
@param directory $directory
@return boolean
@throws Exception | [
"Save",
"ws",
"to",
"File"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L516-L534 |
30,220 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Filtering.loadFromFile | public function loadFromFile($fileName = "wsdata", $directory = "")
{
if ($directory == "")
$directory = dirname(__FILE__);
$filename = sprintf("%s/%s.csv", $directory, $fileName);
try {
$fp = @fopen($filename, "r");
$line = @fgets($fp);
@fclo... | php | public function loadFromFile($fileName = "wsdata", $directory = "")
{
if ($directory == "")
$directory = dirname(__FILE__);
$filename = sprintf("%s/%s.csv", $directory, $fileName);
try {
$fp = @fopen($filename, "r");
$line = @fgets($fp);
@fclo... | [
"public",
"function",
"loadFromFile",
"(",
"$",
"fileName",
"=",
"\"wsdata\"",
",",
"$",
"directory",
"=",
"\"\"",
")",
"{",
"if",
"(",
"$",
"directory",
"==",
"\"\"",
")",
"$",
"directory",
"=",
"dirname",
"(",
"__FILE__",
")",
";",
"$",
"filename",
"... | Read data from stored file
@since 2.1.0
@access public
@param string $fileName
@param string $directory
@return \Icepay_Webservice_Filtering
@throws Exception | [
"Read",
"data",
"from",
"stored",
"file"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L598-L620 |
30,221 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Filtering.isPaymentMethodAvailable | public function isPaymentMethodAvailable($pmCode) {
foreach ($this->_paymentMethodsArrayFiltered as $value) {
if ($value['PaymentMethodCode'] == $pmCode)
return true;
}
return false;
} | php | public function isPaymentMethodAvailable($pmCode) {
foreach ($this->_paymentMethodsArrayFiltered as $value) {
if ($value['PaymentMethodCode'] == $pmCode)
return true;
}
return false;
} | [
"public",
"function",
"isPaymentMethodAvailable",
"(",
"$",
"pmCode",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_paymentMethodsArrayFiltered",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"[",
"'PaymentMethodCode'",
"]",
"==",
"$",
"pmCode",
")... | Check if payment method is available.
@param $pmCode
@return bool | [
"Check",
"if",
"payment",
"method",
"is",
"available",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L708-L715 |
30,222 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethod.selectPaymentMethodByCode | public function selectPaymentMethodByCode($name)
{
if (!isset($this->_paymentMethodsArray))
throw new Exception("No data loaded");
foreach ($this->_paymentMethodsArray as $paymentMethod) {
if ($paymentMethod["PaymentMethodCode"] == strtoupper($name)) {
$this->... | php | public function selectPaymentMethodByCode($name)
{
if (!isset($this->_paymentMethodsArray))
throw new Exception("No data loaded");
foreach ($this->_paymentMethodsArray as $paymentMethod) {
if ($paymentMethod["PaymentMethodCode"] == strtoupper($name)) {
$this->... | [
"public",
"function",
"selectPaymentMethodByCode",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_paymentMethodsArray",
")",
")",
"throw",
"new",
"Exception",
"(",
"\"No data loaded\"",
")",
";",
"foreach",
"(",
"$",
"this",
... | Select the payment method by code
@since 2.1.0
@access public
@param string $name
@return \Icepay_Webservice_Paymentmethod
@throws Exception | [
"Select",
"the",
"payment",
"method",
"by",
"code"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L767-L778 |
30,223 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethod.selectIssuerByKeyword | public function selectIssuerByKeyword($name)
{
if (!isset($this->_paymentMethodsArray))
throw new Exception("No data loaded");
foreach ($this->_paymentMethodsArray as $paymentMethod) {
foreach ($paymentMethod["Issuers"] as $issuer) {
if ($issuer["IssuerKeyword... | php | public function selectIssuerByKeyword($name)
{
if (!isset($this->_paymentMethodsArray))
throw new Exception("No data loaded");
foreach ($this->_paymentMethodsArray as $paymentMethod) {
foreach ($paymentMethod["Issuers"] as $issuer) {
if ($issuer["IssuerKeyword... | [
"public",
"function",
"selectIssuerByKeyword",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_paymentMethodsArray",
")",
")",
"throw",
"new",
"Exception",
"(",
"\"No data loaded\"",
")",
";",
"foreach",
"(",
"$",
"this",
"->... | Select an issuer by keyword
@since 2.1.0
@access public
@param string $name
@return \Icepay_Webservice_Paymentmethod
@throws Exception | [
"Select",
"an",
"issuer",
"by",
"keyword"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L789-L803 |
30,224 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethod.selectCountry | public function selectCountry($country)
{
if (!isset($this->_issuerData)) {
$this->_country = $this->validateCountry($country);
return $this;
}
if (in_array($country, $this->getCountries())) {
$this->_country = $this->validateCountry($country);
... | php | public function selectCountry($country)
{
if (!isset($this->_issuerData)) {
$this->_country = $this->validateCountry($country);
return $this;
}
if (in_array($country, $this->getCountries())) {
$this->_country = $this->validateCountry($country);
... | [
"public",
"function",
"selectCountry",
"(",
"$",
"country",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_issuerData",
")",
")",
"{",
"$",
"this",
"->",
"_country",
"=",
"$",
"this",
"->",
"validateCountry",
"(",
"$",
"country",
")",
"... | Selects the country out of the issuer data
@since 2.1.0
@access Public
@param string $country
@return \Icepay_Webservice_Paymentmethod | [
"Selects",
"the",
"country",
"out",
"of",
"the",
"issuer",
"data"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L813-L830 |
30,225 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Paymentmethod.getMaximumAmount | public function getMaximumAmount()
{
if (!isset($this->_issuerData))
throw new Exception("Issuer must be selected first");
if (!isset($this->_country))
throw new Exception("Country must be selected first");
foreach ($this->_issuerData["Countries"] as $country) {
... | php | public function getMaximumAmount()
{
if (!isset($this->_issuerData))
throw new Exception("Issuer must be selected first");
if (!isset($this->_country))
throw new Exception("Country must be selected first");
foreach ($this->_issuerData["Countries"] as $country) {
... | [
"public",
"function",
"getMaximumAmount",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_issuerData",
")",
")",
"throw",
"new",
"Exception",
"(",
"\"Issuer must be selected first\"",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
... | Get maximum amount
@since 2.1.0
@access public
@return int
@throws Exception | [
"Get",
"maximum",
"amount"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L941-L952 |
30,226 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Pay.checkOut | public function checkOut(Icepay_PaymentObject_Interface_Abstract $paymentObj, $getUrlOnly = false)
{
$obj = new stdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->Amount = ... | php | public function checkOut(Icepay_PaymentObject_Interface_Abstract $paymentObj, $getUrlOnly = false)
{
$obj = new stdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->Amount = ... | [
"public",
"function",
"checkOut",
"(",
"Icepay_PaymentObject_Interface_Abstract",
"$",
"paymentObj",
",",
"$",
"getUrlOnly",
"=",
"false",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum ---------",
"$",
"obj",
... | The Checkout web method allows you to initialize a new payment in the ICEPAY system for ALL the
payment methods that you have access to
@since version 2.1.0
@access public
@param Icepay_PaymentObject_Interface_Abstract $paymentObj
@param bool $geturlOnly
@return array result | [
"The",
"Checkout",
"web",
"method",
"allows",
"you",
"to",
"initialize",
"a",
"new",
"payment",
"in",
"the",
"ICEPAY",
"system",
"for",
"ALL",
"the",
"payment",
"methods",
"that",
"you",
"have",
"access",
"to"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1180-L1228 |
30,227 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Pay.phoneCheckout | public function phoneCheckout(Icepay_PaymentObject_Interface_Abstract $paymentObj, $getUrlOnly = false)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->Amou... | php | public function phoneCheckout(Icepay_PaymentObject_Interface_Abstract $paymentObj, $getUrlOnly = false)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->Amou... | [
"public",
"function",
"phoneCheckout",
"(",
"Icepay_PaymentObject_Interface_Abstract",
"$",
"paymentObj",
",",
"$",
"getUrlOnly",
"=",
"false",
")",
"{",
"$",
"obj",
"=",
"new",
"StdClass",
"(",
")",
";",
"// Must be in specific order for checksum ---------",
"$",
"ob... | The PhoneCheckout web method allows you to create a phone payment in the ICEPAY system. The
main difference with the Checkout web method is the response. The response is a
PhoneCheckoutResponse object, which contains extra members such as the phone number etc., making
seamless integration possible.
@since 2.1.0
@a... | [
"The",
"PhoneCheckout",
"web",
"method",
"allows",
"you",
"to",
"create",
"a",
"phone",
"payment",
"in",
"the",
"ICEPAY",
"system",
".",
"The",
"main",
"difference",
"with",
"the",
"Checkout",
"web",
"method",
"is",
"the",
"response",
".",
"The",
"response",... | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1242-L1285 |
30,228 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Pay.validatePhoneCode | public function validatePhoneCode($paymentID, $phoneCode)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->PaymentID = $paymentID;
$obj->Phon... | php | public function validatePhoneCode($paymentID, $phoneCode)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->PaymentID = $paymentID;
$obj->Phon... | [
"public",
"function",
"validatePhoneCode",
"(",
"$",
"paymentID",
",",
"$",
"phoneCode",
")",
"{",
"$",
"obj",
"=",
"new",
"StdClass",
"(",
")",
";",
"// Must be in specific order for checksum --------- ",
"$",
"obj",
"->",
"MerchantID",
"=",
"$",
"this",
... | The ValidatePhoneCode web method verifies the code that the end-user must provide in
order to start a phone payment.
@since 2.1.0
@access public
@param int $paymentID
@param int $phoneCode
@return bool success | [
"The",
"ValidatePhoneCode",
"web",
"method",
"verifies",
"the",
"code",
"that",
"the",
"end",
"-",
"user",
"must",
"provide",
"in",
"order",
"to",
"start",
"a",
"phone",
"payment",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1363-L1389 |
30,229 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Pay.validateSmsCode | public function validateSmsCode($paymentID, $smsCode)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->PaymentID = $paymentID;
$obj->SmsCode ... | php | public function validateSmsCode($paymentID, $smsCode)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->PaymentID = $paymentID;
$obj->SmsCode ... | [
"public",
"function",
"validateSmsCode",
"(",
"$",
"paymentID",
",",
"$",
"smsCode",
")",
"{",
"$",
"obj",
"=",
"new",
"StdClass",
"(",
")",
";",
"// Must be in specific order for checksum --------- ",
"$",
"obj",
"->",
"MerchantID",
"=",
"$",
"this",
"->... | The ValidateSmsCode web method validates the code that the end-user must provide.
@since 2.1.0
@access public
@param int $paymentID
@param int $smsCode
@return bool success | [
"The",
"ValidateSmsCode",
"web",
"method",
"validates",
"the",
"code",
"that",
"the",
"end",
"-",
"user",
"must",
"provide",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1400-L1426 |
30,230 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Pay.phoneDirectCheckout | public function phoneDirectCheckout(Icepay_PaymentObject_Interface_Abstract $paymentObj)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->Amount = $paymentOb... | php | public function phoneDirectCheckout(Icepay_PaymentObject_Interface_Abstract $paymentObj)
{
$obj = new StdClass();
// Must be in specific order for checksum ---------
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->Amount = $paymentOb... | [
"public",
"function",
"phoneDirectCheckout",
"(",
"Icepay_PaymentObject_Interface_Abstract",
"$",
"paymentObj",
")",
"{",
"$",
"obj",
"=",
"new",
"StdClass",
"(",
")",
";",
"// Must be in specific order for checksum ---------",
"$",
"obj",
"->",
"MerchantID",
"=",
"$",
... | The phoneDirectCheckout web method allows you to initialize a new payment in the ICEPAY system
with paymentmethod Phone with Pincode
@since version 2.1.0
@access public
@param object $data
@return array result | [
"The",
"phoneDirectCheckout",
"web",
"method",
"allows",
"you",
"to",
"initialize",
"a",
"new",
"payment",
"in",
"the",
"ICEPAY",
"system",
"with",
"paymentmethod",
"Phone",
"with",
"Pincode"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1437-L1487 |
30,231 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Refunds.requestRefund | public function requestRefund($paymentID, $refundAmount, $refundCurrency)
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Secret = $this->getSecretCode();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
... | php | public function requestRefund($paymentID, $refundAmount, $refundCurrency)
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Secret = $this->getSecretCode();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
... | [
"public",
"function",
"requestRefund",
"(",
"$",
"paymentID",
",",
"$",
"refundAmount",
",",
"$",
"refundCurrency",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum --",
"$",
"obj",
"->",
"Secret",
"=",
"$... | The RequestRefund web method allows you to initiate a refund request for a payment. You can request
the entire amount to be refunded or just a part of it. If you request only a partial amount to be refunded
then you are allowed to perform refund requests for the same payment until you have reached its full
amount. Aft... | [
"The",
"RequestRefund",
"web",
"method",
"allows",
"you",
"to",
"initiate",
"a",
"refund",
"request",
"for",
"a",
"payment",
".",
"You",
"can",
"request",
"the",
"entire",
"amount",
"to",
"be",
"refunded",
"or",
"just",
"a",
"part",
"of",
"it",
".",
"If"... | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1619-L1658 |
30,232 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Refunds.cancelRefund | public function cancelRefund($refundID, $paymentID)
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Secret = $this->getSecretCode();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->RefundID = $refu... | php | public function cancelRefund($refundID, $paymentID)
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Secret = $this->getSecretCode();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->RefundID = $refu... | [
"public",
"function",
"cancelRefund",
"(",
"$",
"refundID",
",",
"$",
"paymentID",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum --",
"$",
"obj",
"->",
"Secret",
"=",
"$",
"this",
"->",
"getSecretCode",... | The CancelRefund web method allows you to cancel a refund request if it has not already been processed.
@since version 2.1.0
@access public
@param int $refundID
@param int $paymentID | [
"The",
"CancelRefund",
"web",
"method",
"allows",
"you",
"to",
"cancel",
"a",
"refund",
"request",
"if",
"it",
"has",
"not",
"already",
"been",
"processed",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1668-L1700 |
30,233 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Refunds.getPaymentRefunds | public function getPaymentRefunds($paymentID)
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Secret = $this->getSecretCode();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->PaymentID = $paymentID... | php | public function getPaymentRefunds($paymentID)
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Secret = $this->getSecretCode();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimeStamp();
$obj->PaymentID = $paymentID... | [
"public",
"function",
"getPaymentRefunds",
"(",
"$",
"paymentID",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum --",
"$",
"obj",
"->",
"Secret",
"=",
"$",
"this",
"->",
"getSecretCode",
"(",
")",
";",
... | The GetPaymentRefunds web method allows you to query refund request information that belongs to the payment.
@since version 2.1.0
@access public
@param int $paymentID | [
"The",
"GetPaymentRefunds",
"web",
"method",
"allows",
"you",
"to",
"query",
"refund",
"request",
"information",
"that",
"belongs",
"to",
"the",
"payment",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L1709-L1746 |
30,234 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Reporting.getMerchants | public function getMerchants()
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Timestamp = $this->getTimeStamp();
$obj->SessionID = $this->getSessionID();
$obj->PinCode = $this->getPinCode();
$obj->UserAgent = $this->getUserAgent();
... | php | public function getMerchants()
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Timestamp = $this->getTimeStamp();
$obj->SessionID = $this->getSessionID();
$obj->PinCode = $this->getPinCode();
$obj->UserAgent = $this->getUserAgent();
... | [
"public",
"function",
"getMerchants",
"(",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum --",
"$",
"obj",
"->",
"Timestamp",
"=",
"$",
"this",
"->",
"getTimeStamp",
"(",
")",
";",
"$",
"obj",
"->",
... | The getMerchant web method returns a list of merchants that belong to your ICEPAY account.
@since version 2.1.0
@access public
@return array | [
"The",
"getMerchant",
"web",
"method",
"returns",
"a",
"list",
"of",
"merchants",
"that",
"belong",
"to",
"your",
"ICEPAY",
"account",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L2174-L2210 |
30,235 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Reporting.getPaymentMethods | public function getPaymentMethods()
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Timestamp = $this->getTimeStamp();
$obj->SessionID = $this->getSessionID();
$obj->PinCode = $this->getPinCode();
$obj->UserAgent = $this->getUserAgent();
... | php | public function getPaymentMethods()
{
$obj = new stdClass();
// Must be in specific order for checksum --
$obj->Timestamp = $this->getTimeStamp();
$obj->SessionID = $this->getSessionID();
$obj->PinCode = $this->getPinCode();
$obj->UserAgent = $this->getUserAgent();
... | [
"public",
"function",
"getPaymentMethods",
"(",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum --",
"$",
"obj",
"->",
"Timestamp",
"=",
"$",
"this",
"->",
"getTimeStamp",
"(",
")",
";",
"$",
"obj",
"->... | The getPaymentMethods web method returns a list of all supported payment methods by ICEPAY.
@since version 2.1.0
@access public | [
"The",
"getPaymentMethods",
"web",
"method",
"returns",
"a",
"list",
"of",
"all",
"supported",
"payment",
"methods",
"by",
"ICEPAY",
"."
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L2218-L2254 |
30,236 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_Reporting.searchPayments | public function searchPayments($searchOptions = array())
{
$obj = new stdClass();
// Must be in specific order for checksum ----------
$obj->Timestamp = $this->getTimeStamp();
$obj->SessionID = $this->getSessionID();
$obj->PinCode = $this->getPinCode();
$obj->UserAge... | php | public function searchPayments($searchOptions = array())
{
$obj = new stdClass();
// Must be in specific order for checksum ----------
$obj->Timestamp = $this->getTimeStamp();
$obj->SessionID = $this->getSessionID();
$obj->PinCode = $this->getPinCode();
$obj->UserAge... | [
"public",
"function",
"searchPayments",
"(",
"$",
"searchOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"// Must be in specific order for checksum ----------",
"$",
"obj",
"->",
"Timestamp",
"=",
"$",
"this",
"->... | The searchPayments web method allows you to search for payments linked to your ICEPAY account. There are
several filters which you can employ for a more detailed search.
@since version 2.1.0
@access public
@param array searchOptions
@return array | [
"The",
"searchPayments",
"web",
"method",
"allows",
"you",
"to",
"search",
"for",
"payments",
"linked",
"to",
"your",
"ICEPAY",
"account",
".",
"There",
"are",
"several",
"filters",
"which",
"you",
"can",
"employ",
"for",
"a",
"more",
"detailed",
"search",
"... | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L2265-L2341 |
30,237 | ICEPAY/deprecated-i | src/icepay_api_webservice.php | Icepay_Webservice_AutoCapture.captureFull | public function captureFull($paymentID, $amount = 0, $currency = '')
{
$obj = new stdClass();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimestamp();
$obj->amount = $amount;
$obj->currency = $currency;
$obj->PaymentID = $paymentID;... | php | public function captureFull($paymentID, $amount = 0, $currency = '')
{
$obj = new stdClass();
$obj->MerchantID = $this->getMerchantID();
$obj->Timestamp = $this->getTimestamp();
$obj->amount = $amount;
$obj->currency = $currency;
$obj->PaymentID = $paymentID;... | [
"public",
"function",
"captureFull",
"(",
"$",
"paymentID",
",",
"$",
"amount",
"=",
"0",
",",
"$",
"currency",
"=",
"''",
")",
"{",
"$",
"obj",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"obj",
"->",
"MerchantID",
"=",
"$",
"this",
"->",
"getMerc... | Capture an authorized AfterPay payment
@since 1.0.0
@param string $paymentID
@param int $amount
@param string $currency
@return object | [
"Capture",
"an",
"authorized",
"AfterPay",
"payment"
] | 9a22271dfaea7f318a555c00d7e3f8cca9f2a28e | https://github.com/ICEPAY/deprecated-i/blob/9a22271dfaea7f318a555c00d7e3f8cca9f2a28e/src/icepay_api_webservice.php#L2376-L2410 |
30,238 | SIELOnline/libAcumulus | src/Helpers/Token.php | Token.getObjectProperty | protected function getObjectProperty($variable, $property, array $args)
{
$value = null;
$method1 = $property;
$method2 = 'get' . ucfirst($property);
$method3 = 'get_' . $property;
if (method_exists($variable, $method1)) {
$value = call_user_func_array(array($vari... | php | protected function getObjectProperty($variable, $property, array $args)
{
$value = null;
$method1 = $property;
$method2 = 'get' . ucfirst($property);
$method3 = 'get_' . $property;
if (method_exists($variable, $method1)) {
$value = call_user_func_array(array($vari... | [
"protected",
"function",
"getObjectProperty",
"(",
"$",
"variable",
",",
"$",
"property",
",",
"array",
"$",
"args",
")",
"{",
"$",
"value",
"=",
"null",
";",
"$",
"method1",
"=",
"$",
"property",
";",
"$",
"method2",
"=",
"'get'",
".",
"ucfirst",
"(",... | Looks up a property in a web shop specific object.
This part is extracted into a separate method so it can be overridden
with webshop specific ways to access properties. The base implementation
will probably get the property anyway, so override mainly to prevent
notices or warnings.
@param object $variable
The variab... | [
"Looks",
"up",
"a",
"property",
"in",
"a",
"web",
"shop",
"specific",
"object",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/Token.php#L335-L374 |
30,239 | SIELOnline/libAcumulus | src/Helpers/Token.php | Token.implodeValues | protected function implodeValues($glue, $values)
{
$result = '';
$hasProperty = false;
$previous = '';
foreach ($values as $value) {
if ($value['type'] === self::TypeLiteral) {
// Literal value: set aside and only add if next property value
... | php | protected function implodeValues($glue, $values)
{
$result = '';
$hasProperty = false;
$previous = '';
foreach ($values as $value) {
if ($value['type'] === self::TypeLiteral) {
// Literal value: set aside and only add if next property value
... | [
"protected",
"function",
"implodeValues",
"(",
"$",
"glue",
",",
"$",
"values",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"hasProperty",
"=",
"false",
";",
"$",
"previous",
"=",
"''",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
... | Concatenates a list of values using a glue between them.
Literal strings are only used if they are followed by a non-empty
property value. A literal string at the end is only used if the result so
far is not empty.
@param string $glue
@param array[] $values
A list of type-value pairs.
@return array
Returns a type-va... | [
"Concatenates",
"a",
"list",
"of",
"values",
"using",
"a",
"glue",
"between",
"them",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Helpers/Token.php#L391-L439 |
30,240 | ems-project/EMSCommonBundle | Helper/ArrayTool.php | ArrayTool.normalizeAndSerializeArray | public static function normalizeAndSerializeArray(array &$array, int $sort_flags = SORT_REGULAR, int $jsonEncodeOptions = 0)
{
ArrayTool::normalizeArray($array, $sort_flags);
return json_encode($array, $jsonEncodeOptions);
} | php | public static function normalizeAndSerializeArray(array &$array, int $sort_flags = SORT_REGULAR, int $jsonEncodeOptions = 0)
{
ArrayTool::normalizeArray($array, $sort_flags);
return json_encode($array, $jsonEncodeOptions);
} | [
"public",
"static",
"function",
"normalizeAndSerializeArray",
"(",
"array",
"&",
"$",
"array",
",",
"int",
"$",
"sort_flags",
"=",
"SORT_REGULAR",
",",
"int",
"$",
"jsonEncodeOptions",
"=",
"0",
")",
"{",
"ArrayTool",
"::",
"normalizeArray",
"(",
"$",
"array",... | Normalize and json encode an array in order to compute it's hash
@param array $array
@param int $sort_flags
@param int $jsonEncodeOptions
@return false|string | [
"Normalize",
"and",
"json",
"encode",
"an",
"array",
"in",
"order",
"to",
"compute",
"it",
"s",
"hash"
] | 994fce2f727ebf702d327ba4cfce53d3c75bcef5 | https://github.com/ems-project/EMSCommonBundle/blob/994fce2f727ebf702d327ba4cfce53d3c75bcef5/Helper/ArrayTool.php#L15-L19 |
30,241 | ems-project/EMSCommonBundle | Helper/ArrayTool.php | ArrayTool.normalizeArray | public static function normalizeArray(array &$array, int $sort_flags = SORT_REGULAR)
{
ksort($array, $sort_flags);
foreach ($array as $index => &$arr) {
if (is_array($arr)) {
ArrayTool::normalizeArray($arr, $sort_flags);
}
if (is_array($array[$in... | php | public static function normalizeArray(array &$array, int $sort_flags = SORT_REGULAR)
{
ksort($array, $sort_flags);
foreach ($array as $index => &$arr) {
if (is_array($arr)) {
ArrayTool::normalizeArray($arr, $sort_flags);
}
if (is_array($array[$in... | [
"public",
"static",
"function",
"normalizeArray",
"(",
"array",
"&",
"$",
"array",
",",
"int",
"$",
"sort_flags",
"=",
"SORT_REGULAR",
")",
"{",
"ksort",
"(",
"$",
"array",
",",
"$",
"sort_flags",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"ind... | Normalize an array in order to compute it's hash
@param array $array
@param int $sort_flags | [
"Normalize",
"an",
"array",
"in",
"order",
"to",
"compute",
"it",
"s",
"hash"
] | 994fce2f727ebf702d327ba4cfce53d3c75bcef5 | https://github.com/ems-project/EMSCommonBundle/blob/994fce2f727ebf702d327ba4cfce53d3c75bcef5/Helper/ArrayTool.php#L27-L40 |
30,242 | SIELOnline/libAcumulus | src/Web/Result.php | Result.getStatusText | public function getStatusText()
{
switch ($this->getStatus()) {
case self::Status_Success:
return $this->t('message_response_success');
case self::Status_Notices:
return $this->t('message_response_notices');
case self::Status_Warnings:
... | php | public function getStatusText()
{
switch ($this->getStatus()) {
case self::Status_Success:
return $this->t('message_response_success');
case self::Status_Notices:
return $this->t('message_response_notices');
case self::Status_Warnings:
... | [
"public",
"function",
"getStatusText",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"getStatus",
"(",
")",
")",
"{",
"case",
"self",
"::",
"Status_Success",
":",
"return",
"$",
"this",
"->",
"t",
"(",
"'message_response_success'",
")",
";",
"case",
"... | Returns a textual representation of the status.
@return string | [
"Returns",
"a",
"textual",
"representation",
"of",
"the",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L190-L208 |
30,243 | SIELOnline/libAcumulus | src/Web/Result.php | Result.getExceptionMessage | public function getExceptionMessage()
{
$message = '';
if (($e = $this->getException()) !== null) {
$message = $e->getCode() . ': ' . $e->getMessage();
$message = $this->t('message_exception') . ' ' . $message;
}
return $message;
} | php | public function getExceptionMessage()
{
$message = '';
if (($e = $this->getException()) !== null) {
$message = $e->getCode() . ': ' . $e->getMessage();
$message = $this->t('message_exception') . ' ' . $message;
}
return $message;
} | [
"public",
"function",
"getExceptionMessage",
"(",
")",
"{",
"$",
"message",
"=",
"''",
";",
"if",
"(",
"(",
"$",
"e",
"=",
"$",
"this",
"->",
"getException",
"(",
")",
")",
"!==",
"null",
")",
"{",
"$",
"message",
"=",
"$",
"e",
"->",
"getCode",
... | Returns the exception message, if an exception was set.
@return string | [
"Returns",
"the",
"exception",
"message",
"if",
"an",
"exception",
"was",
"set",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L285-L293 |
30,244 | SIELOnline/libAcumulus | src/Web/Result.php | Result.addMessages | protected function addMessages($method, array $messages)
{
// If there was exactly 1 message, it wasn't put in an array of messages.
if (array_key_exists('code', $messages)) {
$messages = array($messages);
}
foreach ($messages as $message) {
call_user_func(arr... | php | protected function addMessages($method, array $messages)
{
// If there was exactly 1 message, it wasn't put in an array of messages.
if (array_key_exists('code', $messages)) {
$messages = array($messages);
}
foreach ($messages as $message) {
call_user_func(arr... | [
"protected",
"function",
"addMessages",
"(",
"$",
"method",
",",
"array",
"$",
"messages",
")",
"{",
"// If there was exactly 1 message, it wasn't put in an array of messages.",
"if",
"(",
"array_key_exists",
"(",
"'code'",
",",
"$",
"messages",
")",
")",
"{",
"$",
... | Adds multiple warnings to the list of warnings.
A single warning may be passed in as a 1-dimensional array.
@param string $method
@param array $messages
@return $this | [
"Adds",
"multiple",
"warnings",
"to",
"the",
"list",
"of",
"warnings",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L383-L393 |
30,245 | SIELOnline/libAcumulus | src/Web/Result.php | Result.addError | public function addError($code, $codeTag = '', $message = '')
{
return $this->addMessage($code, $codeTag, $message, $this->errors, self::Status_Errors);
} | php | public function addError($code, $codeTag = '', $message = '')
{
return $this->addMessage($code, $codeTag, $message, $this->errors, self::Status_Errors);
} | [
"public",
"function",
"addError",
"(",
"$",
"code",
",",
"$",
"codeTag",
"=",
"''",
",",
"$",
"message",
"=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"addMessage",
"(",
"$",
"code",
",",
"$",
"codeTag",
",",
"$",
"message",
",",
"$",
"this",
... | Adds an error to the list of errors.
@param int|array $code
Error code number. Usually of type 4xx, 5xx, 6xx or 7xx (internal).
It may also be an already completed error array.
@param string $codeTag
Special code tag. Use this as a reference when communicating with
Acumulus technical support.
@param string $message
A ... | [
"Adds",
"an",
"error",
"to",
"the",
"list",
"of",
"errors",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L409-L412 |
30,246 | SIELOnline/libAcumulus | src/Web/Result.php | Result.addNotice | public function addNotice($code, $codeTag = '', $message = '')
{
return $this->addMessage($code, $codeTag, $message, $this->notices, self::Status_Notices);
} | php | public function addNotice($code, $codeTag = '', $message = '')
{
return $this->addMessage($code, $codeTag, $message, $this->notices, self::Status_Notices);
} | [
"public",
"function",
"addNotice",
"(",
"$",
"code",
",",
"$",
"codeTag",
"=",
"''",
",",
"$",
"message",
"=",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"addMessage",
"(",
"$",
"code",
",",
"$",
"codeTag",
",",
"$",
"message",
",",
"$",
"this",
... | Adds a notice to the list of notices.
@param int $code
Notice code number. Usually of type 4xx, 5xx, 6xx or 7xx (internal).
It may also be an already completed notice array.
@param string $codeTag
Special code tag. Use this as a reference when communicating with
Acumulus technical support.
@param string $message
A mes... | [
"Adds",
"a",
"notice",
"to",
"the",
"list",
"of",
"notices",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L447-L450 |
30,247 | SIELOnline/libAcumulus | src/Web/Result.php | Result.mergeMessages | public function mergeMessages(Result $other, $errorsAsWarnings = false)
{
if ($this->getException() === null && $other->getException() !== null) {
$this->setException($other->getException());
}
if ($errorsAsWarnings) {
$this->addWarnings($other->getErrors());
... | php | public function mergeMessages(Result $other, $errorsAsWarnings = false)
{
if ($this->getException() === null && $other->getException() !== null) {
$this->setException($other->getException());
}
if ($errorsAsWarnings) {
$this->addWarnings($other->getErrors());
... | [
"public",
"function",
"mergeMessages",
"(",
"Result",
"$",
"other",
",",
"$",
"errorsAsWarnings",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getException",
"(",
")",
"===",
"null",
"&&",
"$",
"other",
"->",
"getException",
"(",
")",
"!==",
... | Merges sets of exception, error and warning messages of 2 results.
This allows to inform the user about errors and warnings that occurred
during additional API calls, e.g. querying VAT rates or deleteing old
entries.
@param \Siel\Acumulus\Web\Result $other
The other result to add the messages from.
@param bool $error... | [
"Merges",
"sets",
"of",
"exception",
"error",
"and",
"warning",
"messages",
"of",
"2",
"results",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L508-L519 |
30,248 | SIELOnline/libAcumulus | src/Web/Result.php | Result.hasMessages | public function hasMessages()
{
return !empty($this->notices) || !empty($this->warnings) || !empty($this->errors) || !empty($this->exception);
} | php | public function hasMessages()
{
return !empty($this->notices) || !empty($this->warnings) || !empty($this->errors) || !empty($this->exception);
} | [
"public",
"function",
"hasMessages",
"(",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"notices",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
"->",
"warnings",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
"->",
"errors",
")",
"||",
"!",
... | Returns whether the result contains a warning, error or exception.
@return bool
True if the result contains at least 1 warning, error or exception,
false otherwise. | [
"Returns",
"whether",
"the",
"result",
"contains",
"a",
"warning",
"error",
"or",
"exception",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L528-L531 |
30,249 | SIELOnline/libAcumulus | src/Web/Result.php | Result.hasCode | public function hasCode($code)
{
if ($this->getException() !== null && $this->getException()->getCode() === $code) {
return true;
}
foreach ($this->getErrors() as $message) {
if ($message['code'] == $code) {
return true;
}
}
... | php | public function hasCode($code)
{
if ($this->getException() !== null && $this->getException()->getCode() === $code) {
return true;
}
foreach ($this->getErrors() as $message) {
if ($message['code'] == $code) {
return true;
}
}
... | [
"public",
"function",
"hasCode",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getException",
"(",
")",
"!==",
"null",
"&&",
"$",
"this",
"->",
"getException",
"(",
")",
"->",
"getCode",
"(",
")",
"===",
"$",
"code",
")",
"{",
"return"... | Returns whether the result contains a given code.
@param int $code
@return bool
True if the result contains a given code, false otherwise. | [
"Returns",
"whether",
"the",
"result",
"contains",
"a",
"given",
"code",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L553-L578 |
30,250 | SIELOnline/libAcumulus | src/Web/Result.php | Result.hasCodeTag | public function hasCodeTag($codeTag)
{
return array_key_exists($codeTag, $this->errors) || array_key_exists($codeTag, $this->warnings) || array_key_exists($codeTag, $this->notices);
} | php | public function hasCodeTag($codeTag)
{
return array_key_exists($codeTag, $this->errors) || array_key_exists($codeTag, $this->warnings) || array_key_exists($codeTag, $this->notices);
} | [
"public",
"function",
"hasCodeTag",
"(",
"$",
"codeTag",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"codeTag",
",",
"$",
"this",
"->",
"errors",
")",
"||",
"array_key_exists",
"(",
"$",
"codeTag",
",",
"$",
"this",
"->",
"warnings",
")",
"||",
"ar... | Returns whether the result contains a given codeTag.
@param string $codeTag
@return bool
True if the result contains a given codeTag, false otherwise. | [
"Returns",
"whether",
"the",
"result",
"contains",
"a",
"given",
"codeTag",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L588-L591 |
30,251 | SIELOnline/libAcumulus | src/Web/Result.php | Result.getMessages | public function getMessages($format = self::Format_Array)
{
$messages = array();
// Collect the messages.
if (($message = $this->getExceptionMessage()) !== '') {
$messages[] = $message;
}
$messages = array_merge($messages, $this->getErrors(self::Format_PlainTextA... | php | public function getMessages($format = self::Format_Array)
{
$messages = array();
// Collect the messages.
if (($message = $this->getExceptionMessage()) !== '') {
$messages[] = $message;
}
$messages = array_merge($messages, $this->getErrors(self::Format_PlainTextA... | [
"public",
"function",
"getMessages",
"(",
"$",
"format",
"=",
"self",
"::",
"Format_Array",
")",
"{",
"$",
"messages",
"=",
"array",
"(",
")",
";",
"// Collect the messages.",
"if",
"(",
"(",
"$",
"message",
"=",
"$",
"this",
"->",
"getExceptionMessage",
"... | If the result contains any errors or warnings, a list of verbose messages
is returned.
@param int $format
The format in which to return the messages:
- Result::Format_PlainTextArray: an array of strings
- Result::Format_FormattedText: a plain text string with all messages
on its own line indented by a '*'.
- Result::F... | [
"If",
"the",
"result",
"contains",
"any",
"errors",
"or",
"warnings",
"a",
"list",
"of",
"verbose",
"messages",
"is",
"returned",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L609-L622 |
30,252 | SIELOnline/libAcumulus | src/Web/Result.php | Result.formatMessages | protected function formatMessages($messages, $format, $type = '')
{
if ($format === self::Format_Array) {
$result = $messages;
} else {
$result = array();
foreach ($messages as $message) {
if (is_array($message)) {
$messagePart... | php | protected function formatMessages($messages, $format, $type = '')
{
if ($format === self::Format_Array) {
$result = $messages;
} else {
$result = array();
foreach ($messages as $message) {
if (is_array($message)) {
$messagePart... | [
"protected",
"function",
"formatMessages",
"(",
"$",
"messages",
",",
"$",
"format",
",",
"$",
"type",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"format",
"===",
"self",
"::",
"Format_Array",
")",
"{",
"$",
"result",
"=",
"$",
"messages",
";",
"}",
"else"... | Formats a set of messages.
@param string[] $messages
@param int $format
@param string $type
@return string|\string[] | [
"Formats",
"a",
"set",
"of",
"messages",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L634-L664 |
30,253 | SIELOnline/libAcumulus | src/Web/Result.php | Result.ApiStatus2InternalStatus | protected function ApiStatus2InternalStatus($status)
{
switch ($status) {
case Api::Success:
return self::Status_Success;
case Api::Errors:
return self::Status_Errors;
case Api::Warnings:
return self::Status_Warnings;
... | php | protected function ApiStatus2InternalStatus($status)
{
switch ($status) {
case Api::Success:
return self::Status_Success;
case Api::Errors:
return self::Status_Errors;
case Api::Warnings:
return self::Status_Warnings;
... | [
"protected",
"function",
"ApiStatus2InternalStatus",
"(",
"$",
"status",
")",
"{",
"switch",
"(",
"$",
"status",
")",
"{",
"case",
"Api",
"::",
"Success",
":",
"return",
"self",
"::",
"Status_Success",
";",
"case",
"Api",
"::",
"Errors",
":",
"return",
"se... | Returns the corresponding internal status.
@param $status
The status as returned by the API.
@return int
The corresponding internal status. | [
"Returns",
"the",
"corresponding",
"internal",
"status",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L721-L734 |
30,254 | SIELOnline/libAcumulus | src/Web/Result.php | Result.getRawRequestResponse | public function getRawRequestResponse($format)
{
$result = '';
if ($this->getRawRequest() !== null || $this->getRawResponse() !== null) {
$messages = array();
if ($this->getRawRequest() !== null) {
$messages[] = $this->t('message_sent') . ":\n" . $this->getRaw... | php | public function getRawRequestResponse($format)
{
$result = '';
if ($this->getRawRequest() !== null || $this->getRawResponse() !== null) {
$messages = array();
if ($this->getRawRequest() !== null) {
$messages[] = $this->t('message_sent') . ":\n" . $this->getRaw... | [
"public",
"function",
"getRawRequestResponse",
"(",
"$",
"format",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"getRawRequest",
"(",
")",
"!==",
"null",
"||",
"$",
"this",
"->",
"getRawResponse",
"(",
")",
"!==",
"null",
")",... | Returns a string with messages for support, ie the request and response.
In html format it will be formatted in a details tag so that it is closed
by default.
@param $format
@return string | [
"Returns",
"a",
"string",
"with",
"messages",
"for",
"support",
"ie",
"the",
"request",
"and",
"response",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L801-L815 |
30,255 | SIELOnline/libAcumulus | src/Web/Result.php | Result.toLogString | public function toLogString()
{
$logParts = array();
if ($this->getStatus() !== null) {
$logParts[] = 'status=' . $this->getStatus();
}
if ($this->getRawRequest() !== null) {
$logParts[] = 'request=' . $this->getRawRequest();
}
if ($this->getRa... | php | public function toLogString()
{
$logParts = array();
if ($this->getStatus() !== null) {
$logParts[] = 'status=' . $this->getStatus();
}
if ($this->getRawRequest() !== null) {
$logParts[] = 'request=' . $this->getRawRequest();
}
if ($this->getRa... | [
"public",
"function",
"toLogString",
"(",
")",
"{",
"$",
"logParts",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getStatus",
"(",
")",
"!==",
"null",
")",
"{",
"$",
"logParts",
"[",
"]",
"=",
"'status='",
".",
"$",
"this",
"->",
"... | Returns a string representation of the result object for logging purposes.
@return string
A string representation of the result object for logging purposes. | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"result",
"object",
"for",
"logging",
"purposes",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L823-L839 |
30,256 | SIELOnline/libAcumulus | src/Web/Result.php | Result.simplifyResponse | protected function simplifyResponse(array $response)
{
// Simplify response by removing main key (which should be the only
// remaining one).
if (!empty($this->mainResponseKey) && isset($response[$this->mainResponseKey])) {
$response = $response[$this->mainResponseKey];
... | php | protected function simplifyResponse(array $response)
{
// Simplify response by removing main key (which should be the only
// remaining one).
if (!empty($this->mainResponseKey) && isset($response[$this->mainResponseKey])) {
$response = $response[$this->mainResponseKey];
... | [
"protected",
"function",
"simplifyResponse",
"(",
"array",
"$",
"response",
")",
"{",
"// Simplify response by removing main key (which should be the only",
"// remaining one).",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"mainResponseKey",
")",
"&&",
"isset",
"("... | Simplify the response by removing the main key.
@param array $response
@return array | [
"Simplify",
"the",
"response",
"by",
"removing",
"the",
"main",
"key",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Result.php#L848-L866 |
30,257 | ems-project/EMSCommonBundle | Storage/Processor/Config.php | Config.isValid | public function isValid(\DateTime $lastCacheDate = null): bool
{
$publishedDateTime = $this->getLastUpdateDate();
if ($publishedDateTime && $publishedDateTime < $lastCacheDate) {
return true;
}
return null === $publishedDateTime && null !== $lastCacheDate;
} | php | public function isValid(\DateTime $lastCacheDate = null): bool
{
$publishedDateTime = $this->getLastUpdateDate();
if ($publishedDateTime && $publishedDateTime < $lastCacheDate) {
return true;
}
return null === $publishedDateTime && null !== $lastCacheDate;
} | [
"public",
"function",
"isValid",
"(",
"\\",
"DateTime",
"$",
"lastCacheDate",
"=",
"null",
")",
":",
"bool",
"{",
"$",
"publishedDateTime",
"=",
"$",
"this",
"->",
"getLastUpdateDate",
"(",
")",
";",
"if",
"(",
"$",
"publishedDateTime",
"&&",
"$",
"publish... | Asset_config_type is optional, so _published_datetime can be null | [
"Asset_config_type",
"is",
"optional",
"so",
"_published_datetime",
"can",
"be",
"null"
] | 994fce2f727ebf702d327ba4cfce53d3c75bcef5 | https://github.com/ems-project/EMSCommonBundle/blob/994fce2f727ebf702d327ba4cfce53d3c75bcef5/Storage/Processor/Config.php#L57-L66 |
30,258 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.getUri | public function getUri($apiFunction)
{
$environment = $this->config->getEnvironment();
$uri = $environment['baseUri'] . '/' . $environment['apiVersion'] . '/' . $apiFunction . '.php';
return $uri;
} | php | public function getUri($apiFunction)
{
$environment = $this->config->getEnvironment();
$uri = $environment['baseUri'] . '/' . $environment['apiVersion'] . '/' . $apiFunction . '.php';
return $uri;
} | [
"public",
"function",
"getUri",
"(",
"$",
"apiFunction",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"config",
"->",
"getEnvironment",
"(",
")",
";",
"$",
"uri",
"=",
"$",
"environment",
"[",
"'baseUri'",
"]",
".",
"'/'",
".",
"$",
"environme... | Returns the uri to the requested API call.
@param string $apiFunction
@return string
The uri to the requested API call. | [
"Returns",
"the",
"uri",
"to",
"the",
"requested",
"API",
"call",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L63-L68 |
30,259 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.callApiFunction | public function callApiFunction($apiFunction, array $message, Result $result = null)
{
if ($result === null) {
$result = $this->container->getResult();
}
$uri = $this->getUri($apiFunction);
try {
$commonMessagePart = $this->getCommonPart();
$messa... | php | public function callApiFunction($apiFunction, array $message, Result $result = null)
{
if ($result === null) {
$result = $this->container->getResult();
}
$uri = $this->getUri($apiFunction);
try {
$commonMessagePart = $this->getCommonPart();
$messa... | [
"public",
"function",
"callApiFunction",
"(",
"$",
"apiFunction",
",",
"array",
"$",
"message",
",",
"Result",
"$",
"result",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"result",
"===",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"container",
... | Sends a message to the given API function and returns the results.
@param string $apiFunction
The API function to invoke.
@param array $message
The values to submit.
@param \Siel\Acumulus\Web\Result $result
It is possible to already create a Result object before calling the Web
Service to store local messages. By pass... | [
"Sends",
"a",
"message",
"to",
"the",
"given",
"API",
"function",
"and",
"returns",
"the",
"results",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L86-L105 |
30,260 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.getCommonPart | protected function getCommonPart()
{
$environment = $this->config->getEnvironment();
$pluginSettings = $this->config->getPluginSettings();
// Complete message with values common to all API calls:
// - contract part
// - format part
// - environment part
$comm... | php | protected function getCommonPart()
{
$environment = $this->config->getEnvironment();
$pluginSettings = $this->config->getPluginSettings();
// Complete message with values common to all API calls:
// - contract part
// - format part
// - environment part
$comm... | [
"protected",
"function",
"getCommonPart",
"(",
")",
"{",
"$",
"environment",
"=",
"$",
"this",
"->",
"config",
"->",
"getEnvironment",
"(",
")",
";",
"$",
"pluginSettings",
"=",
"$",
"this",
"->",
"config",
"->",
"getPluginSettings",
"(",
")",
";",
"// Com... | Returns the common part of each API message.
The common part consists of the following tags:
- contract
- format
- testmode
- connector
@return array
The common part of each API message. | [
"Returns",
"the",
"common",
"part",
"of",
"each",
"API",
"message",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L119-L141 |
30,261 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.sendApiMessage | protected function sendApiMessage($uri, array $message, Result $result)
{
// Convert message to XML. XML requires 1 top level tag, so add one.
// The tagname is ignored by the Acumulus WebAPI.
$message = $this->convertArrayToXml(array('myxml' => $message));
// Keep track of communica... | php | protected function sendApiMessage($uri, array $message, Result $result)
{
// Convert message to XML. XML requires 1 top level tag, so add one.
// The tagname is ignored by the Acumulus WebAPI.
$message = $this->convertArrayToXml(array('myxml' => $message));
// Keep track of communica... | [
"protected",
"function",
"sendApiMessage",
"(",
"$",
"uri",
",",
"array",
"$",
"message",
",",
"Result",
"$",
"result",
")",
"{",
"// Convert message to XML. XML requires 1 top level tag, so add one.",
"// The tagname is ignored by the Acumulus WebAPI.",
"$",
"message",
"=",
... | Sends a message to the Acumulus API and returns the answer.
Any errors during:
- conversion of the message to xml,
- communication with the Acumulus web service
- converting the answer to an array
are returned as an Exception.
Any errors (or warnings) returned in the response structure of the web
service are returned... | [
"Sends",
"a",
"message",
"to",
"the",
"Acumulus",
"API",
"and",
"returns",
"the",
"answer",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L169-L217 |
30,262 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.convertXmlToArray | protected function convertXmlToArray($xml)
{
// Convert the response to an array via a 3-way conversion:
// - create a simplexml object
// - convert that to json
// - convert json to array
libxml_use_internal_errors(true);
if (!($result = simplexml_load_string($xml, '... | php | protected function convertXmlToArray($xml)
{
// Convert the response to an array via a 3-way conversion:
// - create a simplexml object
// - convert that to json
// - convert json to array
libxml_use_internal_errors(true);
if (!($result = simplexml_load_string($xml, '... | [
"protected",
"function",
"convertXmlToArray",
"(",
"$",
"xml",
")",
"{",
"// Convert the response to an array via a 3-way conversion:",
"// - create a simplexml object",
"// - convert that to json",
"// - convert json to array",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
... | Converts an XML string to an array.
@param string $xml
A string containing XML.
@return array
An array representation of the XML string.
@throws \RuntimeException | [
"Converts",
"an",
"XML",
"string",
"to",
"an",
"array",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L302-L321 |
30,263 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.convertArrayToXml | protected function convertArrayToXml(array $values)
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->xmlStandalone = true;
$dom->formatOutput = true;
try {
$dom = $this->convertToDom($values, $dom);
$result = $dom->saveXML();
if (!$result) {
... | php | protected function convertArrayToXml(array $values)
{
$dom = new DOMDocument('1.0', 'utf-8');
$dom->xmlStandalone = true;
$dom->formatOutput = true;
try {
$dom = $this->convertToDom($values, $dom);
$result = $dom->saveXML();
if (!$result) {
... | [
"protected",
"function",
"convertArrayToXml",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf-8'",
")",
";",
"$",
"dom",
"->",
"xmlStandalone",
"=",
"true",
";",
"$",
"dom",
"->",
"formatOutput",
"="... | Converts a keyed, optionally multi-level, array to XML.
Each key is converted to a tag, no attributes are used. Numeric
sub-arrays are repeated using the same key.
@param array $values
The array to convert to XML.
@return string
The XML string
@throws \RuntimeException | [
"Converts",
"a",
"keyed",
"optionally",
"multi",
"-",
"level",
"array",
"to",
"XML",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L337-L359 |
30,264 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.convertToDom | protected function convertToDom($values, $element)
{
/** @var DOMDocument $document */
static $document = null;
$isFirstElement = true;
if ($element instanceof DOMDocument) {
$document = $element;
}
if (is_array($values)) {
foreach ($values as... | php | protected function convertToDom($values, $element)
{
/** @var DOMDocument $document */
static $document = null;
$isFirstElement = true;
if ($element instanceof DOMDocument) {
$document = $element;
}
if (is_array($values)) {
foreach ($values as... | [
"protected",
"function",
"convertToDom",
"(",
"$",
"values",
",",
"$",
"element",
")",
"{",
"/** @var DOMDocument $document */",
"static",
"$",
"document",
"=",
"null",
";",
"$",
"isFirstElement",
"=",
"true",
";",
"if",
"(",
"$",
"element",
"instanceof",
"DOM... | Recursively converts a value to a DOMDocument|DOMElement.
@param mixed $values
A keyed array, an numerically indexed array, or a scalar type.
@param DOMDocument|DOMElement $element
The element to append the values to.
@return DOMDocument|DOMElement
@throws \DOMException | [
"Recursively",
"converts",
"a",
"value",
"to",
"a",
"DOMDocument|DOMElement",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L373-L403 |
30,265 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.raiseCurlError | protected function raiseCurlError($ch, $function)
{
$env = $this->config->getEnvironment();
$message = sprintf('%s (curl: %s): ', $function, $env['curlVersion']);
if ($ch) {
$code = curl_errno($ch);
$message .= sprintf('%d - %s', $code, curl_error($ch));
} els... | php | protected function raiseCurlError($ch, $function)
{
$env = $this->config->getEnvironment();
$message = sprintf('%s (curl: %s): ', $function, $env['curlVersion']);
if ($ch) {
$code = curl_errno($ch);
$message .= sprintf('%d - %s', $code, curl_error($ch));
} els... | [
"protected",
"function",
"raiseCurlError",
"(",
"$",
"ch",
",",
"$",
"function",
")",
"{",
"$",
"env",
"=",
"$",
"this",
"->",
"config",
"->",
"getEnvironment",
"(",
")",
";",
"$",
"message",
"=",
"sprintf",
"(",
"'%s (curl: %s): '",
",",
"$",
"function"... | Adds a curl error message to the result.
@param resource|bool $ch
@param string $function | [
"Adds",
"a",
"curl",
"error",
"message",
"to",
"the",
"result",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L411-L424 |
30,266 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.raiseLibxmlError | protected function raiseLibxmlError(array $errors)
{
$messages = array();
$code = 704;
foreach ($errors as $error) {
// Overwrite our own code with the 1st code we get from libxml.
if ($code === 704) {
$code = $error->code;
}
$m... | php | protected function raiseLibxmlError(array $errors)
{
$messages = array();
$code = 704;
foreach ($errors as $error) {
// Overwrite our own code with the 1st code we get from libxml.
if ($code === 704) {
$code = $error->code;
}
$m... | [
"protected",
"function",
"raiseLibxmlError",
"(",
"array",
"$",
"errors",
")",
"{",
"$",
"messages",
"=",
"array",
"(",
")",
";",
"$",
"code",
"=",
"704",
";",
"foreach",
"(",
"$",
"errors",
"as",
"$",
"error",
")",
"{",
"// Overwrite our own code with the... | Adds a libxml error messages to the result.
@param LibXMLError[] $errors
@throws \RuntimeException | [
"Adds",
"a",
"libxml",
"error",
"messages",
"to",
"the",
"result",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L433-L445 |
30,267 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.raiseJsonError | protected function raiseJsonError()
{
$code = json_last_error();
switch ($code) {
case JSON_ERROR_NONE:
$message = 'No error';
break;
case JSON_ERROR_DEPTH:
$message = 'Maximum stack depth exceeded';
break;
... | php | protected function raiseJsonError()
{
$code = json_last_error();
switch ($code) {
case JSON_ERROR_NONE:
$message = 'No error';
break;
case JSON_ERROR_DEPTH:
$message = 'Maximum stack depth exceeded';
break;
... | [
"protected",
"function",
"raiseJsonError",
"(",
")",
"{",
"$",
"code",
"=",
"json_last_error",
"(",
")",
";",
"switch",
"(",
"$",
"code",
")",
"{",
"case",
"JSON_ERROR_NONE",
":",
"$",
"message",
"=",
"'No error'",
";",
"break",
";",
"case",
"JSON_ERROR_DE... | Adds a json error message to the result.
@throws \RuntimeException | [
"Adds",
"a",
"json",
"error",
"message",
"to",
"the",
"result",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L452-L482 |
30,268 | SIELOnline/libAcumulus | src/Web/Communicator.php | Communicator.raiseHtmlReceivedError | protected function raiseHtmlReceivedError($response)
{
libxml_use_internal_errors(true);
$doc = new DOMDocument('1.0', 'utf-8');
$doc->loadHTML($response);
$body = $doc->getElementsByTagName('body');
if ($body->length > 0) {
$body = $body->item(0)->textContent;
... | php | protected function raiseHtmlReceivedError($response)
{
libxml_use_internal_errors(true);
$doc = new DOMDocument('1.0', 'utf-8');
$doc->loadHTML($response);
$body = $doc->getElementsByTagName('body');
if ($body->length > 0) {
$body = $body->item(0)->textContent;
... | [
"protected",
"function",
"raiseHtmlReceivedError",
"(",
"$",
"response",
")",
"{",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"doc",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'utf-8'",
")",
";",
"$",
"doc",
"->",
"loadHTML",
"(",
"$",
"... | Returns an error message containing the received HTML.
@param string $response
String containing an html document.
@trows \RuntimeException | [
"Returns",
"an",
"error",
"message",
"containing",
"the",
"received",
"HTML",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Web/Communicator.php#L492-L504 |
30,269 | SIELOnline/libAcumulus | src/MyWebShop/Invoice/Creator.php | Creator.getItemLine | protected function getItemLine($item)
{
$result = array();
// @todo: add property source(s) for this item line.
$this->addPropertySource('item', $item);
$this->addProductInfo($result);
$sign = $this->invoiceSource->getSign();
// @todo: add other tags and available ... | php | protected function getItemLine($item)
{
$result = array();
// @todo: add property source(s) for this item line.
$this->addPropertySource('item', $item);
$this->addProductInfo($result);
$sign = $this->invoiceSource->getSign();
// @todo: add other tags and available ... | [
"protected",
"function",
"getItemLine",
"(",
"$",
"item",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// @todo: add property source(s) for this item line.",
"$",
"this",
"->",
"addPropertySource",
"(",
"'item'",
",",
"$",
"item",
")",
";",
"$",
"thi... | Returns 1 item line, be it for an order or credit slip.
@todo: specify type of this parameter
@param $item
An OrderDetail line.
@return array | [
"Returns",
"1",
"item",
"line",
"be",
"it",
"for",
"an",
"order",
"or",
"credit",
"slip",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/MyWebShop/Invoice/Creator.php#L97-L151 |
30,270 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.completeInvoiceLinesRecursive | protected function completeInvoiceLinesRecursive(array $invoice)
{
$lines = $invoice[Tag::Customer][Tag::Invoice][Tag::Line];
if ($this->completor->shouldConvertCurrency($invoice)) {
$lines = $this->convertToEuro($lines, $invoice[Tag::Customer][Tag::Invoice][Meta::CurrencyRate]);
... | php | protected function completeInvoiceLinesRecursive(array $invoice)
{
$lines = $invoice[Tag::Customer][Tag::Invoice][Tag::Line];
if ($this->completor->shouldConvertCurrency($invoice)) {
$lines = $this->convertToEuro($lines, $invoice[Tag::Customer][Tag::Invoice][Meta::CurrencyRate]);
... | [
"protected",
"function",
"completeInvoiceLinesRecursive",
"(",
"array",
"$",
"invoice",
")",
"{",
"$",
"lines",
"=",
"$",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
"[",
"Tag",
"::",
"Line",
"]",
";",
"if",
"(",
"$"... | Completes the invoice lines before they are flattened.
This means that the lines have to be walked recursively.
The actions that can be done this way are those who operate on a line in
isolation and thus do not need totals, maximums or things like that.
@param array[] $invoice
The invoice with the lines to complete ... | [
"Completes",
"the",
"invoice",
"lines",
"before",
"they",
"are",
"flattened",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L114-L148 |
30,271 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.completeInvoiceLines | protected function completeInvoiceLines(array $lines)
{
$lines = $this->addVatRateTo0PriceLines($lines);
$lines = $this->recalculateLineData($lines);
$lines = $this->completeLineMetaData($lines);
return $lines;
} | php | protected function completeInvoiceLines(array $lines)
{
$lines = $this->addVatRateTo0PriceLines($lines);
$lines = $this->recalculateLineData($lines);
$lines = $this->completeLineMetaData($lines);
return $lines;
} | [
"protected",
"function",
"completeInvoiceLines",
"(",
"array",
"$",
"lines",
")",
"{",
"$",
"lines",
"=",
"$",
"this",
"->",
"addVatRateTo0PriceLines",
"(",
"$",
"lines",
")",
";",
"$",
"lines",
"=",
"$",
"this",
"->",
"recalculateLineData",
"(",
"$",
"lin... | Completes the invoice lines after they have been flattened.
@param array[] $lines
The invoice lines to complete.
@return array[]
The completed invoice lines. | [
"Completes",
"the",
"invoice",
"lines",
"after",
"they",
"have",
"been",
"flattened",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L159-L165 |
30,272 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.correctCalculatedVatRates | protected function correctCalculatedVatRates(array $lines)
{
foreach ($lines as &$line) {
if (!empty($line[Meta::VatRateSource]) && $line[Meta::VatRateSource] === Creator::VatRateSource_Calculated) {
$line = $this->correctVatRateByRange($line);
}
if (!empt... | php | protected function correctCalculatedVatRates(array $lines)
{
foreach ($lines as &$line) {
if (!empty($line[Meta::VatRateSource]) && $line[Meta::VatRateSource] === Creator::VatRateSource_Calculated) {
$line = $this->correctVatRateByRange($line);
}
if (!empt... | [
"protected",
"function",
"correctCalculatedVatRates",
"(",
"array",
"$",
"lines",
")",
"{",
"foreach",
"(",
"$",
"lines",
"as",
"&",
"$",
"line",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"line",
"[",
"Meta",
"::",
"VatRateSource",
"]",
")",
"&&",
... | Corrects 'calculated' vat rates.
Tries to correct 'calculated' vat rates for rounding errors by matching
them with possible vatRates obtained from the vat lookup service.
@param array[] $lines
The invoice lines to correct.
@return array[]
The corrected invoice lines. | [
"Corrects",
"calculated",
"vat",
"rates",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L214-L225 |
30,273 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.correctVatRateByRange | public function correctVatRateByRange(array $line)
{
$line[Meta::VatRateRangeMatches] = $this->filterVatRateInfosByRange($line[Meta::VatRateMin], $line[Meta::VatRateMax]);
$vatRate = $this->getUniqueVatRate($line[Meta::VatRateRangeMatches]);
if ($vatRate === null) {
// No match ... | php | public function correctVatRateByRange(array $line)
{
$line[Meta::VatRateRangeMatches] = $this->filterVatRateInfosByRange($line[Meta::VatRateMin], $line[Meta::VatRateMax]);
$vatRate = $this->getUniqueVatRate($line[Meta::VatRateRangeMatches]);
if ($vatRate === null) {
// No match ... | [
"public",
"function",
"correctVatRateByRange",
"(",
"array",
"$",
"line",
")",
"{",
"$",
"line",
"[",
"Meta",
"::",
"VatRateRangeMatches",
"]",
"=",
"$",
"this",
"->",
"filterVatRateInfosByRange",
"(",
"$",
"line",
"[",
"Meta",
"::",
"VatRateMin",
"]",
",",
... | Checks and corrects a 'calculated' vat rate to an allowed vat rate.
The meta-vatrate-source must be Creator::VatRateSource_Calculated.
The check is done on comparing allowed vat rates with the
meta-vatrate-min and meta-vatrate-max values. If only 1 match is found
that will be used.
If multiple matches are found with... | [
"Checks",
"and",
"corrects",
"a",
"calculated",
"vat",
"rate",
"to",
"an",
"allowed",
"vat",
"rate",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L252-L289 |
30,274 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.getMaxAppearingVatRate | public static function getMaxAppearingVatRate(array $lines, &$index = 0)
{
$index = null;
$maxVatRate = -1.0;
foreach ($lines as $key => $line) {
if (isset($line[Tag::VatRate]) && (float) $line[Tag::VatRate] > $maxVatRate) {
$index = $key;
$maxVatR... | php | public static function getMaxAppearingVatRate(array $lines, &$index = 0)
{
$index = null;
$maxVatRate = -1.0;
foreach ($lines as $key => $line) {
if (isset($line[Tag::VatRate]) && (float) $line[Tag::VatRate] > $maxVatRate) {
$index = $key;
$maxVatR... | [
"public",
"static",
"function",
"getMaxAppearingVatRate",
"(",
"array",
"$",
"lines",
",",
"&",
"$",
"index",
"=",
"0",
")",
"{",
"$",
"index",
"=",
"null",
";",
"$",
"maxVatRate",
"=",
"-",
"1.0",
";",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"key",... | Returns the maximum vat rate that appears in the given set of lines.
@param array[] $lines
The invoice lines to search.
@param int $index
If passed, the index of the max vat rate is returned via this parameter.
@return float|null
The maximum vat rate in the given set of lines or null if no vat rates
could be found. | [
"Returns",
"the",
"maximum",
"vat",
"rate",
"that",
"appears",
"in",
"the",
"given",
"set",
"of",
"lines",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L547-L558 |
30,275 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.filterVatRateInfosByRange | protected function filterVatRateInfosByRange($min, $max, array $vatRateInfos = null)
{
if ($vatRateInfos === null) {
$vatRateInfos = $this->possibleVatRates;
}
$result = array();
foreach ($vatRateInfos as $vatRateInfo) {
$vatRate = is_array($vatRateInfo) ? $v... | php | protected function filterVatRateInfosByRange($min, $max, array $vatRateInfos = null)
{
if ($vatRateInfos === null) {
$vatRateInfos = $this->possibleVatRates;
}
$result = array();
foreach ($vatRateInfos as $vatRateInfo) {
$vatRate = is_array($vatRateInfo) ? $v... | [
"protected",
"function",
"filterVatRateInfosByRange",
"(",
"$",
"min",
",",
"$",
"max",
",",
"array",
"$",
"vatRateInfos",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"vatRateInfos",
"===",
"null",
")",
"{",
"$",
"vatRateInfos",
"=",
"$",
"this",
"->",
"possi... | Returns the set of possible vat rates that fall in the given vat range.
@param float $min
@param float $max
@param array|null $vatRateInfos
The set of vat rate infos to filter. If not given, the property
$this->possibleVatRates is used.
@return array[]
The, possibly empty, set of vat rate infos that have a vat rate t... | [
"Returns",
"the",
"set",
"of",
"possible",
"vat",
"rates",
"that",
"fall",
"in",
"the",
"given",
"vat",
"range",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L573-L587 |
30,276 | SIELOnline/libAcumulus | src/Invoice/CompletorInvoiceLines.php | CompletorInvoiceLines.filterVatRateInfosByVatRates | protected function filterVatRateInfosByVatRates($vatRates, array $vatRateInfos = null)
{
$vatRates = (array) $vatRates;
if ($vatRateInfos === null) {
$vatRateInfos = $this->possibleVatRates;
}
$result = array();
foreach ($vatRateInfos as $vatRateInfo) {
... | php | protected function filterVatRateInfosByVatRates($vatRates, array $vatRateInfos = null)
{
$vatRates = (array) $vatRates;
if ($vatRateInfos === null) {
$vatRateInfos = $this->possibleVatRates;
}
$result = array();
foreach ($vatRateInfos as $vatRateInfo) {
... | [
"protected",
"function",
"filterVatRateInfosByVatRates",
"(",
"$",
"vatRates",
",",
"array",
"$",
"vatRateInfos",
"=",
"null",
")",
"{",
"$",
"vatRates",
"=",
"(",
"array",
")",
"$",
"vatRates",
";",
"if",
"(",
"$",
"vatRateInfos",
"===",
"null",
")",
"{",... | Returns the subset of the vat rate infos that have a vat rate that appears within the given set of vat rates.
@param float|float[] $vatRates
The vat rate(s) to filter.
@param array|null $vatRateInfos
The set of vat rate infos to filter. If not given, the property
$this->possibleVatRates is used.
@return array[]
The,... | [
"Returns",
"the",
"subset",
"of",
"the",
"vat",
"rate",
"infos",
"that",
"have",
"a",
"vat",
"rate",
"that",
"appears",
"within",
"the",
"given",
"set",
"of",
"vat",
"rates",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorInvoiceLines.php#L603-L621 |
30,277 | ipunkt/rancherize | app/Blueprint/ResourceLimit/EventListener/ServiceBuiltListener.php | ServiceBuiltListener.sidekickBuilt | public function sidekickBuilt(SidekickBuiltEvent $event) {
$service = $event->getService();
$config = $event->getConfiguration();
$this->parser->parseLimit( $service, $config );
} | php | public function sidekickBuilt(SidekickBuiltEvent $event) {
$service = $event->getService();
$config = $event->getConfiguration();
$this->parser->parseLimit( $service, $config );
} | [
"public",
"function",
"sidekickBuilt",
"(",
"SidekickBuiltEvent",
"$",
"event",
")",
"{",
"$",
"service",
"=",
"$",
"event",
"->",
"getService",
"(",
")",
";",
"$",
"config",
"=",
"$",
"event",
"->",
"getConfiguration",
"(",
")",
";",
"$",
"this",
"->",
... | This allows overriding the limits inherited by the main service
@param SidekickBuiltEvent $event | [
"This",
"allows",
"overriding",
"the",
"limits",
"inherited",
"by",
"the",
"main",
"service"
] | 3c226da686b283e7fef961a9a79b54db53b8757b | https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Blueprint/ResourceLimit/EventListener/ServiceBuiltListener.php#L58-L65 |
30,278 | SIELOnline/libAcumulus | src/Config/ShopCapabilities.php | ShopCapabilities.getTokenInfo | public function getTokenInfo()
{
$result = array();
$result['invoiceSource'] = array(
'more-info' => ucfirst($this->t('invoice_source')),
'class' => '\Siel\Acumulus\Invoice\Source',
'properties' => array(
'type (' . $this->t(Source::Order) . ' ' . ... | php | public function getTokenInfo()
{
$result = array();
$result['invoiceSource'] = array(
'more-info' => ucfirst($this->t('invoice_source')),
'class' => '\Siel\Acumulus\Invoice\Source',
'properties' => array(
'type (' . $this->t(Source::Order) . ' ' . ... | [
"public",
"function",
"getTokenInfo",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"result",
"[",
"'invoiceSource'",
"]",
"=",
"array",
"(",
"'more-info'",
"=>",
"ucfirst",
"(",
"$",
"this",
"->",
"t",
"(",
"'invoice_source'",
")",
"... | Returns a list with the shop specific token info.
Many fields of an Acumulus invoice can be filled with user configured and
dynamically looked up values of properties or method return values from
webshop objects that are made available when creating the invoice. The
advanced settings form gives the user an overview of... | [
"Returns",
"a",
"list",
"with",
"the",
"shop",
"specific",
"token",
"info",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/ShopCapabilities.php#L128-L175 |
30,279 | SIELOnline/libAcumulus | src/Config/ShopCapabilities.php | ShopCapabilities.getSupportedInvoiceSourceTypes | public function getSupportedInvoiceSourceTypes()
{
return array(
Source::Order => ucfirst($this->t(Source::Order)),
Source::CreditNote => ucfirst($this->t(Source::CreditNote)),
);
} | php | public function getSupportedInvoiceSourceTypes()
{
return array(
Source::Order => ucfirst($this->t(Source::Order)),
Source::CreditNote => ucfirst($this->t(Source::CreditNote)),
);
} | [
"public",
"function",
"getSupportedInvoiceSourceTypes",
"(",
")",
"{",
"return",
"array",
"(",
"Source",
"::",
"Order",
"=>",
"ucfirst",
"(",
"$",
"this",
"->",
"t",
"(",
"Source",
"::",
"Order",
")",
")",
",",
"Source",
"::",
"CreditNote",
"=>",
"ucfirst"... | Returns a list of invoice source types supported by this shop.
The default implementation returns order and credit note. Override if the
specific shop does not support credit notes (or supports other types).
@return string[]
The list of supported invoice source types. The keys are the internal
{@see \Siel\Acumulus\In... | [
"Returns",
"a",
"list",
"of",
"invoice",
"source",
"types",
"supported",
"by",
"this",
"shop",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/ShopCapabilities.php#L242-L248 |
30,280 | SIELOnline/libAcumulus | src/Config/ShopCapabilities.php | ShopCapabilities.getTriggerCreditNoteEventOptions | public function getTriggerCreditNoteEventOptions()
{
$result = array(
PluginConfig::TriggerCreditNoteEvent_None => $this->t('option_triggerCreditNoteEvent_0'),
);
if (in_array(Source::CreditNote, $this->getSupportedInvoiceSourceTypes())) {
$result[PluginConfig::Trigg... | php | public function getTriggerCreditNoteEventOptions()
{
$result = array(
PluginConfig::TriggerCreditNoteEvent_None => $this->t('option_triggerCreditNoteEvent_0'),
);
if (in_array(Source::CreditNote, $this->getSupportedInvoiceSourceTypes())) {
$result[PluginConfig::Trigg... | [
"public",
"function",
"getTriggerCreditNoteEventOptions",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"PluginConfig",
"::",
"TriggerCreditNoteEvent_None",
"=>",
"$",
"this",
"->",
"t",
"(",
"'option_triggerCreditNoteEvent_0'",
")",
",",
")",
";",
"if",
"(",
... | Returns an option list of credit note related events.
This list represents the shop initiated events that may trigger the
sending of a credit invoice to Acumulus.
This default implementation returns
- PluginConfig::TriggerCreditNoteEvent_None for all shops, and as only
value for shops that do not support credit notes... | [
"Returns",
"an",
"option",
"list",
"of",
"credit",
"note",
"related",
"events",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/ShopCapabilities.php#L287-L298 |
30,281 | SIELOnline/libAcumulus | src/Config/ShopCapabilities.php | ShopCapabilities.getInvoiceNrSourceOptions | public function getInvoiceNrSourceOptions()
{
return array(
PluginConfig::InvoiceNrSource_ShopInvoice => $this->t('option_invoiceNrSource_1'),
PluginConfig::InvoiceNrSource_ShopOrder => $this->t('option_invoiceNrSource_2'),
PluginConfig::InvoiceNrSource_Acumulus => $this-... | php | public function getInvoiceNrSourceOptions()
{
return array(
PluginConfig::InvoiceNrSource_ShopInvoice => $this->t('option_invoiceNrSource_1'),
PluginConfig::InvoiceNrSource_ShopOrder => $this->t('option_invoiceNrSource_2'),
PluginConfig::InvoiceNrSource_Acumulus => $this-... | [
"public",
"function",
"getInvoiceNrSourceOptions",
"(",
")",
"{",
"return",
"array",
"(",
"PluginConfig",
"::",
"InvoiceNrSource_ShopInvoice",
"=>",
"$",
"this",
"->",
"t",
"(",
"'option_invoiceNrSource_1'",
")",
",",
"PluginConfig",
"::",
"InvoiceNrSource_ShopOrder",
... | Returns a list of valid sources that can be used as invoice number.
This may differ per shop as not all shops support invoices as a separate
entity.
Overrides should typically return a subset of the constants defined in
this base implementation, but including at least
{@see \Siel\Acumulus\PluginConfig::InvoiceNrSourc... | [
"Returns",
"a",
"list",
"of",
"valid",
"sources",
"that",
"can",
"be",
"used",
"as",
"invoice",
"number",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/ShopCapabilities.php#L314-L321 |
30,282 | SIELOnline/libAcumulus | src/Config/ShopCapabilities.php | ShopCapabilities.getDateToUseOptions | public function getDateToUseOptions()
{
return array(
PluginConfig::InvoiceDate_InvoiceCreate => $this->t('option_dateToUse_1'),
PluginConfig::InvoiceDate_OrderCreate => $this->t('option_dateToUse_2'),
PluginConfig::InvoiceDate_Transfer => $this->t('option_dateToUse_3'),
... | php | public function getDateToUseOptions()
{
return array(
PluginConfig::InvoiceDate_InvoiceCreate => $this->t('option_dateToUse_1'),
PluginConfig::InvoiceDate_OrderCreate => $this->t('option_dateToUse_2'),
PluginConfig::InvoiceDate_Transfer => $this->t('option_dateToUse_3'),
... | [
"public",
"function",
"getDateToUseOptions",
"(",
")",
"{",
"return",
"array",
"(",
"PluginConfig",
"::",
"InvoiceDate_InvoiceCreate",
"=>",
"$",
"this",
"->",
"t",
"(",
"'option_dateToUse_1'",
")",
",",
"PluginConfig",
"::",
"InvoiceDate_OrderCreate",
"=>",
"$",
... | Returns a list of valid date sources that can be used as invoice date.
This may differ per shop as not all shops support invoices as a separate
entity.
Overrides should typically return a subset of the constants defined in
this base implementation, but including at least
{@see \Siel\Acumulus\PluginConfig::InvoiceDate... | [
"Returns",
"a",
"list",
"of",
"valid",
"date",
"sources",
"that",
"can",
"be",
"used",
"as",
"invoice",
"date",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Config/ShopCapabilities.php#L337-L344 |
30,283 | SIELOnline/libAcumulus | src/WooCommerce/Invoice/CreatorPluginSupport.php | CreatorPluginSupport.getItemLineBeforeBookings | public function getItemLineBeforeBookings(Creator $creator, WC_Order_Item_Product $item, $product)
{
if ($product instanceof WC_Product) {
if (function_exists('is_wc_booking_product') && is_wc_booking_product($product)) {
$booking_ids = WC_Booking_Data_Store::get_booking_ids_from... | php | public function getItemLineBeforeBookings(Creator $creator, WC_Order_Item_Product $item, $product)
{
if ($product instanceof WC_Product) {
if (function_exists('is_wc_booking_product') && is_wc_booking_product($product)) {
$booking_ids = WC_Booking_Data_Store::get_booking_ids_from... | [
"public",
"function",
"getItemLineBeforeBookings",
"(",
"Creator",
"$",
"creator",
",",
"WC_Order_Item_Product",
"$",
"item",
",",
"$",
"product",
")",
"{",
"if",
"(",
"$",
"product",
"instanceof",
"WC_Product",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'i... | Support for the "WooCommerce Bookings" plugin.
Bookings are stored in a separate entity, we add that as a separate
property source, so its properties can be used.
@param \Siel\Acumulus\WooCommerce\Invoice\Creator $creator
@param WC_Order_Item_Product $item
@param WC_Product|bool $product | [
"Support",
"for",
"the",
"WooCommerce",
"Bookings",
"plugin",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Invoice/CreatorPluginSupport.php#L72-L90 |
30,284 | SIELOnline/libAcumulus | src/WooCommerce/Invoice/CreatorPluginSupport.php | CreatorPluginSupport.acumulusInvoiceCreated | public function acumulusInvoiceCreated($invoice, BaseSource $invoiceSource, Result $localResult)
{
$invoice = $this->supportBundleProducts($invoice, $invoiceSource, $localResult);
$invoice = $this->supportTMExtraProductOptions($invoice, $invoiceSource, $localResult);
return $invoice;
} | php | public function acumulusInvoiceCreated($invoice, BaseSource $invoiceSource, Result $localResult)
{
$invoice = $this->supportBundleProducts($invoice, $invoiceSource, $localResult);
$invoice = $this->supportTMExtraProductOptions($invoice, $invoiceSource, $localResult);
return $invoice;
} | [
"public",
"function",
"acumulusInvoiceCreated",
"(",
"$",
"invoice",
",",
"BaseSource",
"$",
"invoiceSource",
",",
"Result",
"$",
"localResult",
")",
"{",
"$",
"invoice",
"=",
"$",
"this",
"->",
"supportBundleProducts",
"(",
"$",
"invoice",
",",
"$",
"invoiceS... | Filter that reacts to the acumulus_invoice_created event.
@param array|null $invoice
@param \Siel\Acumulus\Invoice\Source $invoiceSource
@param \Siel\Acumulus\Invoice\Result $localResult
@return array|null | [
"Filter",
"that",
"reacts",
"to",
"the",
"acumulus_invoice_created",
"event",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Invoice/CreatorPluginSupport.php#L115-L120 |
30,285 | SIELOnline/libAcumulus | src/WooCommerce/Invoice/CreatorPluginSupport.php | CreatorPluginSupport.supportBundleProducts | protected function supportBundleProducts($invoice, BaseSource $invoiceSource, /** @noinspection PhpUnusedParameterInspection */ Result $localResult)
{
/** @var \WC_Abstract_Order $shopSource */
$shopSource = $invoiceSource->getSource();
/** @var WC_Order_Item_Product[] $items */
$ite... | php | protected function supportBundleProducts($invoice, BaseSource $invoiceSource, /** @noinspection PhpUnusedParameterInspection */ Result $localResult)
{
/** @var \WC_Abstract_Order $shopSource */
$shopSource = $invoiceSource->getSource();
/** @var WC_Order_Item_Product[] $items */
$ite... | [
"protected",
"function",
"supportBundleProducts",
"(",
"$",
"invoice",
",",
"BaseSource",
"$",
"invoiceSource",
",",
"/** @noinspection PhpUnusedParameterInspection */",
"Result",
"$",
"localResult",
")",
"{",
"/** @var \\WC_Abstract_Order $shopSource */",
"$",
"shopSource",
... | Supports the "WooCommerce Bundle Products" plugin.
This method supports the woocommerce-product-bundles extension that
stores the bundle products as separate item lines below the bundle line
and uses the meta data described below to link them to each other.
This method hierarchically groups bundled products into the ... | [
"Supports",
"the",
"WooCommerce",
"Bundle",
"Products",
"plugin",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Invoice/CreatorPluginSupport.php#L153-L182 |
30,286 | SIELOnline/libAcumulus | src/WooCommerce/Invoice/CreatorPluginSupport.php | CreatorPluginSupport.groupBundles | protected function groupBundles(array $itemLines)
{
$result = array();
foreach ($itemLines as &$itemLine) {
if (!empty($itemLine[Meta::BundleParentId])) {
// Find the parent, note that we expect bundle products to
// appear before their bundled products, s... | php | protected function groupBundles(array $itemLines)
{
$result = array();
foreach ($itemLines as &$itemLine) {
if (!empty($itemLine[Meta::BundleParentId])) {
// Find the parent, note that we expect bundle products to
// appear before their bundled products, s... | [
"protected",
"function",
"groupBundles",
"(",
"array",
"$",
"itemLines",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"itemLines",
"as",
"&",
"$",
"itemLine",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"itemLine",
"[",... | Groups bundled products into the bundle product.
@param array $itemLines
The set of invoice lines that may contain bundle lines and bundled
lines.
@return array
The set of item lines but with the lines of bundled items
hierarchically placed in their bundle line. | [
"Groups",
"bundled",
"products",
"into",
"the",
"bundle",
"product",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Invoice/CreatorPluginSupport.php#L206-L230 |
30,287 | SIELOnline/libAcumulus | src/WooCommerce/Invoice/CreatorPluginSupport.php | CreatorPluginSupport.& | protected function &getParentBundle(array &$lines, $parentId)
{
foreach ($lines as &$line) {
if (!empty($line[Meta::BundleId]) && $line[Meta::BundleId] === $parentId) {
return $line;
} elseif (!empty($line[Meta::ChildrenLines])) {
// Recursively search... | php | protected function &getParentBundle(array &$lines, $parentId)
{
foreach ($lines as &$line) {
if (!empty($line[Meta::BundleId]) && $line[Meta::BundleId] === $parentId) {
return $line;
} elseif (!empty($line[Meta::ChildrenLines])) {
// Recursively search... | [
"protected",
"function",
"&",
"getParentBundle",
"(",
"array",
"&",
"$",
"lines",
",",
"$",
"parentId",
")",
"{",
"foreach",
"(",
"$",
"lines",
"as",
"&",
"$",
"line",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"line",
"[",
"Meta",
"::",
"BundleI... | Searches for, and returns by reference, the parent bundle line.
@param array $lines
The lines to search for the parent bundle line.
@param $parentId
The meta-bundle-id value to search for.
@return array|null
The parent bundle line or null if not found. | [
"Searches",
"for",
"and",
"returns",
"by",
"reference",
"the",
"parent",
"bundle",
"line",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Invoice/CreatorPluginSupport.php#L243-L258 |
30,288 | SIELOnline/libAcumulus | src/WooCommerce/Invoice/CreatorPluginSupport.php | CreatorPluginSupport.supportTMExtraProductOptions | protected function supportTMExtraProductOptions($invoice, BaseSource $invoiceSource, /** @noinspection PhpUnusedParameterInspection */ Result $localResult)
{
/** @var \WC_Abstract_Order $shopSource */
$shopSource = $invoiceSource->getSource();
/** @var WC_Order_Item_Product[] $items */
... | php | protected function supportTMExtraProductOptions($invoice, BaseSource $invoiceSource, /** @noinspection PhpUnusedParameterInspection */ Result $localResult)
{
/** @var \WC_Abstract_Order $shopSource */
$shopSource = $invoiceSource->getSource();
/** @var WC_Order_Item_Product[] $items */
... | [
"protected",
"function",
"supportTMExtraProductOptions",
"(",
"$",
"invoice",
",",
"BaseSource",
"$",
"invoiceSource",
",",
"/** @noinspection PhpUnusedParameterInspection */",
"Result",
"$",
"localResult",
")",
"{",
"/** @var \\WC_Abstract_Order $shopSource */",
"$",
"shopSour... | Supports the "WooCommerce TM Extra Product Options" plugin.
This method supports the tm-woo-extra-product-options extension that
places its data in the meta data under keys that start wth tm_epo or
tmcartepo. We need the the tncartepo_data value as that contains the
options.
This method adds the option data as childr... | [
"Supports",
"the",
"WooCommerce",
"TM",
"Extra",
"Product",
"Options",
"plugin",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/WooCommerce/Invoice/CreatorPluginSupport.php#L276-L300 |
30,289 | dreamfactorysoftware/df-user | src/Services/User.php | User.handlesAlternateAuth | public function handlesAlternateAuth()
{
if (
config('df.alternate_auth') === true &&
!empty(array_get($this->config, 'alt_auth_db_service_id')) &&
!empty(array_get($this->config, 'alt_auth_table')) &&
!empty(array_get($this->config, 'alt_auth_username_field')... | php | public function handlesAlternateAuth()
{
if (
config('df.alternate_auth') === true &&
!empty(array_get($this->config, 'alt_auth_db_service_id')) &&
!empty(array_get($this->config, 'alt_auth_table')) &&
!empty(array_get($this->config, 'alt_auth_username_field')... | [
"public",
"function",
"handlesAlternateAuth",
"(",
")",
"{",
"if",
"(",
"config",
"(",
"'df.alternate_auth'",
")",
"===",
"true",
"&&",
"!",
"empty",
"(",
"array_get",
"(",
"$",
"this",
"->",
"config",
",",
"'alt_auth_db_service_id'",
")",
")",
"&&",
"!",
... | Checks to see if the service handles alternative authentication
@return bool | [
"Checks",
"to",
"see",
"if",
"the",
"service",
"handles",
"alternative",
"authentication"
] | 06747c83f03d51693d212d948dd5d49f098192ca | https://github.com/dreamfactorysoftware/df-user/blob/06747c83f03d51693d212d948dd5d49f098192ca/src/Services/User.php#L120-L134 |
30,290 | dreamfactorysoftware/df-user | src/Services/User.php | User.getAltAuthenticator | public function getAltAuthenticator()
{
if ($this->handlesAlternateAuth()) {
$authenticator = new AlternateAuth(
array_get($this->config, 'alt_auth_db_service_id'),
array_get($this->config, 'alt_auth_table'),
array_get($this->config, 'alt_auth_user... | php | public function getAltAuthenticator()
{
if ($this->handlesAlternateAuth()) {
$authenticator = new AlternateAuth(
array_get($this->config, 'alt_auth_db_service_id'),
array_get($this->config, 'alt_auth_table'),
array_get($this->config, 'alt_auth_user... | [
"public",
"function",
"getAltAuthenticator",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"handlesAlternateAuth",
"(",
")",
")",
"{",
"$",
"authenticator",
"=",
"new",
"AlternateAuth",
"(",
"array_get",
"(",
"$",
"this",
"->",
"config",
",",
"'alt_auth_db_se... | If the service handles alternative authentication then
this method will return the alternative authenticator
@return \DreamFactory\Core\User\Components\AlternateAuth
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException | [
"If",
"the",
"service",
"handles",
"alternative",
"authentication",
"then",
"this",
"method",
"will",
"return",
"the",
"alternative",
"authenticator"
] | 06747c83f03d51693d212d948dd5d49f098192ca | https://github.com/dreamfactorysoftware/df-user/blob/06747c83f03d51693d212d948dd5d49f098192ca/src/Services/User.php#L143-L160 |
30,291 | fontis/composer-autoloader | src/app/code/community/Fontis/ComposerAutoloader/Helper/Data.php | Fontis_ComposerAutoloader_Helper_Data.getVendorDirectoryPath | public function getVendorDirectoryPath()
{
$path = (string) Mage::getConfig()->getNode('global/composer_autoloader/path');
if (!$path) {
$path = self::DEFAULT_PATH;
}
$path = str_replace('/', DS, $path);
$path = str_replace('{{basedir}}', Mage::getBaseDir(), $pat... | php | public function getVendorDirectoryPath()
{
$path = (string) Mage::getConfig()->getNode('global/composer_autoloader/path');
if (!$path) {
$path = self::DEFAULT_PATH;
}
$path = str_replace('/', DS, $path);
$path = str_replace('{{basedir}}', Mage::getBaseDir(), $pat... | [
"public",
"function",
"getVendorDirectoryPath",
"(",
")",
"{",
"$",
"path",
"=",
"(",
"string",
")",
"Mage",
"::",
"getConfig",
"(",
")",
"->",
"getNode",
"(",
"'global/composer_autoloader/path'",
")",
";",
"if",
"(",
"!",
"$",
"path",
")",
"{",
"$",
"pa... | The location of the vendor directory on the machine the site is running on.
It always comes without a trailing slash.
@return string | [
"The",
"location",
"of",
"the",
"vendor",
"directory",
"on",
"the",
"machine",
"the",
"site",
"is",
"running",
"on",
".",
"It",
"always",
"comes",
"without",
"a",
"trailing",
"slash",
"."
] | edebd4f638c3d60ce5a2329ff834c2f1048ef8be | https://github.com/fontis/composer-autoloader/blob/edebd4f638c3d60ce5a2329ff834c2f1048ef8be/src/app/code/community/Fontis/ComposerAutoloader/Helper/Data.php#L31-L43 |
30,292 | ipunkt/rancherize | app/Blueprint/Infrastructure/Volume/VolumeWriter.php | VolumeWriter.clear | public function clear(FileWriter $fileWriter) {
$fileWriter->put($this->path.'/docker-compose.yml', '');
$fileWriter->put($this->path.'/rancher-compose.yml', '');
} | php | public function clear(FileWriter $fileWriter) {
$fileWriter->put($this->path.'/docker-compose.yml', '');
$fileWriter->put($this->path.'/rancher-compose.yml', '');
} | [
"public",
"function",
"clear",
"(",
"FileWriter",
"$",
"fileWriter",
")",
"{",
"$",
"fileWriter",
"->",
"put",
"(",
"$",
"this",
"->",
"path",
".",
"'/docker-compose.yml'",
",",
"''",
")",
";",
"$",
"fileWriter",
"->",
"put",
"(",
"$",
"this",
"->",
"p... | Clear the written files.
Necessary because the write function appends to them so if fresh files are expected they have to be cleared first
@param FileWriter $fileWriter | [
"Clear",
"the",
"written",
"files",
".",
"Necessary",
"because",
"the",
"write",
"function",
"appends",
"to",
"them",
"so",
"if",
"fresh",
"files",
"are",
"expected",
"they",
"have",
"to",
"be",
"cleared",
"first"
] | 3c226da686b283e7fef961a9a79b54db53b8757b | https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Blueprint/Infrastructure/Volume/VolumeWriter.php#L68-L71 |
30,293 | ipunkt/rancherize | app/Services/BlueprintService.php | BlueprintService.byConfiguration | public function byConfiguration(Configuration $configuration, array $flags) : Blueprint {
$blueprintName = $configuration->get('project.blueprint');
return $this->load($blueprintName, $flags);
} | php | public function byConfiguration(Configuration $configuration, array $flags) : Blueprint {
$blueprintName = $configuration->get('project.blueprint');
return $this->load($blueprintName, $flags);
} | [
"public",
"function",
"byConfiguration",
"(",
"Configuration",
"$",
"configuration",
",",
"array",
"$",
"flags",
")",
":",
"Blueprint",
"{",
"$",
"blueprintName",
"=",
"$",
"configuration",
"->",
"get",
"(",
"'project.blueprint'",
")",
";",
"return",
"$",
"thi... | Retrieve the blueprint that was set in the configuration
@param Configuration $configuration
@param array $flags
@return \Rancherize\Blueprint\Blueprint | [
"Retrieve",
"the",
"blueprint",
"that",
"was",
"set",
"in",
"the",
"configuration"
] | 3c226da686b283e7fef961a9a79b54db53b8757b | https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Services/BlueprintService.php#L33-L37 |
30,294 | ipunkt/rancherize | app/Services/BlueprintService.php | BlueprintService.load | public function load(string $blueprintName, array $flags) : Blueprint {
$blueprint = $this->blueprintFactory->get($blueprintName);
foreach($flags as $name => $value)
$blueprint->setFlag($name, $value);
return $blueprint;
} | php | public function load(string $blueprintName, array $flags) : Blueprint {
$blueprint = $this->blueprintFactory->get($blueprintName);
foreach($flags as $name => $value)
$blueprint->setFlag($name, $value);
return $blueprint;
} | [
"public",
"function",
"load",
"(",
"string",
"$",
"blueprintName",
",",
"array",
"$",
"flags",
")",
":",
"Blueprint",
"{",
"$",
"blueprint",
"=",
"$",
"this",
"->",
"blueprintFactory",
"->",
"get",
"(",
"$",
"blueprintName",
")",
";",
"foreach",
"(",
"$"... | Load by name
@param string $blueprintName
@param array $flags
@return \Rancherize\Blueprint\Blueprint
@internal param array $options | [
"Load",
"by",
"name"
] | 3c226da686b283e7fef961a9a79b54db53b8757b | https://github.com/ipunkt/rancherize/blob/3c226da686b283e7fef961a9a79b54db53b8757b/app/Services/BlueprintService.php#L47-L54 |
30,295 | SIELOnline/libAcumulus | src/Invoice/CompletorStrategy/TryAllVatRatePermutations.php | TryAllVatRatePermutations.setVatRates | protected function setVatRates($vatType, $include0)
{
$this->vatRates = array();
foreach ($this->possibleVatRates as $vatRate) {
if ($vatRate[Tag::VatType] === $vatType) {
$this->vatRates[] = $vatRate[Tag::VatRate];
}
}
if ($include0) {
... | php | protected function setVatRates($vatType, $include0)
{
$this->vatRates = array();
foreach ($this->possibleVatRates as $vatRate) {
if ($vatRate[Tag::VatType] === $vatType) {
$this->vatRates[] = $vatRate[Tag::VatRate];
}
}
if ($include0) {
... | [
"protected",
"function",
"setVatRates",
"(",
"$",
"vatType",
",",
"$",
"include0",
")",
"{",
"$",
"this",
"->",
"vatRates",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"possibleVatRates",
"as",
"$",
"vatRate",
")",
"{",
"if",
"(",
... | Initializes the array of vat rates to use for this permutation.
@param float $vatType
@param bool $include0 | [
"Initializes",
"the",
"array",
"of",
"vat",
"rates",
"to",
"use",
"for",
"this",
"permutation",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorStrategy/TryAllVatRatePermutations.php#L60-L71 |
30,296 | SIELOnline/libAcumulus | src/Invoice/CompletorStrategyLines.php | CompletorStrategyLines.completeStrategyLines | protected function completeStrategyLines()
{
if ($this->invoiceHasStrategyLine()) {
$this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyInput]['vat-rates'] = str_replace(array('=>', ' ', "\r", "\n", "\t"), array('='), var_export($this->possibleVatRates, true));
$isFir... | php | protected function completeStrategyLines()
{
if ($this->invoiceHasStrategyLine()) {
$this->invoice[Tag::Customer][Tag::Invoice][Meta::CompletorStrategyInput]['vat-rates'] = str_replace(array('=>', ' ', "\r", "\n", "\t"), array('='), var_export($this->possibleVatRates, true));
$isFir... | [
"protected",
"function",
"completeStrategyLines",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"invoiceHasStrategyLine",
"(",
")",
")",
"{",
"$",
"this",
"->",
"invoice",
"[",
"Tag",
"::",
"Customer",
"]",
"[",
"Tag",
"::",
"Invoice",
"]",
"[",
"Meta",
... | Complete all lines that need a vat divide strategy to compute correct
values. | [
"Complete",
"all",
"lines",
"that",
"need",
"a",
"vat",
"divide",
"strategy",
"to",
"compute",
"correct",
"values",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorStrategyLines.php#L89-L119 |
30,297 | SIELOnline/libAcumulus | src/Invoice/CompletorStrategyLines.php | CompletorStrategyLines.invoiceHasStrategyLine | public function invoiceHasStrategyLine()
{
$result = false;
foreach ($this->invoiceLines as $line) {
if ($line[Meta::VatRateSource] === Creator::VatRateSource_Strategy) {
$result = true;
break;
}
}
return $result;
} | php | public function invoiceHasStrategyLine()
{
$result = false;
foreach ($this->invoiceLines as $line) {
if ($line[Meta::VatRateSource] === Creator::VatRateSource_Strategy) {
$result = true;
break;
}
}
return $result;
} | [
"public",
"function",
"invoiceHasStrategyLine",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"invoiceLines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"line",
"[",
"Meta",
"::",
"VatRateSource",
"]",
"===",
"Cr... | Returns whether the invoice has lines that are to be completed using a tax
divide strategy.
@return bool | [
"Returns",
"whether",
"the",
"invoice",
"has",
"lines",
"that",
"are",
"to",
"be",
"completed",
"using",
"a",
"tax",
"divide",
"strategy",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorStrategyLines.php#L127-L137 |
30,298 | SIELOnline/libAcumulus | src/Invoice/CompletorStrategyLines.php | CompletorStrategyLines.getStrategyClasses | protected function getStrategyClasses()
{
$result = array();
// For now hardcoded, but this can be turned into a discovery.
$namespace = '\Siel\Acumulus\Invoice\CompletorStrategy';
$result[] = "$namespace\\ApplySameVatRate";
$result[] = "$namespace\\SplitKnownDiscountLine";
... | php | protected function getStrategyClasses()
{
$result = array();
// For now hardcoded, but this can be turned into a discovery.
$namespace = '\Siel\Acumulus\Invoice\CompletorStrategy';
$result[] = "$namespace\\ApplySameVatRate";
$result[] = "$namespace\\SplitKnownDiscountLine";
... | [
"protected",
"function",
"getStrategyClasses",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"// For now hardcoded, but this can be turned into a discovery.",
"$",
"namespace",
"=",
"'\\Siel\\Acumulus\\Invoice\\CompletorStrategy'",
";",
"$",
"result",
"[",
"]... | Returns a list of strategy class names.
@return string[] | [
"Returns",
"a",
"list",
"of",
"strategy",
"class",
"names",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorStrategyLines.php#L144-L161 |
30,299 | SIELOnline/libAcumulus | src/Invoice/CompletorStrategyLines.php | CompletorStrategyLines.replaceLinesCompleted | protected function replaceLinesCompleted(array $linesCompleted, array $completedLines, $strategyName)
{
// Remove old strategy lines that are now completed.
$lines = array();
foreach ($this->invoice[Tag::Customer][Tag::Invoice][Tag::Line] as $key => $line) {
if (!in_array($key, $... | php | protected function replaceLinesCompleted(array $linesCompleted, array $completedLines, $strategyName)
{
// Remove old strategy lines that are now completed.
$lines = array();
foreach ($this->invoice[Tag::Customer][Tag::Invoice][Tag::Line] as $key => $line) {
if (!in_array($key, $... | [
"protected",
"function",
"replaceLinesCompleted",
"(",
"array",
"$",
"linesCompleted",
",",
"array",
"$",
"completedLines",
",",
"$",
"strategyName",
")",
"{",
"// Remove old strategy lines that are now completed.",
"$",
"lines",
"=",
"array",
"(",
")",
";",
"foreach"... | Replaces all completed strategy lines with the given completed lines.
@param int[] $linesCompleted
@param array[] $completedLines
An array of completed invoice lines to replace the strategy lines with.
@param string $strategyName | [
"Replaces",
"all",
"completed",
"strategy",
"lines",
"with",
"the",
"given",
"completed",
"lines",
"."
] | 82f8d6c9c4929c41948c97d6cfdfac3f27c37255 | https://github.com/SIELOnline/libAcumulus/blob/82f8d6c9c4929c41948c97d6cfdfac3f27c37255/src/Invoice/CompletorStrategyLines.php#L171-L189 |
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.