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
partition
stringclasses
1 value
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxorder.php
OxpsPaymorrowOxOrder.finalizeOrder
public function finalizeOrder( \OxidEsales\Eshop\Application\Model\Basket $oBasket, $oUser, $blRecalculatingOrder = false ) { $mReturn = $this->_OxpsPaymorrowOxOrder_finalizeOrder_parent( $oBasket, $oUser, $blRecalculatingOrder ); if ( ( $this->oxorder__oxtransstatus->value == 'OK' ) and $this->_wasPaymorrowPaymentUsed( $oBasket ) ) { $aData = array( 'pm_order_transaction_id' => oxRegistry::get( 'OxpsPaymorrowModule' )->getPaymentTransactionId(), 'order_id' => $this->getId(), 'new_order_id' => $this->getPaymorrowOrderNumber(), ); oxRegistry::get( 'OxpsPaymorrowLogger' )->logWithType( $aData, 'finalizeOrder' ); /** @var OxpsPaymorrowRequestControllerProxy $oPmRequestControllerProxy */ $oPmRequestControllerProxy = oxNew( 'OxpsPaymorrowRequestControllerProxy' ); $oPmRequestControllerProxy->updateOrderId( $aData ); } return $mReturn; }
php
public function finalizeOrder( \OxidEsales\Eshop\Application\Model\Basket $oBasket, $oUser, $blRecalculatingOrder = false ) { $mReturn = $this->_OxpsPaymorrowOxOrder_finalizeOrder_parent( $oBasket, $oUser, $blRecalculatingOrder ); if ( ( $this->oxorder__oxtransstatus->value == 'OK' ) and $this->_wasPaymorrowPaymentUsed( $oBasket ) ) { $aData = array( 'pm_order_transaction_id' => oxRegistry::get( 'OxpsPaymorrowModule' )->getPaymentTransactionId(), 'order_id' => $this->getId(), 'new_order_id' => $this->getPaymorrowOrderNumber(), ); oxRegistry::get( 'OxpsPaymorrowLogger' )->logWithType( $aData, 'finalizeOrder' ); /** @var OxpsPaymorrowRequestControllerProxy $oPmRequestControllerProxy */ $oPmRequestControllerProxy = oxNew( 'OxpsPaymorrowRequestControllerProxy' ); $oPmRequestControllerProxy->updateOrderId( $aData ); } return $mReturn; }
[ "public", "function", "finalizeOrder", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Basket", "$", "oBasket", ",", "$", "oUser", ",", "$", "blRecalculatingOrder", "=", "false", ")", "{", "$", "mReturn", "=", "$", "this"...
Overridden parent method. Sends an update order Id call to set order number instead of order OXID. Triggers for complete order payed with a Paymorrow payment method. @param \OxidEsales\Eshop\Application\Model\Basket $oBasket @param oxUser $oUser @param bool $blRecalculatingOrder @return mixed
[ "Overridden", "parent", "method", ".", "Sends", "an", "update", "order", "Id", "call", "to", "set", "order", "number", "instead", "of", "order", "OXID", ".", "Triggers", "for", "complete", "order", "payed", "with", "a", "Paymorrow", "payment", "method", "." ...
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxorder.php#L115-L134
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxorder.php
OxpsPaymorrowOxOrder.getPaymorrowOxUserPaymentReloaded
public function getPaymorrowOxUserPaymentReloaded() { $sUserPaymentId = $this->oxorder__oxpaymentid->value; /** @var oxUserPayment $oUserPayment */ $oUserPayment = oxNew( 'oxUserPayment' ); $oUserPayment->load( $sUserPaymentId ); return $oUserPayment; }
php
public function getPaymorrowOxUserPaymentReloaded() { $sUserPaymentId = $this->oxorder__oxpaymentid->value; /** @var oxUserPayment $oUserPayment */ $oUserPayment = oxNew( 'oxUserPayment' ); $oUserPayment->load( $sUserPaymentId ); return $oUserPayment; }
[ "public", "function", "getPaymorrowOxUserPaymentReloaded", "(", ")", "{", "$", "sUserPaymentId", "=", "$", "this", "->", "oxorder__oxpaymentid", "->", "value", ";", "/** @var oxUserPayment $oUserPayment */", "$", "oUserPayment", "=", "oxNew", "(", "'oxUserPayment'", ")"...
Get user payment instance related to the order. @return oxUserPayment
[ "Get", "user", "payment", "instance", "related", "to", "the", "order", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxorder.php#L141-L150
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxorder.php
OxpsPaymorrowOxOrder.getOrderDate
public function getOrderDate() { if ( empty( $this->oxorder__oxorderdate->value ) ) { return ''; } return date( 'Y-m-d', strtotime( $this->oxorder__oxorderdate->value ) ); }
php
public function getOrderDate() { if ( empty( $this->oxorder__oxorderdate->value ) ) { return ''; } return date( 'Y-m-d', strtotime( $this->oxorder__oxorderdate->value ) ); }
[ "public", "function", "getOrderDate", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "oxorder__oxorderdate", "->", "value", ")", ")", "{", "return", "''", ";", "}", "return", "date", "(", "'Y-m-d'", ",", "strtotime", "(", "$", "this", "->",...
Get order creation date. @return string
[ "Get", "order", "creation", "date", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxorder.php#L167-L174
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxorder.php
OxpsPaymorrowOxOrder._wasPaymorrowPaymentUsed
protected function _wasPaymorrowPaymentUsed( oxBasket $oBasket ) { /** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */ $oPayment = oxNew( 'OxpsPaymorrowOxPayment' ); if ( $oPayment->load( $oBasket->getPaymentId() ) and $oPayment->isPaymorrowActiveAndMapped() ) { return true; } return false; }
php
protected function _wasPaymorrowPaymentUsed( oxBasket $oBasket ) { /** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */ $oPayment = oxNew( 'OxpsPaymorrowOxPayment' ); if ( $oPayment->load( $oBasket->getPaymentId() ) and $oPayment->isPaymorrowActiveAndMapped() ) { return true; } return false; }
[ "protected", "function", "_wasPaymorrowPaymentUsed", "(", "oxBasket", "$", "oBasket", ")", "{", "/** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */", "$", "oPayment", "=", "oxNew", "(", "'OxpsPaymorrowOxPayment'", ")", ";", "if", "(", "$", "oPayment", "->", "load", ...
Check is valid Paymorrow payment method was used in the checkout ir not. @param oxBasket $oBasket @return bool
[ "Check", "is", "valid", "Paymorrow", "payment", "method", "was", "used", "in", "the", "checkout", "ir", "not", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxorder.php#L221-L231
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxorder.php
OxpsPaymorrowOxOrder._OxpsPaymorrowOxOrder_finalizeOrder_parent
protected function _OxpsPaymorrowOxOrder_finalizeOrder_parent( oxBasket $oBasket, $oUser, $blRecalculatingOrder = false ) { return parent::finalizeOrder( $oBasket, $oUser, $blRecalculatingOrder ); }
php
protected function _OxpsPaymorrowOxOrder_finalizeOrder_parent( oxBasket $oBasket, $oUser, $blRecalculatingOrder = false ) { return parent::finalizeOrder( $oBasket, $oUser, $blRecalculatingOrder ); }
[ "protected", "function", "_OxpsPaymorrowOxOrder_finalizeOrder_parent", "(", "oxBasket", "$", "oBasket", ",", "$", "oUser", ",", "$", "blRecalculatingOrder", "=", "false", ")", "{", "return", "parent", "::", "finalizeOrder", "(", "$", "oBasket", ",", "$", "oUser", ...
Parent `finalizeOrder` function call. @codeCoverageIgnore @param oxBasket $oBasket @param oxUser|null $oUser @param bool $blRecalculatingOrder @return mixed
[ "Parent", "finalizeOrder", "function", "call", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxorder.php#L259-L263
train
hostnet/accessor-generator-plugin-lib
src/Twig/PerLineTokenParser.php
PerLineTokenParser.parse
public function parse(Token $token): PerLineNode { $stream = $this->parser->getStream(); // perline is a very simple tag, not having anything more than its name // between the braces, so we expect the closing brace immediately. $stream->expect(Token::BLOCK_END_TYPE); // sub-parse everything until we reach the endperline tag. $body = $this->parser->subparse(function (Token $token) { return $token->test('endperline'); }, true); // make sure our closing tag is also closed neatly and advance the // stream to allow continuation of parsing. $stream->expect(Token::BLOCK_END_TYPE); // turn out body in a nicely formatted PerLineNode return $this->parseBody($body); }
php
public function parse(Token $token): PerLineNode { $stream = $this->parser->getStream(); // perline is a very simple tag, not having anything more than its name // between the braces, so we expect the closing brace immediately. $stream->expect(Token::BLOCK_END_TYPE); // sub-parse everything until we reach the endperline tag. $body = $this->parser->subparse(function (Token $token) { return $token->test('endperline'); }, true); // make sure our closing tag is also closed neatly and advance the // stream to allow continuation of parsing. $stream->expect(Token::BLOCK_END_TYPE); // turn out body in a nicely formatted PerLineNode return $this->parseBody($body); }
[ "public", "function", "parse", "(", "Token", "$", "token", ")", ":", "PerLineNode", "{", "$", "stream", "=", "$", "this", "->", "parser", "->", "getStream", "(", ")", ";", "// perline is a very simple tag, not having anything more than its name", "// between the brace...
Parses perline token and returns PerLineNode. Parse everything within the perline block and then restructure the contents into some thing nice to build a PerLineNode out of. @param Token $token @throws SyntaxError @return PerLineNode
[ "Parses", "perline", "token", "and", "returns", "PerLineNode", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/Twig/PerLineTokenParser.php#L48-L67
train
hostnet/accessor-generator-plugin-lib
src/Twig/PerLineTokenParser.php
PerLineTokenParser.parseBody
private function parseBody(Node $body): PerLineNode { $prefix = ''; // Text before the (possibly) multi line expression $postfix = ''; // Text before the (possibly) multi line expression $lineno = $body->getTemplateLine(); // The line number where we found the {% perline %} tag // If the body does not contain a list of tags, the body itself is the // only useful content of the perline tags, so we return only the body // tag. This is the case when the perline tags could be removed without // an effect in the generated code. if (count($body) === 0) { return new PerLineNode($body, '', '', $lineno, $this->getTag()); } // Get all the nodes as array, because it will be modified. $nodes = $body->getIterator()->getArrayCopy(); // Check for prefix, the first node should be a text node to have a // prefix. $first = reset($nodes); if ($first instanceof TextNode) { $prefix = $first->getAttribute('data'); array_shift($nodes); } // Check for postfix, the last node should be a text node to have a // postfix. $last = end($nodes); if ($last instanceof TextNode) { $postfix = rtrim($last->getAttribute('data')); array_pop($nodes); } // After we ditched the prefix and postfix there could only be one node // left, ready to be returned and used directly. If there are multiple // we wrap those in a Twig Node. if (count($nodes) === 1) { $nodes = current($nodes); } else { $nodes = new Node($nodes); } // Return the new structured node. return new PerLineNode($nodes, $prefix, $postfix, $lineno, $this->getTag()); }
php
private function parseBody(Node $body): PerLineNode { $prefix = ''; // Text before the (possibly) multi line expression $postfix = ''; // Text before the (possibly) multi line expression $lineno = $body->getTemplateLine(); // The line number where we found the {% perline %} tag // If the body does not contain a list of tags, the body itself is the // only useful content of the perline tags, so we return only the body // tag. This is the case when the perline tags could be removed without // an effect in the generated code. if (count($body) === 0) { return new PerLineNode($body, '', '', $lineno, $this->getTag()); } // Get all the nodes as array, because it will be modified. $nodes = $body->getIterator()->getArrayCopy(); // Check for prefix, the first node should be a text node to have a // prefix. $first = reset($nodes); if ($first instanceof TextNode) { $prefix = $first->getAttribute('data'); array_shift($nodes); } // Check for postfix, the last node should be a text node to have a // postfix. $last = end($nodes); if ($last instanceof TextNode) { $postfix = rtrim($last->getAttribute('data')); array_pop($nodes); } // After we ditched the prefix and postfix there could only be one node // left, ready to be returned and used directly. If there are multiple // we wrap those in a Twig Node. if (count($nodes) === 1) { $nodes = current($nodes); } else { $nodes = new Node($nodes); } // Return the new structured node. return new PerLineNode($nodes, $prefix, $postfix, $lineno, $this->getTag()); }
[ "private", "function", "parseBody", "(", "Node", "$", "body", ")", ":", "PerLineNode", "{", "$", "prefix", "=", "''", ";", "// Text before the (possibly) multi line expression", "$", "postfix", "=", "''", ";", "// Text before the (possibly) multi line expression", "$", ...
Parse the body into a prefix, postfix and all the other twig nodes that will compile into multiple lines. @param Node $body @return PerLineNode
[ "Parse", "the", "body", "into", "a", "prefix", "postfix", "and", "all", "the", "other", "twig", "nodes", "that", "will", "compile", "into", "multiple", "lines", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/Twig/PerLineTokenParser.php#L78-L122
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Base.php
Base.getDomains
protected function getDomains( \Aimeos\MW\View\Iface $view ) { if( ( $domains = $view->param( 'resource' ) ) == '' ) { /** admin/jsonadm/domains * A list of domain names whose clients are available for the JSON API * * The HTTP OPTIONS method returns a list of resources known by the * JSON API including their URLs. The list of available resources * can be exteded dynamically be implementing a new Jsonadm client * class handling request for this new domain. * * To add the new domain client to the list of resources returned * by the HTTP OPTIONS method, you have to add its name in lower case * to the existing configuration. * * @param array List of domain names * @since 2016.01 * @category Developer * @see admin/jsonadm/resources */ $default = array( 'attribute', 'catalog', 'coupon', 'customer', 'locale', 'media', 'order', 'plugin', 'price', 'product', 'service', 'supplier', 'stock', 'tag', 'text' ); $domains = $this->getContext()->getConfig()->get( 'admin/jsonadm/domains', $default ); } return (array) $domains; }
php
protected function getDomains( \Aimeos\MW\View\Iface $view ) { if( ( $domains = $view->param( 'resource' ) ) == '' ) { /** admin/jsonadm/domains * A list of domain names whose clients are available for the JSON API * * The HTTP OPTIONS method returns a list of resources known by the * JSON API including their URLs. The list of available resources * can be exteded dynamically be implementing a new Jsonadm client * class handling request for this new domain. * * To add the new domain client to the list of resources returned * by the HTTP OPTIONS method, you have to add its name in lower case * to the existing configuration. * * @param array List of domain names * @since 2016.01 * @category Developer * @see admin/jsonadm/resources */ $default = array( 'attribute', 'catalog', 'coupon', 'customer', 'locale', 'media', 'order', 'plugin', 'price', 'product', 'service', 'supplier', 'stock', 'tag', 'text' ); $domains = $this->getContext()->getConfig()->get( 'admin/jsonadm/domains', $default ); } return (array) $domains; }
[ "protected", "function", "getDomains", "(", "\\", "Aimeos", "\\", "MW", "\\", "View", "\\", "Iface", "$", "view", ")", "{", "if", "(", "(", "$", "domains", "=", "$", "view", "->", "param", "(", "'resource'", ")", ")", "==", "''", ")", "{", "/** adm...
Returns the list of domains that are available as resources @param \Aimeos\MW\View\Iface $view View object with "resource" parameter @return array List of domain names
[ "Returns", "the", "list", "of", "domains", "that", "are", "available", "as", "resources" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Base.php#L140-L169
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Base.php
Base.getIds
protected function getIds( $request ) { $ids = []; if( isset( $request->data ) ) { foreach( (array) $request->data as $entry ) { if( isset( $entry->id ) ) { $ids[] = $entry->id; } } } return $ids; }
php
protected function getIds( $request ) { $ids = []; if( isset( $request->data ) ) { foreach( (array) $request->data as $entry ) { if( isset( $entry->id ) ) { $ids[] = $entry->id; } } } return $ids; }
[ "protected", "function", "getIds", "(", "$", "request", ")", "{", "$", "ids", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "request", "->", "data", ")", ")", "{", "foreach", "(", "(", "array", ")", "$", "request", "->", "data", "as", "$", ...
Returns the IDs sent in the request body @param \stdClass $request Decoded request body @return array List of item IDs
[ "Returns", "the", "IDs", "sent", "in", "the", "request", "body" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Base.php#L178-L193
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Base.php
Base.getRefItems
protected function getRefItems( array $listItems ) { $list = $map = []; $context = $this->getContext(); foreach( $listItems as $listItem ) { $map[$listItem->getDomain()][] = $listItem->getRefId(); } foreach( $map as $domain => $ids ) { $manager = \Aimeos\MShop::create( $context, $domain ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', str_replace( '/', '.', $domain ) . '.id', $ids ) ); $list = array_merge( $list, $manager->searchItems( $search ) ); } return $list; }
php
protected function getRefItems( array $listItems ) { $list = $map = []; $context = $this->getContext(); foreach( $listItems as $listItem ) { $map[$listItem->getDomain()][] = $listItem->getRefId(); } foreach( $map as $domain => $ids ) { $manager = \Aimeos\MShop::create( $context, $domain ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', str_replace( '/', '.', $domain ) . '.id', $ids ) ); $list = array_merge( $list, $manager->searchItems( $search ) ); } return $list; }
[ "protected", "function", "getRefItems", "(", "array", "$", "listItems", ")", "{", "$", "list", "=", "$", "map", "=", "[", "]", ";", "$", "context", "=", "$", "this", "->", "getContext", "(", ")", ";", "foreach", "(", "$", "listItems", "as", "$", "l...
Returns the items associated via a lists table @param array $listItems List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
[ "Returns", "the", "items", "associated", "via", "a", "lists", "table" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Base.php#L226-L246
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Base.php
Base.getAllowedResources
protected function getAllowedResources( \Aimeos\MW\View\Iface $view, array $resources ) { $config = $this->getContext()->getConfig(); $allowed = []; foreach( $resources as $resource ) { if( $view->access( $config->get( 'admin/jsonadm/resource/' . $resource . '/groups', [] ) ) === true ) { $allowed[] = $resource; } } return $allowed; }
php
protected function getAllowedResources( \Aimeos\MW\View\Iface $view, array $resources ) { $config = $this->getContext()->getConfig(); $allowed = []; foreach( $resources as $resource ) { if( $view->access( $config->get( 'admin/jsonadm/resource/' . $resource . '/groups', [] ) ) === true ) { $allowed[] = $resource; } } return $allowed; }
[ "protected", "function", "getAllowedResources", "(", "\\", "Aimeos", "\\", "MW", "\\", "View", "\\", "Iface", "$", "view", ",", "array", "$", "resources", ")", "{", "$", "config", "=", "$", "this", "->", "getContext", "(", ")", "->", "getConfig", "(", ...
Returns the list of allowed resources @param \Aimeos\MW\View\Iface $view View object with "access" helper @param array List of all available resources @return array List of allowed resources
[ "Returns", "the", "list", "of", "allowed", "resources" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Base.php#L256-L269
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Base.php
Base.saveData
protected function saveData( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $request ) { $data = []; if( isset( $request->data ) ) { foreach( (array) $request->data as $entry ) { $data[] = $this->saveEntry( $manager, $entry ); } } return $data; }
php
protected function saveData( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $request ) { $data = []; if( isset( $request->data ) ) { foreach( (array) $request->data as $entry ) { $data[] = $this->saveEntry( $manager, $entry ); } } return $data; }
[ "protected", "function", "saveData", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Common", "\\", "Manager", "\\", "Iface", "$", "manager", ",", "\\", "stdClass", "$", "request", ")", "{", "$", "data", "=", "[", "]", ";", "if", "(", "isset", "(", "$", ...
Creates of updates several items at once @param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items @param \stdClass $request Object with request body data @return array List of items
[ "Creates", "of", "updates", "several", "items", "at", "once" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Base.php#L398-L410
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Base.php
Base.saveRelationships
protected function saveRelationships( \Aimeos\MShop\Common\Manager\Iface $manager, \Aimeos\MShop\Common\Item\Iface $item, \stdClass $relationships ) { $id = $item->getId(); $listManager = $manager->getSubManager( 'lists' ); foreach( (array) $relationships as $domain => $list ) { if( isset( $list->data ) ) { foreach( (array) $list->data as $data ) { $listItem = $listManager->createItem(); if( isset( $data->attributes ) && ( $attr = (array) $data->attributes ) ) { $item = $item->fromArray( $attr, true ); } if( isset( $data->id ) ) { $listItem->setRefId( $data->id ); } $listItem->setParentId( $id ); $listItem->setDomain( $domain ); $listManager->saveItem( $listItem, false ); } } } }
php
protected function saveRelationships( \Aimeos\MShop\Common\Manager\Iface $manager, \Aimeos\MShop\Common\Item\Iface $item, \stdClass $relationships ) { $id = $item->getId(); $listManager = $manager->getSubManager( 'lists' ); foreach( (array) $relationships as $domain => $list ) { if( isset( $list->data ) ) { foreach( (array) $list->data as $data ) { $listItem = $listManager->createItem(); if( isset( $data->attributes ) && ( $attr = (array) $data->attributes ) ) { $item = $item->fromArray( $attr, true ); } if( isset( $data->id ) ) { $listItem->setRefId( $data->id ); } $listItem->setParentId( $id ); $listItem->setDomain( $domain ); $listManager->saveItem( $listItem, false ); } } } }
[ "protected", "function", "saveRelationships", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Common", "\\", "Manager", "\\", "Iface", "$", "manager", ",", "\\", "Aimeos", "\\", "MShop", "\\", "Common", "\\", "Item", "\\", "Iface", "$", "item", ",", "\\", "st...
Saves the item references associated via the list @param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items @param \Aimeos\MShop\Common\Item\Iface $item Domain item with an unique ID set @param \stdClass $relationships Object including the <domain>/data/attributes structure
[ "Saves", "the", "item", "references", "associated", "via", "the", "list" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Base.php#L449-L478
train
contributte/thepay-api
src/PermanentPayment.php
PermanentPayment.getSignatureLite
public function getSignatureLite(): string { $data = [ 'merchantId' => $this->getMerchantConfig()->merchantId, 'accountId' => $this->getMerchantConfig()->accountId, 'merchantData' => $this->getMerchantData(), 'password' => $this->getMerchantConfig()->password, ]; return md5( http_build_query( array_filter($data) ) ); }
php
public function getSignatureLite(): string { $data = [ 'merchantId' => $this->getMerchantConfig()->merchantId, 'accountId' => $this->getMerchantConfig()->accountId, 'merchantData' => $this->getMerchantData(), 'password' => $this->getMerchantConfig()->password, ]; return md5( http_build_query( array_filter($data) ) ); }
[ "public", "function", "getSignatureLite", "(", ")", ":", "string", "{", "$", "data", "=", "[", "'merchantId'", "=>", "$", "this", "->", "getMerchantConfig", "(", ")", "->", "merchantId", ",", "'accountId'", "=>", "$", "this", "->", "getMerchantConfig", "(", ...
Version of the getSignature method. Used by getPermanentPayment call.
[ "Version", "of", "the", "getSignature", "method", ".", "Used", "by", "getPermanentPayment", "call", "." ]
7e28eaf30ad1880533add93cf9e7296e61c09b8e
https://github.com/contributte/thepay-api/blob/7e28eaf30ad1880533add93cf9e7296e61c09b8e/src/PermanentPayment.php#L94-L108
train
OXID-eSales/paymorrow-module
core/oxpspaymorrowclient.php
OxpsPaymorrowClient.signRequest
public function signRequest( $sRequestString ) { $hPrivateKey = openssl_get_privatekey( oxRegistry::get( 'OxpsPaymorrowSettings' )->getPrivateKey() ); openssl_sign( $sRequestString, $bSignature, $hPrivateKey ); return bin2hex( $bSignature ); }
php
public function signRequest( $sRequestString ) { $hPrivateKey = openssl_get_privatekey( oxRegistry::get( 'OxpsPaymorrowSettings' )->getPrivateKey() ); openssl_sign( $sRequestString, $bSignature, $hPrivateKey ); return bin2hex( $bSignature ); }
[ "public", "function", "signRequest", "(", "$", "sRequestString", ")", "{", "$", "hPrivateKey", "=", "openssl_get_privatekey", "(", "oxRegistry", "::", "get", "(", "'OxpsPaymorrowSettings'", ")", "->", "getPrivateKey", "(", ")", ")", ";", "openssl_sign", "(", "$"...
Overridden parent method. Loads private key from the module settings to sign request data. @param string $sRequestString @return string
[ "Overridden", "parent", "method", ".", "Loads", "private", "key", "from", "the", "module", "settings", "to", "sign", "request", "data", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorrowclient.php#L48-L57
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Common/Factory/Base.php
Base.addClientDecorators
protected static function addClientDecorators( \Aimeos\Admin\JsonAdm\Iface $client, \Aimeos\MShop\Context\Item\Iface $context, $path ) { $config = $context->getConfig(); /** admin/jsonadm/common/decorators/default * Configures the list of decorators applied to all JSON API clients * * Decorators extend the functionality of a class by adding new aspects * (e.g. log what is currently done), executing the methods of the underlying * class only in certain conditions (e.g. only for logged in users) or * modify what is returned to the caller. * * This option allows you to configure a list of decorator names that should * be wrapped around the original instance of all created clients: * * admin/jsonadm/common/decorators/default = array( 'decorator1', 'decorator2' ) * * This would wrap the decorators named "decorator1" and "decorator2" around * all client instances in that order. The decorator classes would be * "\Aimeos\Admin\JsonAdm\Common\Decorator\Decorator1" and * "\Aimeos\Admin\JsonAdm\Common\Decorator\Decorator2". * * @param array List of decorator names * @since 2015.12 * @category Developer */ $decorators = $config->get( 'admin/jsonadm/common/decorators/default', [] ); if( $path !== null && is_string( $path ) ) { $dpath = trim( $path, '/' ); $dpath = ( $dpath !== '' ? $dpath . '/' : $dpath ); $excludes = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/excludes', [] ); $localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $path ) ) ); foreach( $decorators as $key => $name ) { if( in_array( $name, $excludes ) ) { unset( $decorators[$key] ); } } $classprefix = '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; $decorators = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/global', [] ); $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); if( !empty( $path ) ) { $classprefix = '\\Aimeos\\Admin\\JsonAdm\\' . ucfirst( $localClass ) . '\\Decorator\\'; $decorators = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/local', [] ); $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); } } else { $classprefix = '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); } return $client; }
php
protected static function addClientDecorators( \Aimeos\Admin\JsonAdm\Iface $client, \Aimeos\MShop\Context\Item\Iface $context, $path ) { $config = $context->getConfig(); /** admin/jsonadm/common/decorators/default * Configures the list of decorators applied to all JSON API clients * * Decorators extend the functionality of a class by adding new aspects * (e.g. log what is currently done), executing the methods of the underlying * class only in certain conditions (e.g. only for logged in users) or * modify what is returned to the caller. * * This option allows you to configure a list of decorator names that should * be wrapped around the original instance of all created clients: * * admin/jsonadm/common/decorators/default = array( 'decorator1', 'decorator2' ) * * This would wrap the decorators named "decorator1" and "decorator2" around * all client instances in that order. The decorator classes would be * "\Aimeos\Admin\JsonAdm\Common\Decorator\Decorator1" and * "\Aimeos\Admin\JsonAdm\Common\Decorator\Decorator2". * * @param array List of decorator names * @since 2015.12 * @category Developer */ $decorators = $config->get( 'admin/jsonadm/common/decorators/default', [] ); if( $path !== null && is_string( $path ) ) { $dpath = trim( $path, '/' ); $dpath = ( $dpath !== '' ? $dpath . '/' : $dpath ); $excludes = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/excludes', [] ); $localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $path ) ) ); foreach( $decorators as $key => $name ) { if( in_array( $name, $excludes ) ) { unset( $decorators[$key] ); } } $classprefix = '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; $decorators = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/global', [] ); $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); if( !empty( $path ) ) { $classprefix = '\\Aimeos\\Admin\\JsonAdm\\' . ucfirst( $localClass ) . '\\Decorator\\'; $decorators = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/local', [] ); $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); } } else { $classprefix = '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); } return $client; }
[ "protected", "static", "function", "addClientDecorators", "(", "\\", "Aimeos", "\\", "Admin", "\\", "JsonAdm", "\\", "Iface", "$", "client", ",", "\\", "Aimeos", "\\", "MShop", "\\", "Context", "\\", "Item", "\\", "Iface", "$", "context", ",", "$", "path",...
Adds the decorators to the JSON API client object @param \Aimeos\Admin\JsonAdm\Common\Iface $client Client object @param \Aimeos\MShop\Context\Item\Iface $context Context instance with necessary objects @param string $path Name of the client separated by slashes, e.g "product/property" @return \Aimeos\Admin\JsonAdm\Common\Iface Client object
[ "Adds", "the", "decorators", "to", "the", "JSON", "API", "client", "object" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Common/Factory/Base.php#L48-L110
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuserpayment.php
OxpsPaymorrowOxUserPayment.load
public function load( $sOxId ) { $sSQL = sprintf( 'SELECT `OXID`, `OXUSERID`, `OXPAYMENTSID`, DECODE( `OXVALUE`, "%s" ) AS `OXVALUE`, `OXPSPAYMORROWBANKNAME`, `OXPSPAYMORROWIBAN`, `OXPSPAYMORROWBIC`, `OXPSPAYMORROWORDERID` FROM `oxuserpayments` WHERE `OXID` = %s', $this->getPaymentKey(), oxDb::getDb()->quote( $sOxId ) ); return $this->assignRecord( $sSQL ); }
php
public function load( $sOxId ) { $sSQL = sprintf( 'SELECT `OXID`, `OXUSERID`, `OXPAYMENTSID`, DECODE( `OXVALUE`, "%s" ) AS `OXVALUE`, `OXPSPAYMORROWBANKNAME`, `OXPSPAYMORROWIBAN`, `OXPSPAYMORROWBIC`, `OXPSPAYMORROWORDERID` FROM `oxuserpayments` WHERE `OXID` = %s', $this->getPaymentKey(), oxDb::getDb()->quote( $sOxId ) ); return $this->assignRecord( $sSQL ); }
[ "public", "function", "load", "(", "$", "sOxId", ")", "{", "$", "sSQL", "=", "sprintf", "(", "'SELECT `OXID`, `OXUSERID`, `OXPAYMENTSID`, DECODE( `OXVALUE`, \"%s\" ) AS `OXVALUE`,\n `OXPSPAYMORROWBANKNAME`, `OXPSPAYMORROWIBAN`, `OXPSPAYMORROWBIC`, `OXPSPAYMORROWORDERID`\n ...
Overridden `load` function - loads additional Paymorrow fields in oxUserPayments table. Loads user payment object. @param string $sOxId @return mixed
[ "Overridden", "load", "function", "-", "loads", "additional", "Paymorrow", "fields", "in", "oxUserPayments", "table", ".", "Loads", "user", "payment", "object", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuserpayment.php#L130-L141
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuserpayment.php
OxpsPaymorrowOxUserPayment.isUserPaymentPaymorrowMethod
public function isUserPaymentPaymorrowMethod() { $sPaymentId = $this->oxuserpayments__oxpaymentsid->value; /** @var OxpsPaymorrowOxPayment|oxPayment $oxPayment */ $oxPayment = oxNew( 'oxPayment' ); $oxPayment->load( $sPaymentId ); return $oxPayment->isPaymorrowActiveAndMapped(); }
php
public function isUserPaymentPaymorrowMethod() { $sPaymentId = $this->oxuserpayments__oxpaymentsid->value; /** @var OxpsPaymorrowOxPayment|oxPayment $oxPayment */ $oxPayment = oxNew( 'oxPayment' ); $oxPayment->load( $sPaymentId ); return $oxPayment->isPaymorrowActiveAndMapped(); }
[ "public", "function", "isUserPaymentPaymorrowMethod", "(", ")", "{", "$", "sPaymentId", "=", "$", "this", "->", "oxuserpayments__oxpaymentsid", "->", "value", ";", "/** @var OxpsPaymorrowOxPayment|oxPayment $oxPayment */", "$", "oxPayment", "=", "oxNew", "(", "'oxPayment'...
Check if user payment method is mapped to a Paymorrow payment method. @return bool
[ "Check", "if", "user", "payment", "method", "is", "mapped", "to", "a", "Paymorrow", "payment", "method", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuserpayment.php#L148-L157
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuserpayment.php
OxpsPaymorrowOxUserPayment.getPaymorrowOxPayment
public function getPaymorrowOxPayment() { $sPaymentId = $this->oxuserpayments__oxpaymentsid->value; $oPayment = oxNew( 'oxPayment' ); $oPayment->load( $sPaymentId ); return $oPayment; }
php
public function getPaymorrowOxPayment() { $sPaymentId = $this->oxuserpayments__oxpaymentsid->value; $oPayment = oxNew( 'oxPayment' ); $oPayment->load( $sPaymentId ); return $oPayment; }
[ "public", "function", "getPaymorrowOxPayment", "(", ")", "{", "$", "sPaymentId", "=", "$", "this", "->", "oxuserpayments__oxpaymentsid", "->", "value", ";", "$", "oPayment", "=", "oxNew", "(", "'oxPayment'", ")", ";", "$", "oPayment", "->", "load", "(", "$",...
Get related payment method. Used in custom paymorrow email templates. @return oxPayment
[ "Get", "related", "payment", "method", ".", "Used", "in", "custom", "paymorrow", "email", "templates", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuserpayment.php#L165-L173
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket.getPaymorrowBasketLineItems
public function getPaymorrowBasketLineItems() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $aBasketContents = $this->getContents(); if ( empty( $aBasketContents ) ) { return array(); } $iLineItemCount = 1; // must start from 1 $aLineItems = array(); /** @var oxBasketItem|OxpsPaymorrowOxBasketItem $oBasketItem */ foreach ( $aBasketContents as $oBasketItem ) { $aLineItems = array_merge( $aLineItems, $oBasketItem->getPaymorrowBasketItemSummary( $iLineItemCount ) ); $iLineItemCount++; } /** * Checks for additional Payment, Wrapping, Gift Card, Delivery/Shipping, Vouchers, * TS Protection - costs */ $aLineItems = array_merge( $aLineItems, $this->_getPaymorrowAdditionalCostsSummary( $iLineItemCount ) ); return $aLineItems; }
php
public function getPaymorrowBasketLineItems() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $aBasketContents = $this->getContents(); if ( empty( $aBasketContents ) ) { return array(); } $iLineItemCount = 1; // must start from 1 $aLineItems = array(); /** @var oxBasketItem|OxpsPaymorrowOxBasketItem $oBasketItem */ foreach ( $aBasketContents as $oBasketItem ) { $aLineItems = array_merge( $aLineItems, $oBasketItem->getPaymorrowBasketItemSummary( $iLineItemCount ) ); $iLineItemCount++; } /** * Checks for additional Payment, Wrapping, Gift Card, Delivery/Shipping, Vouchers, * TS Protection - costs */ $aLineItems = array_merge( $aLineItems, $this->_getPaymorrowAdditionalCostsSummary( $iLineItemCount ) ); return $aLineItems; }
[ "public", "function", "getPaymorrowBasketLineItems", "(", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "$", "aBasketContents", "=", "$", "this", "->", "getContents", "(", ")", ";", "if", "(", "empty", "(", "$", "aBasketContents", ")", ")", "{", "r...
Get line items array - summary of bought products, costs and vouchers. @for: OxpsPaymorrowEshopDataProvider @return array
[ "Get", "line", "items", "array", "-", "summary", "of", "bought", "products", "costs", "and", "vouchers", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L48-L75
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket.getPaymorrowTotalAmount
public function getPaymorrowTotalAmount() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $dTotalPrice = (double) $this->getPrice()->getPrice(); // Add surcharge price in case it is not yet included in basket $oSurchargePrice = $this->_getPaymentMethodSurcharge(); if ( !empty( $oSurchargePrice ) and is_object( $oSurchargePrice ) ) { $dTotalPrice += (double) $oSurchargePrice->getPrice(); } return $dTotalPrice; }
php
public function getPaymorrowTotalAmount() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $dTotalPrice = (double) $this->getPrice()->getPrice(); // Add surcharge price in case it is not yet included in basket $oSurchargePrice = $this->_getPaymentMethodSurcharge(); if ( !empty( $oSurchargePrice ) and is_object( $oSurchargePrice ) ) { $dTotalPrice += (double) $oSurchargePrice->getPrice(); } return $dTotalPrice; }
[ "public", "function", "getPaymorrowTotalAmount", "(", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "$", "dTotalPrice", "=", "(", "double", ")", "$", "this", "->", "getPrice", "(", ")", "->", "getPrice", "(", ")", ";", "// Add surcharge price in case i...
Get basket total amount. Also adds surcharge amount if it is needed. @return float
[ "Get", "basket", "total", "amount", ".", "Also", "adds", "surcharge", "amount", "if", "it", "is", "needed", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L93-L107
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getPaymorrowAdditionalCostsSummary
protected function _getPaymorrowAdditionalCostsSummary( $iLineItemCount ) { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ // Line Item numbering after all basket items were summarized $iLineItem = (int) $iLineItemCount; // Get cost and add costs VATs list( $aCostItems, $iLineItem ) = $this->_getDefaultCostsSummary( $iLineItem ); // Get payment method surcharge item data in case payment form have just been posted $aItemData = (array) $this->_getPaymentMethodSurcharge( $iLineItem ); if ( !empty( $aItemData ) ) { $aCostItems = array_merge( $aCostItems, $aItemData ); $iLineItem++; } // Add voucher discount line item if ( $this->getVoucherDiscount() and $this->getVoucherDiscount()->getBruttoPrice() != 0 ) { $aCostItems = array_merge( $aCostItems, $this->_getPaymorrowVouchersSummary( $iLineItem ) ); } return $aCostItems; }
php
protected function _getPaymorrowAdditionalCostsSummary( $iLineItemCount ) { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ // Line Item numbering after all basket items were summarized $iLineItem = (int) $iLineItemCount; // Get cost and add costs VATs list( $aCostItems, $iLineItem ) = $this->_getDefaultCostsSummary( $iLineItem ); // Get payment method surcharge item data in case payment form have just been posted $aItemData = (array) $this->_getPaymentMethodSurcharge( $iLineItem ); if ( !empty( $aItemData ) ) { $aCostItems = array_merge( $aCostItems, $aItemData ); $iLineItem++; } // Add voucher discount line item if ( $this->getVoucherDiscount() and $this->getVoucherDiscount()->getBruttoPrice() != 0 ) { $aCostItems = array_merge( $aCostItems, $this->_getPaymorrowVouchersSummary( $iLineItem ) ); } return $aCostItems; }
[ "protected", "function", "_getPaymorrowAdditionalCostsSummary", "(", "$", "iLineItemCount", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "// Line Item numbering after all basket items were summarized", "$", "iLineItem", "=", "(", "int", ")", "$", "iLineItemCount", ...
Checks if there are any additional costs and returns Line Items array as summary. @param int $iLineItemCount @return array
[ "Checks", "if", "there", "are", "any", "additional", "costs", "and", "returns", "Line", "Items", "array", "as", "summary", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L160-L184
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getDefaultCostsSummary
protected function _getDefaultCostsSummary( $iLineItem ) { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $aCostItems = array(); $aCosts = (array) $this->getCosts(); foreach ( $aCosts as $sCost => $oPrice ) { $aItemData = (array) $this->_validateCostPriceAndGetItsData( $oPrice, $iLineItem, $sCost ); if ( !empty( $aItemData ) ) { $aCostItems = array_merge( $aCostItems, $aItemData ); $iLineItem++; } } return array($aCostItems, $iLineItem); }
php
protected function _getDefaultCostsSummary( $iLineItem ) { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $aCostItems = array(); $aCosts = (array) $this->getCosts(); foreach ( $aCosts as $sCost => $oPrice ) { $aItemData = (array) $this->_validateCostPriceAndGetItsData( $oPrice, $iLineItem, $sCost ); if ( !empty( $aItemData ) ) { $aCostItems = array_merge( $aCostItems, $aItemData ); $iLineItem++; } } return array($aCostItems, $iLineItem); }
[ "protected", "function", "_getDefaultCostsSummary", "(", "$", "iLineItem", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "$", "aCostItems", "=", "array", "(", ")", ";", "$", "aCosts", "=", "(", "array", ")", "$", "this", "->", "getCosts", "(", ")...
Load default shop costs and extract lite items summary. @param int $iLineItem @return array Mixed array with line items array as first element and new line count as second element.
[ "Load", "default", "shop", "costs", "and", "extract", "lite", "items", "summary", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L193-L211
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._validateCostPriceAndGetItsData
protected function _validateCostPriceAndGetItsData( $mPrice, $iLineItem, $sCost ) { if ( empty( $mPrice ) or !is_object( $mPrice ) or !$mPrice->getPrice() ) { return array(); } return $aItemData = (array) $this->_getCostSummary( $iLineItem, $sCost, $mPrice ); }
php
protected function _validateCostPriceAndGetItsData( $mPrice, $iLineItem, $sCost ) { if ( empty( $mPrice ) or !is_object( $mPrice ) or !$mPrice->getPrice() ) { return array(); } return $aItemData = (array) $this->_getCostSummary( $iLineItem, $sCost, $mPrice ); }
[ "protected", "function", "_validateCostPriceAndGetItsData", "(", "$", "mPrice", ",", "$", "iLineItem", ",", "$", "sCost", ")", "{", "if", "(", "empty", "(", "$", "mPrice", ")", "or", "!", "is_object", "(", "$", "mPrice", ")", "or", "!", "$", "mPrice", ...
Validate cost price and get cost line item data array for a valid cost. @param null|oxPrice $mPrice @param int $iLineItem @param string $sCost @return array
[ "Validate", "cost", "price", "and", "get", "cost", "line", "item", "data", "array", "for", "a", "valid", "cost", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L222-L229
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getCostSummary
protected function _getCostSummary( $iLineItem, $sCostName, $oPrice ) { $sPmPrefix = OxpsPaymorrowOxBasketItem::getPaymorrowBasketSummaryLineItemPrefix( $iLineItem ); list( $sId, $sName, $sType ) = $this->_getCostMetadata( $sCostName ); if ( empty( $sId ) ) { return array(); } $this->filterCostPrice($oPrice, $sCostName); return array( $sPmPrefix . 'quantity' => 1, $sPmPrefix . 'articleId' => $sId, $sPmPrefix . 'name' => $sName, $sPmPrefix . 'type' => $sType, $sPmPrefix . 'unitPriceGross' => (double) $oPrice->getBruttoPrice(), $sPmPrefix . 'grossAmount' => (double) $oPrice->getBruttoPrice(), $sPmPrefix . 'vatAmount' => (double) $oPrice->getVatValue(), $sPmPrefix . 'vatRate' => (double) $oPrice->getVat(), ); }
php
protected function _getCostSummary( $iLineItem, $sCostName, $oPrice ) { $sPmPrefix = OxpsPaymorrowOxBasketItem::getPaymorrowBasketSummaryLineItemPrefix( $iLineItem ); list( $sId, $sName, $sType ) = $this->_getCostMetadata( $sCostName ); if ( empty( $sId ) ) { return array(); } $this->filterCostPrice($oPrice, $sCostName); return array( $sPmPrefix . 'quantity' => 1, $sPmPrefix . 'articleId' => $sId, $sPmPrefix . 'name' => $sName, $sPmPrefix . 'type' => $sType, $sPmPrefix . 'unitPriceGross' => (double) $oPrice->getBruttoPrice(), $sPmPrefix . 'grossAmount' => (double) $oPrice->getBruttoPrice(), $sPmPrefix . 'vatAmount' => (double) $oPrice->getVatValue(), $sPmPrefix . 'vatRate' => (double) $oPrice->getVat(), ); }
[ "protected", "function", "_getCostSummary", "(", "$", "iLineItem", ",", "$", "sCostName", ",", "$", "oPrice", ")", "{", "$", "sPmPrefix", "=", "OxpsPaymorrowOxBasketItem", "::", "getPaymorrowBasketSummaryLineItemPrefix", "(", "$", "iLineItem", ")", ";", "list", "(...
Get cost line item summary data as array. @param integer $iLineItem @param string $sCostName @param oxPrice $oPrice @return array
[ "Get", "cost", "line", "item", "summary", "data", "as", "array", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L240-L262
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getCostMetadata
protected function _getCostMetadata( $sCostName ) { $aCostsMap = array( 'oxdelivery' => array( $this->_getShippingId(), 'DeliveryCosts', 'SHIPPING' ), 'oxwrapping' => array( 'Wrapping', 'Wrapping Costs', 'GOODS' ), 'oxgiftcard' => array( 'GiftCard', 'Gift Card Costs', 'GOODS' ), 'oxpayment' => array( $this->_getPaymentId(), 'PaymentCosts', 'PAYMENT_FEE' ), 'oxtsprotection' => array( $this->_getTsProductId(), 'TS Protection Costs', 'GOODS' ), ); return array_key_exists( $sCostName, $aCostsMap ) ? $aCostsMap[$sCostName] : array(); }
php
protected function _getCostMetadata( $sCostName ) { $aCostsMap = array( 'oxdelivery' => array( $this->_getShippingId(), 'DeliveryCosts', 'SHIPPING' ), 'oxwrapping' => array( 'Wrapping', 'Wrapping Costs', 'GOODS' ), 'oxgiftcard' => array( 'GiftCard', 'Gift Card Costs', 'GOODS' ), 'oxpayment' => array( $this->_getPaymentId(), 'PaymentCosts', 'PAYMENT_FEE' ), 'oxtsprotection' => array( $this->_getTsProductId(), 'TS Protection Costs', 'GOODS' ), ); return array_key_exists( $sCostName, $aCostsMap ) ? $aCostsMap[$sCostName] : array(); }
[ "protected", "function", "_getCostMetadata", "(", "$", "sCostName", ")", "{", "$", "aCostsMap", "=", "array", "(", "'oxdelivery'", "=>", "array", "(", "$", "this", "->", "_getShippingId", "(", ")", ",", "'DeliveryCosts'", ",", "'SHIPPING'", ")", ",", "'oxwra...
Get costs metadata values. @param string $sCostName @return array Cost metadata array: ID, Name, Type
[ "Get", "costs", "metadata", "values", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L291-L322
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getShippingId
protected function _getShippingId() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $sId = (string) $this->getShippingId(); if ( !empty( $sId ) ) { $sId = $this->_toUtf( $sId ); } else { $sId = 'shippingCosts'; } return $sId; }
php
protected function _getShippingId() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $sId = (string) $this->getShippingId(); if ( !empty( $sId ) ) { $sId = $this->_toUtf( $sId ); } else { $sId = 'shippingCosts'; } return $sId; }
[ "protected", "function", "_getShippingId", "(", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "$", "sId", "=", "(", "string", ")", "$", "this", "->", "getShippingId", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "sId", ")", ")", "{", "...
Get shipping method ID. Default value is "shippingCosts". @return string
[ "Get", "shipping", "method", "ID", ".", "Default", "value", "is", "shippingCosts", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L330-L343
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getPaymentId
protected function _getPaymentId() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $sId = (string) $this->getPaymentId(); if ( !empty( $sId ) ) { $sId = $this->_toUtf( $sId ); } else { $sId = 'PaymentId'; } return $sId; }
php
protected function _getPaymentId() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $sId = (string) $this->getPaymentId(); if ( !empty( $sId ) ) { $sId = $this->_toUtf( $sId ); } else { $sId = 'PaymentId'; } return $sId; }
[ "protected", "function", "_getPaymentId", "(", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "$", "sId", "=", "(", "string", ")", "$", "this", "->", "getPaymentId", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "sId", ")", ")", "{", "$"...
Get payment method ID. Default value is "PaymentId". @return string
[ "Get", "payment", "method", "ID", ".", "Default", "value", "is", "PaymentId", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L351-L364
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getTsProductId
protected function _getTsProductId() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $sId = method_exists($this, 'getTsProductId') ? (string) $this->getTsProductId() : ''; if ( !empty( $sId ) ) { $sId = $this->_toUtf( $sId ); } else { $sId = 'TsProtection'; } return $sId; }
php
protected function _getTsProductId() { /** @var OxpsPaymorrowOxBasket|oxBasket $this */ $sId = method_exists($this, 'getTsProductId') ? (string) $this->getTsProductId() : ''; if ( !empty( $sId ) ) { $sId = $this->_toUtf( $sId ); } else { $sId = 'TsProtection'; } return $sId; }
[ "protected", "function", "_getTsProductId", "(", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $this */", "$", "sId", "=", "method_exists", "(", "$", "this", ",", "'getTsProductId'", ")", "?", "(", "string", ")", "$", "this", "->", "getTsProductId", "(", ")",...
Get TS protection ID. Default value is "TsProtection". @return string
[ "Get", "TS", "protection", "ID", ".", "Default", "value", "is", "TsProtection", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L372-L387
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getPaymentMethodSurcharge
protected function _getPaymentMethodSurcharge( $mLineItem = null ) { $oSession = oxRegistry::getSession(); if ( $oSession->getVariable( 'paymentid' ) or ( !$aPaymentPostData = (array) $oSession->getVariable( 'pm_verify' ) ) or !array_key_exists( 'paymentid', $aPaymentPostData ) ) { return array(); } return $this->_formatPriceItemResponse( $this->_loadPaymentMethodSurcharge( (string) $aPaymentPostData['paymentid'] ), $mLineItem ); }
php
protected function _getPaymentMethodSurcharge( $mLineItem = null ) { $oSession = oxRegistry::getSession(); if ( $oSession->getVariable( 'paymentid' ) or ( !$aPaymentPostData = (array) $oSession->getVariable( 'pm_verify' ) ) or !array_key_exists( 'paymentid', $aPaymentPostData ) ) { return array(); } return $this->_formatPriceItemResponse( $this->_loadPaymentMethodSurcharge( (string) $aPaymentPostData['paymentid'] ), $mLineItem ); }
[ "protected", "function", "_getPaymentMethodSurcharge", "(", "$", "mLineItem", "=", "null", ")", "{", "$", "oSession", "=", "oxRegistry", "::", "getSession", "(", ")", ";", "if", "(", "$", "oSession", "->", "getVariable", "(", "'paymentid'", ")", "or", "(", ...
Get payment method surcharge line item by loading it from posted Paymorrow payment form data. @param null|int $mLineItem If null, then surcharge price object is returned, else surcharge line item data array @return oxPrice|array
[ "Get", "payment", "method", "surcharge", "line", "item", "by", "loading", "it", "from", "posted", "Paymorrow", "payment", "form", "data", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L396-L411
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._formatPriceItemResponse
protected function _formatPriceItemResponse( $mPrice, $mLineItem ) { if ( !is_null( $mLineItem ) and is_object( $mPrice ) ) { return $this->_getCostSummary( (int) $mLineItem, 'oxpayment', $mPrice ); } return $mPrice; }
php
protected function _formatPriceItemResponse( $mPrice, $mLineItem ) { if ( !is_null( $mLineItem ) and is_object( $mPrice ) ) { return $this->_getCostSummary( (int) $mLineItem, 'oxpayment', $mPrice ); } return $mPrice; }
[ "protected", "function", "_formatPriceItemResponse", "(", "$", "mPrice", ",", "$", "mLineItem", ")", "{", "if", "(", "!", "is_null", "(", "$", "mLineItem", ")", "and", "is_object", "(", "$", "mPrice", ")", ")", "{", "return", "$", "this", "->", "_getCost...
If line item requested, then return line item data array, otherwise price object fdirectly. @param array|oxPrice $mPrice @param null|int $mLineItem @return array|oxPrice
[ "If", "line", "item", "requested", "then", "return", "line", "item", "data", "array", "otherwise", "price", "object", "fdirectly", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L421-L428
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._loadPaymentMethodSurcharge
protected function _loadPaymentMethodSurcharge( $sPaymentId ) { /** @var oxPayment $oPaymentMethod */ $oPaymentMethod = oxNew( 'oxPayment' ); if ( !$oPaymentMethod->load( $sPaymentId ) or !$oPaymentMethod->getId() ) { return array(); } $oPaymentMethod->calculate( $this ); $oSurchargePrice = $oPaymentMethod->getPrice(); if ( empty( $oSurchargePrice ) ) { return array(); } return $oSurchargePrice; }
php
protected function _loadPaymentMethodSurcharge( $sPaymentId ) { /** @var oxPayment $oPaymentMethod */ $oPaymentMethod = oxNew( 'oxPayment' ); if ( !$oPaymentMethod->load( $sPaymentId ) or !$oPaymentMethod->getId() ) { return array(); } $oPaymentMethod->calculate( $this ); $oSurchargePrice = $oPaymentMethod->getPrice(); if ( empty( $oSurchargePrice ) ) { return array(); } return $oSurchargePrice; }
[ "protected", "function", "_loadPaymentMethodSurcharge", "(", "$", "sPaymentId", ")", "{", "/** @var oxPayment $oPaymentMethod */", "$", "oPaymentMethod", "=", "oxNew", "(", "'oxPayment'", ")", ";", "if", "(", "!", "$", "oPaymentMethod", "->", "load", "(", "$", "sP...
Load payment method by ID and calculate its surcharge for the basket. @param string $sPaymentId @return array|oxPrice Empty array on failure, price object on success.
[ "Load", "payment", "method", "by", "ID", "and", "calculate", "its", "surcharge", "for", "the", "basket", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L437-L454
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasket.php
OxpsPaymorrowOxBasket._getPaymorrowVouchersSummary
protected function _getPaymorrowVouchersSummary( $iLineItem ) { $sPmPrefix = OxpsPaymorrowOxBasketItem::getPaymorrowBasketSummaryLineItemPrefix( $iLineItem ); /** @var oxPrice $oVoucher */ $oVoucher = $this->getVoucherDiscount(); return array( $sPmPrefix . 'quantity' => 1, $sPmPrefix . 'articleId' => 'Voucher', $sPmPrefix . 'name' => 'VoucherCosts', $sPmPrefix . 'type' => 'VOUCHER', $sPmPrefix . 'unitPriceGross' => (double) $oVoucher->getBruttoPrice(), $sPmPrefix . 'grossAmount' => (double) $oVoucher->getBruttoPrice(), $sPmPrefix . 'vatAmount' => 0.0, $sPmPrefix . 'vatRate' => 0.0, ); }
php
protected function _getPaymorrowVouchersSummary( $iLineItem ) { $sPmPrefix = OxpsPaymorrowOxBasketItem::getPaymorrowBasketSummaryLineItemPrefix( $iLineItem ); /** @var oxPrice $oVoucher */ $oVoucher = $this->getVoucherDiscount(); return array( $sPmPrefix . 'quantity' => 1, $sPmPrefix . 'articleId' => 'Voucher', $sPmPrefix . 'name' => 'VoucherCosts', $sPmPrefix . 'type' => 'VOUCHER', $sPmPrefix . 'unitPriceGross' => (double) $oVoucher->getBruttoPrice(), $sPmPrefix . 'grossAmount' => (double) $oVoucher->getBruttoPrice(), $sPmPrefix . 'vatAmount' => 0.0, $sPmPrefix . 'vatRate' => 0.0, ); }
[ "protected", "function", "_getPaymorrowVouchersSummary", "(", "$", "iLineItem", ")", "{", "$", "sPmPrefix", "=", "OxpsPaymorrowOxBasketItem", "::", "getPaymorrowBasketSummaryLineItemPrefix", "(", "$", "iLineItem", ")", ";", "/** @var oxPrice $oVoucher */", "$", "oVoucher", ...
Get voucher discount summary. @param $iLineItem - Paymorrow line item must be passed in order to properly merge line items. @return array
[ "Get", "voucher", "discount", "summary", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasket.php#L463-L480
train
contributte/thepay-api
src/Helper/ButtonMerchant.php
ButtonMerchant.setButtonStyle
public function setButtonStyle( ?string $buttonStyle, ?string $buttonText = null ): void { if (empty($buttonStyle)) { $buttonStyle = null; } $this->buttonStyle = $buttonStyle; if ($buttonText !== null) { $this->buttonText = $buttonText; } }
php
public function setButtonStyle( ?string $buttonStyle, ?string $buttonText = null ): void { if (empty($buttonStyle)) { $buttonStyle = null; } $this->buttonStyle = $buttonStyle; if ($buttonText !== null) { $this->buttonText = $buttonText; } }
[ "public", "function", "setButtonStyle", "(", "?", "string", "$", "buttonStyle", ",", "?", "string", "$", "buttonText", "=", "null", ")", ":", "void", "{", "if", "(", "empty", "(", "$", "buttonStyle", ")", ")", "{", "$", "buttonStyle", "=", "null", ";",...
Sets the buttonStyle property. @param string|null $buttonStyle String specifying the button style. Can be null for default text button, or one of button styles specified in the ThePay API documentation. @param string $buttonText Optional argument specifying the text that should be displayed on the button.
[ "Sets", "the", "buttonStyle", "property", "." ]
7e28eaf30ad1880533add93cf9e7296e61c09b8e
https://github.com/contributte/thepay-api/blob/7e28eaf30ad1880533add93cf9e7296e61c09b8e/src/Helper/ButtonMerchant.php#L36-L50
train
contributte/thepay-api
src/Helper/ButtonMerchant.php
ButtonMerchant.render
public function render(): string { $targetUrl = Escaper::htmlEntityEncode(self::buildUrl()); if ($this->buttonStyle === null) { return "<a href=\"{$targetUrl}\">{$this->buttonText}</a>"; } $gateUrl = $this->payment->getMerchantConfig()->gateUrl; $buttonStyle = rawurlencode($this->buttonStyle); $src = Escaper::htmlEntityEncode($gateUrl . 'buttons/' . $buttonStyle . '.png'); $title = Escaper::htmlEntityEncode($this->buttonText); return "<a href=\"{$targetUrl}\"><img src=\"{$src}\" alt=\"{$title}\" title=\"{$title}\" /></a>"; }
php
public function render(): string { $targetUrl = Escaper::htmlEntityEncode(self::buildUrl()); if ($this->buttonStyle === null) { return "<a href=\"{$targetUrl}\">{$this->buttonText}</a>"; } $gateUrl = $this->payment->getMerchantConfig()->gateUrl; $buttonStyle = rawurlencode($this->buttonStyle); $src = Escaper::htmlEntityEncode($gateUrl . 'buttons/' . $buttonStyle . '.png'); $title = Escaper::htmlEntityEncode($this->buttonText); return "<a href=\"{$targetUrl}\"><img src=\"{$src}\" alt=\"{$title}\" title=\"{$title}\" /></a>"; }
[ "public", "function", "render", "(", ")", ":", "string", "{", "$", "targetUrl", "=", "Escaper", "::", "htmlEntityEncode", "(", "self", "::", "buildUrl", "(", ")", ")", ";", "if", "(", "$", "this", "->", "buttonStyle", "===", "null", ")", "{", "return",...
Return the HTML code for the button.
[ "Return", "the", "HTML", "code", "for", "the", "button", "." ]
7e28eaf30ad1880533add93cf9e7296e61c09b8e
https://github.com/contributte/thepay-api/blob/7e28eaf30ad1880533add93cf9e7296e61c09b8e/src/Helper/ButtonMerchant.php#L81-L96
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm/Catalog/Standard.php
Standard.getListItems
protected function getListItems( array $items, array $include ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' ); $search = $manager->createSearch(); $expr = array( $search->compare( '==', 'catalog.lists.parentid', array_keys( $items ) ), $search->compare( '==', 'catalog.lists.domain', $include ), ); $search->setConditions( $search->combine( '&&', $expr ) ); return $manager->searchItems( $search ); }
php
protected function getListItems( array $items, array $include ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog/lists' ); $search = $manager->createSearch(); $expr = array( $search->compare( '==', 'catalog.lists.parentid', array_keys( $items ) ), $search->compare( '==', 'catalog.lists.domain', $include ), ); $search->setConditions( $search->combine( '&&', $expr ) ); return $manager->searchItems( $search ); }
[ "protected", "function", "getListItems", "(", "array", "$", "items", ",", "array", "$", "include", ")", "{", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create", "(", "$", "this", "->", "getContext", "(", ")", ",", "'catalog/lists'", ")", ...
Returns the list items for association relationships @param array $items List of items implementing \Aimeos\MShop\Common\Item\Iface @param array $include List of resource types that should be fetched @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface
[ "Returns", "the", "list", "items", "for", "association", "relationships" ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm/Catalog/Standard.php#L212-L224
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorrowpayment.php
OxpsPaymorrowPayment.validatePayment
public function validatePayment() { // Remove payment methods initialization data from session of any is set $this->_unsetSessionInitData(); $mReturn = $this->_OxpsPaymorrowPayment_validatePayment_parent(); if ($this->_isPaymorrowPayment(oxRegistry::getConfig()->getRequestParameter('paymentid')) and $this->_isPaymentResponseSessionInvalid() ) { oxRegistry::getSession()->setVariable('payerror', 1); return null; } return $mReturn; }
php
public function validatePayment() { // Remove payment methods initialization data from session of any is set $this->_unsetSessionInitData(); $mReturn = $this->_OxpsPaymorrowPayment_validatePayment_parent(); if ($this->_isPaymorrowPayment(oxRegistry::getConfig()->getRequestParameter('paymentid')) and $this->_isPaymentResponseSessionInvalid() ) { oxRegistry::getSession()->setVariable('payerror', 1); return null; } return $mReturn; }
[ "public", "function", "validatePayment", "(", ")", "{", "// Remove payment methods initialization data from session of any is set", "$", "this", "->", "_unsetSessionInitData", "(", ")", ";", "$", "mReturn", "=", "$", "this", "->", "_OxpsPaymorrowPayment_validatePayment_parent...
Overridden parent method. Additionally checks if Paymorrow request was successful. It is needed for detecting cases, when JavaScript is disabled in user browser and no requests were sent. @return mixed
[ "Overridden", "parent", "method", ".", "Additionally", "checks", "if", "Paymorrow", "request", "was", "successful", ".", "It", "is", "needed", "for", "detecting", "cases", "when", "JavaScript", "is", "disabled", "in", "user", "browser", "and", "no", "requests", ...
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorrowpayment.php#L48-L64
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorrowpayment.php
OxpsPaymorrowPayment._isPaymentResponseSessionInvalid
protected function _isPaymentResponseSessionInvalid() { /** @var OxpsPaymorrowModule $oModule */ $oModule = oxRegistry::get('OxpsPaymorrowModule'); // Get Paymorrow response from session $aPaymorrowResponse = $oModule->getPaymorrowResponseData(); // The response must exist and be valid return ( !isset($aPaymorrowResponse['order_status'], $aPaymorrowResponse['response_status']) or !in_array($aPaymorrowResponse['order_status'], array('VALIDATED', 'ACCEPTED')) or ($aPaymorrowResponse['response_status'] !== 'OK') ); }
php
protected function _isPaymentResponseSessionInvalid() { /** @var OxpsPaymorrowModule $oModule */ $oModule = oxRegistry::get('OxpsPaymorrowModule'); // Get Paymorrow response from session $aPaymorrowResponse = $oModule->getPaymorrowResponseData(); // The response must exist and be valid return ( !isset($aPaymorrowResponse['order_status'], $aPaymorrowResponse['response_status']) or !in_array($aPaymorrowResponse['order_status'], array('VALIDATED', 'ACCEPTED')) or ($aPaymorrowResponse['response_status'] !== 'OK') ); }
[ "protected", "function", "_isPaymentResponseSessionInvalid", "(", ")", "{", "/** @var OxpsPaymorrowModule $oModule */", "$", "oModule", "=", "oxRegistry", "::", "get", "(", "'OxpsPaymorrowModule'", ")", ";", "// Get Paymorrow response from session", "$", "aPaymorrowResponse", ...
Check payment response in session fot errors. @return bool True is response is invalid, false otherwise.
[ "Check", "payment", "response", "in", "session", "fot", "errors", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorrowpayment.php#L99-L113
train
moodev/php-weasel
lib/Weasel/JsonMarshaller/Config/AnnotationDriver.php
AnnotationDriver._getConfig
protected function _getConfig($class) { $rClass = new \ReflectionClass($class); // Delegate actually loading the config for the class to the ClassAnnotationDriver $classDriver = new ClassAnnotationDriver($rClass, $this->annotationReaderFactory, $this->annotationNamespace); return $classDriver->getConfig(); }
php
protected function _getConfig($class) { $rClass = new \ReflectionClass($class); // Delegate actually loading the config for the class to the ClassAnnotationDriver $classDriver = new ClassAnnotationDriver($rClass, $this->annotationReaderFactory, $this->annotationNamespace); return $classDriver->getConfig(); }
[ "protected", "function", "_getConfig", "(", "$", "class", ")", "{", "$", "rClass", "=", "new", "\\", "ReflectionClass", "(", "$", "class", ")", ";", "// Delegate actually loading the config for the class to the ClassAnnotationDriver", "$", "classDriver", "=", "new", "...
_Really_ obtain the config for a named class @param string $class The class to get the config for @return \Weasel\JsonMarshaller\Config\ClassMarshaller The config, or null if not found
[ "_Really_", "obtain", "the", "config", "for", "a", "named", "class" ]
fecc7cc06cae719489cb4490f414ed6530e70831
https://github.com/moodev/php-weasel/blob/fecc7cc06cae719489cb4490f414ed6530e70831/lib/Weasel/JsonMarshaller/Config/AnnotationDriver.php#L68-L77
train
moodev/php-weasel
lib/Weasel/WeaselJsonConfigDrivenFactory.php
WeaselJsonConfigDrivenFactory.getXmlMapperInstance
public function getXmlMapperInstance() { if (!isset($this->_xmlMapper)) { $this->_xmlMapper = new XmlMapper($this->_getXmlConfigDriver()); } return $this->_xmlMapper; }
php
public function getXmlMapperInstance() { if (!isset($this->_xmlMapper)) { $this->_xmlMapper = new XmlMapper($this->_getXmlConfigDriver()); } return $this->_xmlMapper; }
[ "public", "function", "getXmlMapperInstance", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_xmlMapper", ")", ")", "{", "$", "this", "->", "_xmlMapper", "=", "new", "XmlMapper", "(", "$", "this", "->", "_getXmlConfigDriver", "(", ")", ...
Get a fully configured XmlMapper instance. @return XmlMapper
[ "Get", "a", "fully", "configured", "XmlMapper", "instance", "." ]
fecc7cc06cae719489cb4490f414ed6530e70831
https://github.com/moodev/php-weasel/blob/fecc7cc06cae719489cb4490f414ed6530e70831/lib/Weasel/WeaselJsonConfigDrivenFactory.php#L154-L160
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxpayment.php
OxpsPaymorrowOxPayment.setPaymorrowPaymentMap
public function setPaymorrowPaymentMap($iType) { $blValidMapping = array_key_exists($iType, $this->_aPaymorrowValidPaymentTypes); if ($blValidMapping) { $this->oxpayments__oxpspaymorrowmap = new oxField($iType); } return $blValidMapping; }
php
public function setPaymorrowPaymentMap($iType) { $blValidMapping = array_key_exists($iType, $this->_aPaymorrowValidPaymentTypes); if ($blValidMapping) { $this->oxpayments__oxpspaymorrowmap = new oxField($iType); } return $blValidMapping; }
[ "public", "function", "setPaymorrowPaymentMap", "(", "$", "iType", ")", "{", "$", "blValidMapping", "=", "array_key_exists", "(", "$", "iType", ",", "$", "this", "->", "_aPaymorrowValidPaymentTypes", ")", ";", "if", "(", "$", "blValidMapping", ")", "{", "$", ...
Set Paymorrow payment method ID. 0 - Off / none 1 - Paymorrow Invoice 2 - Paymorrow Direct Debit
[ "Set", "Paymorrow", "payment", "method", "ID", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxpayment.php#L145-L154
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxpayment.php
OxpsPaymorrowOxPayment.isValidPayment
public function isValidPayment($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId) { /** @var OxpsPaymorrowOxPayment|oxPayment $this */ $blIsValid = (bool) $this->_OxpsPaymorrowOxPayment_isValidPayment_parent( $aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId ); $iErrorCode = (int) $this->getPaymentErrorNumber(); // In case it is Paymorrow payment method unset error code and tell than validation passed. if ($this->isPaymorrowActive() and !$blIsValid and ($iErrorCode === 1)) { $this->_iPaymentError = null; return true; } return $blIsValid; }
php
public function isValidPayment($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId) { /** @var OxpsPaymorrowOxPayment|oxPayment $this */ $blIsValid = (bool) $this->_OxpsPaymorrowOxPayment_isValidPayment_parent( $aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId ); $iErrorCode = (int) $this->getPaymentErrorNumber(); // In case it is Paymorrow payment method unset error code and tell than validation passed. if ($this->isPaymorrowActive() and !$blIsValid and ($iErrorCode === 1)) { $this->_iPaymentError = null; return true; } return $blIsValid; }
[ "public", "function", "isValidPayment", "(", "$", "aDynValue", ",", "$", "sShopId", ",", "$", "oUser", ",", "$", "dBasketPrice", ",", "$", "sShipSetId", ")", "{", "/** @var OxpsPaymorrowOxPayment|oxPayment $this */", "$", "blIsValid", "=", "(", "bool", ")", "$",...
Overridden parent method. Ignores default payment method form error in case method is converted to a Paymorrow payment method. @param $aDynValue @param $sShopId @param $oUser @param $dBasketPrice @param $sShipSetId @return bool
[ "Overridden", "parent", "method", ".", "Ignores", "default", "payment", "method", "form", "error", "in", "case", "method", "is", "converted", "to", "a", "Paymorrow", "payment", "method", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxpayment.php#L178-L196
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxpayment.php
OxpsPaymorrowOxPayment.loadPaymorrowDefault
public function loadPaymorrowDefault() { /** @var OxpsPaymorrowOxPayment|oxPayment $this */ $query = sprintf( "SELECT * FROM `%s`WHERE %s AND `OXCHECKED` = 1 ORDER BY `OXSORT` ASC, `OXTIMESTAMP` DESC LIMIT 1", $this->getViewName(), $this->getPaymorrowMethodWhereClause() ); return $this->assignRecord($query); }
php
public function loadPaymorrowDefault() { /** @var OxpsPaymorrowOxPayment|oxPayment $this */ $query = sprintf( "SELECT * FROM `%s`WHERE %s AND `OXCHECKED` = 1 ORDER BY `OXSORT` ASC, `OXTIMESTAMP` DESC LIMIT 1", $this->getViewName(), $this->getPaymorrowMethodWhereClause() ); return $this->assignRecord($query); }
[ "public", "function", "loadPaymorrowDefault", "(", ")", "{", "/** @var OxpsPaymorrowOxPayment|oxPayment $this */", "$", "query", "=", "sprintf", "(", "\"SELECT * FROM `%s`WHERE %s AND `OXCHECKED` = 1 ORDER BY `OXSORT` ASC, `OXTIMESTAMP` DESC LIMIT 1\"", ",", "$", "this", "->", "get...
Load active, mapped and selected Paymorrow payment method. If several are selected loads it by sorting and last updated. @codeCoverageIgnore @return mixed
[ "Load", "active", "mapped", "and", "selected", "Paymorrow", "payment", "method", ".", "If", "several", "are", "selected", "loads", "it", "by", "sorting", "and", "last", "updated", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxpayment.php#L206-L217
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxpayment.php
OxpsPaymorrowOxPayment.loadByPaymorrowName
public function loadByPaymorrowName($methodName) { /** @var OxpsPaymorrowOxPayment|oxPayment $this */ if (!array_key_exists($methodName, $this->paymorrowPaymentNameMap)) { return false; } $query = sprintf( "SELECT * FROM `%s` WHERE %s AND `OXPSPAYMORROWMAP` = %d ORDER BY `OXSORT` ASC, `OXTIMESTAMP` DESC LIMIT 1", $this->getViewName(), $this->getPaymorrowMethodWhereClause(), (int) $this->paymorrowPaymentNameMap[$methodName] ); return $this->assignRecord($query); }
php
public function loadByPaymorrowName($methodName) { /** @var OxpsPaymorrowOxPayment|oxPayment $this */ if (!array_key_exists($methodName, $this->paymorrowPaymentNameMap)) { return false; } $query = sprintf( "SELECT * FROM `%s` WHERE %s AND `OXPSPAYMORROWMAP` = %d ORDER BY `OXSORT` ASC, `OXTIMESTAMP` DESC LIMIT 1", $this->getViewName(), $this->getPaymorrowMethodWhereClause(), (int) $this->paymorrowPaymentNameMap[$methodName] ); return $this->assignRecord($query); }
[ "public", "function", "loadByPaymorrowName", "(", "$", "methodName", ")", "{", "/** @var OxpsPaymorrowOxPayment|oxPayment $this */", "if", "(", "!", "array_key_exists", "(", "$", "methodName", ",", "$", "this", "->", "paymorrowPaymentNameMap", ")", ")", "{", "return",...
Load active, mapped Paymorrow payment method by it's name. E.g. by value "INVOICE" or "SDD". @param string $methodName @codeCoverageIgnore @return bool
[ "Load", "active", "mapped", "Paymorrow", "payment", "method", "by", "it", "s", "name", ".", "E", ".", "g", ".", "by", "value", "INVOICE", "or", "SDD", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxpayment.php#L229-L245
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxpayment.php
OxpsPaymorrowOxPayment._OxpsPaymorrowOxPayment_isValidPayment_parent
protected function _OxpsPaymorrowOxPayment_isValidPayment_parent($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId) { return parent::isValidPayment($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId); }
php
protected function _OxpsPaymorrowOxPayment_isValidPayment_parent($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId) { return parent::isValidPayment($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId); }
[ "protected", "function", "_OxpsPaymorrowOxPayment_isValidPayment_parent", "(", "$", "aDynValue", ",", "$", "sShopId", ",", "$", "oUser", ",", "$", "dBasketPrice", ",", "$", "sShipSetId", ")", "{", "return", "parent", "::", "isValidPayment", "(", "$", "aDynValue", ...
Parent `isValidPayment` call. @codeCoverageIgnore @param $aDynValue @param $sShopId @param $oUser @param $dBasketPrice @param $sShipSetId @return mixed
[ "Parent", "isValidPayment", "call", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxpayment.php#L274-L278
train
techdivision/import-product
src/Observers/AbstractProductRelationObserver.php
AbstractProductRelationObserver.prepareProductRelationAttributes
protected function prepareProductRelationAttributes() { // initialize and return the entity return $this->initializeEntity( array( MemberNames::PARENT_ID => $this->parentId, MemberNames::CHILD_ID => $this->childId ) ); }
php
protected function prepareProductRelationAttributes() { // initialize and return the entity return $this->initializeEntity( array( MemberNames::PARENT_ID => $this->parentId, MemberNames::CHILD_ID => $this->childId ) ); }
[ "protected", "function", "prepareProductRelationAttributes", "(", ")", "{", "// initialize and return the entity", "return", "$", "this", "->", "initializeEntity", "(", "array", "(", "MemberNames", "::", "PARENT_ID", "=>", "$", "this", "->", "parentId", ",", "MemberNa...
Prepare the product relation attributes that has to be persisted. @return array The prepared product relation attributes
[ "Prepare", "the", "product", "relation", "attributes", "that", "has", "to", "be", "persisted", "." ]
a596e0c4b0495c918139935a709815c739d61e95
https://github.com/techdivision/import-product/blob/a596e0c4b0495c918139935a709815c739d61e95/src/Observers/AbstractProductRelationObserver.php#L165-L175
train
techdivision/import-product
src/Actions/Processors/CategoryProductDeleteProcessor.php
CategoryProductDeleteProcessor.getStatements
protected function getStatements() { // return the array with the SQL statements that has to be prepared return array( SqlStatementKeys::DELETE_CATEGORY_PRODUCT => $this->loadStatement(SqlStatementKeys::DELETE_CATEGORY_PRODUCT), SqlStatementKeys::DELETE_CATEGORY_PRODUCT_BY_SKU => $this->loadStatement(SqlStatementKeys::DELETE_CATEGORY_PRODUCT_BY_SKU) ); }
php
protected function getStatements() { // return the array with the SQL statements that has to be prepared return array( SqlStatementKeys::DELETE_CATEGORY_PRODUCT => $this->loadStatement(SqlStatementKeys::DELETE_CATEGORY_PRODUCT), SqlStatementKeys::DELETE_CATEGORY_PRODUCT_BY_SKU => $this->loadStatement(SqlStatementKeys::DELETE_CATEGORY_PRODUCT_BY_SKU) ); }
[ "protected", "function", "getStatements", "(", ")", "{", "// return the array with the SQL statements that has to be prepared", "return", "array", "(", "SqlStatementKeys", "::", "DELETE_CATEGORY_PRODUCT", "=>", "$", "this", "->", "loadStatement", "(", "SqlStatementKeys", "::"...
Return's the array with the SQL statements that has to be prepared. @return array The SQL statements to be prepared @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements()
[ "Return", "s", "the", "array", "with", "the", "SQL", "statements", "that", "has", "to", "be", "prepared", "." ]
a596e0c4b0495c918139935a709815c739d61e95
https://github.com/techdivision/import-product/blob/a596e0c4b0495c918139935a709815c739d61e95/src/Actions/Processors/CategoryProductDeleteProcessor.php#L44-L52
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm.php
JsonAdm.create
public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path, $name = null ) { $path = trim( $path, '/' ); if( empty( $path ) ) { return self::createRoot( $context, $aimeos, $path, $name ); } else { return self::createNew( $context, $aimeos, $path, $name ); } }
php
public static function create( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path, $name = null ) { $path = trim( $path, '/' ); if( empty( $path ) ) { return self::createRoot( $context, $aimeos, $path, $name ); } else { return self::createNew( $context, $aimeos, $path, $name ); } }
[ "public", "static", "function", "create", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Context", "\\", "Item", "\\", "Iface", "$", "context", ",", "\\", "Aimeos", "\\", "Bootstrap", "$", "aimeos", ",", "$", "path", ",", "$", "name", "=", "null", ")", "...
Creates the required client specified by the given path of client names. Clients are created by providing only the domain name, e.g. "product" for the \Aimeos\Admin\JsonAdm\Product\Standard or a path of names to retrieve a specific sub-client, e.g. "product/type" for the \Aimeos\Admin\JsonAdm\Product\Type\Standard client. @param \Aimeos\MShop\Context\Item\Iface $context Context object required by clients @param \Aimeos\Bootstrap $aimeos Aimeos Bootstrap object @param string $path Name of the client separated by slashes, e.g "product/property" @param string|null $name Name of the client implementation ("Standard" if null) @return \Aimeos\Admin\JsonAdm\Iface JSON admin instance @throws \Aimeos\Admin\JsonAdm\Exception If the given path is invalid
[ "Creates", "the", "required", "client", "specified", "by", "the", "given", "path", "of", "client", "names", "." ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm.php#L37-L47
train
aimeos/ai-admin-jsonadm
admin/jsonadm/src/Admin/JsonAdm.php
JsonAdm.createNew
protected static function createNew( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path, $name ) { $pname = $name; $parts = explode( '/', $path ); foreach( $parts as $key => $part ) { if( ctype_alnum( $part ) === false ) { $msg = sprintf( 'Invalid client "%1$s"', $path ); throw new \Aimeos\Admin\JsonAdm\Exception( $msg, 400 ); } $parts[$key] = ucwords( $part ); } if( $pname === null ) { $pname = $context->getConfig()->get( 'admin/jsonadm/' . $path . '/name', 'Standard' ); } $view = $context->getView(); $config = $context->getConfig(); if( $view->access( $config->get( 'admin/jsonadm/resource/' . $path . '/groups', [] ) ) !== true ) { throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Not allowed to access JsonAdm "%1$s" client', $path ) ); } $view = $context->getView(); $iface = \Aimeos\Admin\JsonAdm\Iface::class; $classname = '\\Aimeos\\Admin\\JsonAdm\\' . join( '\\', $parts ) . '\\' . $pname; if( ctype_alnum( $pname ) === false ) { $classname = is_string( $pname ) ? $classname : '<not a string>'; throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'Invalid class name "%1$s"', $classname ) ); } if( class_exists( $classname ) === false ) { return self::createRoot( $context, $aimeos, $path, $name ); } $client = self::createAdmin( $classname, $iface, $context, $path ); $client = self::addClientDecorators( $client, $context, $path ); return $client->setAimeos( $aimeos )->setView( $view ); }
php
protected static function createNew( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path, $name ) { $pname = $name; $parts = explode( '/', $path ); foreach( $parts as $key => $part ) { if( ctype_alnum( $part ) === false ) { $msg = sprintf( 'Invalid client "%1$s"', $path ); throw new \Aimeos\Admin\JsonAdm\Exception( $msg, 400 ); } $parts[$key] = ucwords( $part ); } if( $pname === null ) { $pname = $context->getConfig()->get( 'admin/jsonadm/' . $path . '/name', 'Standard' ); } $view = $context->getView(); $config = $context->getConfig(); if( $view->access( $config->get( 'admin/jsonadm/resource/' . $path . '/groups', [] ) ) !== true ) { throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Not allowed to access JsonAdm "%1$s" client', $path ) ); } $view = $context->getView(); $iface = \Aimeos\Admin\JsonAdm\Iface::class; $classname = '\\Aimeos\\Admin\\JsonAdm\\' . join( '\\', $parts ) . '\\' . $pname; if( ctype_alnum( $pname ) === false ) { $classname = is_string( $pname ) ? $classname : '<not a string>'; throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'Invalid class name "%1$s"', $classname ) ); } if( class_exists( $classname ) === false ) { return self::createRoot( $context, $aimeos, $path, $name ); } $client = self::createAdmin( $classname, $iface, $context, $path ); $client = self::addClientDecorators( $client, $context, $path ); return $client->setAimeos( $aimeos )->setView( $view ); }
[ "protected", "static", "function", "createNew", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Context", "\\", "Item", "\\", "Iface", "$", "context", ",", "\\", "Aimeos", "\\", "Bootstrap", "$", "aimeos", ",", "$", "path", ",", "$", "name", ")", "{", "$", ...
Creates a new client specified by the given path of client names. @param \Aimeos\MShop\Context\Item\Iface $context Context object required by clients @param \Aimeos\Bootstrap $aimeos Aimeos Bootstrap object @param string $path Name of the client separated by slashes, e.g "product/stock" @param string|null $name Name of the client implementation ("Standard" if null) @return \Aimeos\Admin\JsonAdm\Iface JSON admin instance @throws \Aimeos\Admin\JsonAdm\Exception If the given path is invalid
[ "Creates", "a", "new", "client", "specified", "by", "the", "given", "path", "of", "client", "names", "." ]
8e4dc6528afcd2199e6555b2e7ead4f75b221005
https://github.com/aimeos/ai-admin-jsonadm/blob/8e4dc6528afcd2199e6555b2e7ead4f75b221005/admin/jsonadm/src/Admin/JsonAdm.php#L60-L107
train
techdivision/import-product
src/Actions/Processors/StockItemUpdateProcessor.php
StockItemUpdateProcessor.execute
public function execute($row, $name = null) { // load the field names $keys = array_keys($row); // create a unique name for the prepared statement $name = sprintf('%s-%s', $name, md5(implode('-', $keys))); // query whether or not the statement has been prepared if (!$this->hasPreparedStatement($name)) { // initialize the array for the primary key fields $pks = array(); // load the last value as PK from the array with the keys $pks[] = $keys[array_search(MemberNames::ITEM_ID, $keys, true)]; // remove the entity status and the primary key from the keys unset($keys[array_search(MemberNames::ITEM_ID, $keys, true)]); unset($keys[array_search(EntityStatus::MEMBER_NAME, $keys, true)]); // prepare the SET part of the SQL statement array_walk($keys, function (&$value, $key) { $value = sprintf('%s=:%s', $value, $value); }); // prepare the SET part of the SQL statement array_walk($pks, function (&$value, $key) { $value = sprintf('%s=:%s', $value, $value); }); // create the prepared UPDATE statement $statement = sprintf($this->loadStatement(SqlStatementKeys::UPDATE_STOCK_ITEM), implode(',', $keys), implode(',', $pks)); // prepare the statement $this->addPreparedStatement($name, $this->getConnection()->prepare($statement)); } // pass the call to the parent method return parent::execute($row, $name); }
php
public function execute($row, $name = null) { // load the field names $keys = array_keys($row); // create a unique name for the prepared statement $name = sprintf('%s-%s', $name, md5(implode('-', $keys))); // query whether or not the statement has been prepared if (!$this->hasPreparedStatement($name)) { // initialize the array for the primary key fields $pks = array(); // load the last value as PK from the array with the keys $pks[] = $keys[array_search(MemberNames::ITEM_ID, $keys, true)]; // remove the entity status and the primary key from the keys unset($keys[array_search(MemberNames::ITEM_ID, $keys, true)]); unset($keys[array_search(EntityStatus::MEMBER_NAME, $keys, true)]); // prepare the SET part of the SQL statement array_walk($keys, function (&$value, $key) { $value = sprintf('%s=:%s', $value, $value); }); // prepare the SET part of the SQL statement array_walk($pks, function (&$value, $key) { $value = sprintf('%s=:%s', $value, $value); }); // create the prepared UPDATE statement $statement = sprintf($this->loadStatement(SqlStatementKeys::UPDATE_STOCK_ITEM), implode(',', $keys), implode(',', $pks)); // prepare the statement $this->addPreparedStatement($name, $this->getConnection()->prepare($statement)); } // pass the call to the parent method return parent::execute($row, $name); }
[ "public", "function", "execute", "(", "$", "row", ",", "$", "name", "=", "null", ")", "{", "// load the field names", "$", "keys", "=", "array_keys", "(", "$", "row", ")", ";", "// create a unique name for the prepared statement", "$", "name", "=", "sprintf", ...
Implements the CRUD functionality the processor is responsible for, can be one of CREATE, READ, UPDATE or DELETE a entity. @param array $row The data to handle @param string|null $name The name of the prepared statement to execute @return void
[ "Implements", "the", "CRUD", "functionality", "the", "processor", "is", "responsible", "for", "can", "be", "one", "of", "CREATE", "READ", "UPDATE", "or", "DELETE", "a", "entity", "." ]
a596e0c4b0495c918139935a709815c739d61e95
https://github.com/techdivision/import-product/blob/a596e0c4b0495c918139935a709815c739d61e95/src/Actions/Processors/StockItemUpdateProcessor.php#L49-L88
train
OXID-eSales/paymorrow-module
core/oxpspaymorrowresourcecache.php
OxpsPaymorrowResourceCache.push
public function push( $sFileName, $mFileContent ) { $sPath = $this->_getCacheFilePath( $sFileName ); if ( is_null( $sPath ) ) { return false; } return file_put_contents( $sPath, serialize( $mFileContent ) ); }
php
public function push( $sFileName, $mFileContent ) { $sPath = $this->_getCacheFilePath( $sFileName ); if ( is_null( $sPath ) ) { return false; } return file_put_contents( $sPath, serialize( $mFileContent ) ); }
[ "public", "function", "push", "(", "$", "sFileName", ",", "$", "mFileContent", ")", "{", "$", "sPath", "=", "$", "this", "->", "_getCacheFilePath", "(", "$", "sFileName", ")", ";", "if", "(", "is_null", "(", "$", "sPath", ")", ")", "{", "return", "fa...
Save file to cache. @param string $sFileName @param mixed $mFileContent @return bool|int
[ "Save", "file", "to", "cache", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorrowresourcecache.php#L107-L116
train
OXID-eSales/paymorrow-module
core/oxpspaymorrowresourcecache.php
OxpsPaymorrowResourceCache.pop
public function pop( $sFileName ) { $sPath = $this->_getCacheFilePath( $sFileName ); if ( is_null( $sPath ) ) { return false; } if ( $this->_expired( $sPath ) ) { @unlink( $sPath ); return false; } return unserialize( file_get_contents( $sPath ) ); }
php
public function pop( $sFileName ) { $sPath = $this->_getCacheFilePath( $sFileName ); if ( is_null( $sPath ) ) { return false; } if ( $this->_expired( $sPath ) ) { @unlink( $sPath ); return false; } return unserialize( file_get_contents( $sPath ) ); }
[ "public", "function", "pop", "(", "$", "sFileName", ")", "{", "$", "sPath", "=", "$", "this", "->", "_getCacheFilePath", "(", "$", "sFileName", ")", ";", "if", "(", "is_null", "(", "$", "sPath", ")", ")", "{", "return", "false", ";", "}", "if", "("...
Get file from cache. @param string $sFileName @return bool|mixed
[ "Get", "file", "from", "cache", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorrowresourcecache.php#L125-L140
train
OXID-eSales/paymorrow-module
core/oxpspaymorrowresourcecache.php
OxpsPaymorrowResourceCache._getCacheFilePath
protected function _getCacheFilePath( $sFileName = '' ) { $sTmpDirFullPath = realpath( oxRegistry::getConfig()->getConfigParam( 'sCompileDir' ) ); $sResourceCacheFolderName = $this->getCacheFolder(); $sResourceCachePath = $sTmpDirFullPath . DIRECTORY_SEPARATOR . $sResourceCacheFolderName; // Try to create resource cache folder if it does not exist if ( !is_dir( $sResourceCachePath ) ) { @mkdir( $sResourceCachePath, 0777 ); } if ( !is_dir( $sResourceCachePath ) ) { return null; } return empty( $sFileName ) ? $sResourceCachePath : $sResourceCachePath . DIRECTORY_SEPARATOR . basename( $sFileName ); }
php
protected function _getCacheFilePath( $sFileName = '' ) { $sTmpDirFullPath = realpath( oxRegistry::getConfig()->getConfigParam( 'sCompileDir' ) ); $sResourceCacheFolderName = $this->getCacheFolder(); $sResourceCachePath = $sTmpDirFullPath . DIRECTORY_SEPARATOR . $sResourceCacheFolderName; // Try to create resource cache folder if it does not exist if ( !is_dir( $sResourceCachePath ) ) { @mkdir( $sResourceCachePath, 0777 ); } if ( !is_dir( $sResourceCachePath ) ) { return null; } return empty( $sFileName ) ? $sResourceCachePath : $sResourceCachePath . DIRECTORY_SEPARATOR . basename( $sFileName ); }
[ "protected", "function", "_getCacheFilePath", "(", "$", "sFileName", "=", "''", ")", "{", "$", "sTmpDirFullPath", "=", "realpath", "(", "oxRegistry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'sCompileDir'", ")", ")", ";", "$", "sResourceCache...
Get full path to a file inside resource cache folder. @param string $sFileName If empty, full path to resource cache folder is returned @return null|string Null if resource cache folder is not available, full path string on success.
[ "Get", "full", "path", "to", "a", "file", "inside", "resource", "cache", "folder", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorrowresourcecache.php#L158-L176
train
OXID-eSales/paymorrow-module
core/oxpspaymorrowresourcecache.php
OxpsPaymorrowResourceCache._expired
protected function _expired( $sFilePath ) { return ( !is_file( $sFilePath ) or ( filemtime( $sFilePath ) - 1000 <= strtotime( sprintf( 'now - %d second', $this->getCacheTtl() ) ) ) ); }
php
protected function _expired( $sFilePath ) { return ( !is_file( $sFilePath ) or ( filemtime( $sFilePath ) - 1000 <= strtotime( sprintf( 'now - %d second', $this->getCacheTtl() ) ) ) ); }
[ "protected", "function", "_expired", "(", "$", "sFilePath", ")", "{", "return", "(", "!", "is_file", "(", "$", "sFilePath", ")", "or", "(", "filemtime", "(", "$", "sFilePath", ")", "-", "1000", "<=", "strtotime", "(", "sprintf", "(", "'now - %d second'", ...
Check if file exists and was created not too long ago. @param string $sFilePath @return bool False if file is missing or is too old/expired, True otherwise.
[ "Check", "if", "file", "exists", "and", "was", "created", "not", "too", "long", "ago", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorrowresourcecache.php#L185-L191
train
odan/csrf
src/CsrfMiddleware.php
CsrfMiddleware.process
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $tokenValue = $this->getToken(); $this->validate($request, $tokenValue); // Attach Request Attributes $request = $request->withAttribute('csrf_token', $tokenValue); /* @var Response $response */ $response = $handler->handle($request); return $this->injectTokenToResponse($response, $tokenValue); }
php
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $tokenValue = $this->getToken(); $this->validate($request, $tokenValue); // Attach Request Attributes $request = $request->withAttribute('csrf_token', $tokenValue); /* @var Response $response */ $response = $handler->handle($request); return $this->injectTokenToResponse($response, $tokenValue); }
[ "public", "function", "process", "(", "ServerRequestInterface", "$", "request", ",", "RequestHandlerInterface", "$", "handler", ")", ":", "ResponseInterface", "{", "$", "tokenValue", "=", "$", "this", "->", "getToken", "(", ")", ";", "$", "this", "->", "valida...
Invoke middleware. @param ServerRequestInterface $request The request @param RequestHandlerInterface $handler The handler @return ResponseInterface The response
[ "Invoke", "middleware", "." ]
3022e03f610c7411b5ee6bc40e8560a5f56c169e
https://github.com/odan/csrf/blob/3022e03f610c7411b5ee6bc40e8560a5f56c169e/src/CsrfMiddleware.php#L72-L85
train
odan/csrf
src/CsrfMiddleware.php
CsrfMiddleware.setSessionId
public function setSessionId(string $sessionId): void { if (empty($sessionId)) { throw new RuntimeException('CSRF middleware failed. SessionId not found!'); } $this->sessionId = $sessionId; }
php
public function setSessionId(string $sessionId): void { if (empty($sessionId)) { throw new RuntimeException('CSRF middleware failed. SessionId not found!'); } $this->sessionId = $sessionId; }
[ "public", "function", "setSessionId", "(", "string", "$", "sessionId", ")", ":", "void", "{", "if", "(", "empty", "(", "$", "sessionId", ")", ")", "{", "throw", "new", "RuntimeException", "(", "'CSRF middleware failed. SessionId not found!'", ")", ";", "}", "$...
Set session id. @param string $sessionId the session id
[ "Set", "session", "id", "." ]
3022e03f610c7411b5ee6bc40e8560a5f56c169e
https://github.com/odan/csrf/blob/3022e03f610c7411b5ee6bc40e8560a5f56c169e/src/CsrfMiddleware.php#L92-L99
train
odan/csrf
src/CsrfMiddleware.php
CsrfMiddleware.injectTokenToResponse
private function injectTokenToResponse(ResponseInterface $response, string $tokenValue): ResponseInterface { // Check if response is html $contentTypes = $response->getHeader('content-type'); $contentType = reset($contentTypes) ?: ''; if (strpos($contentType, 'text/html') === false) { return $response; } $content = $response->getBody()->__toString(); if ($this->protectForms) { $content = $this->injectFormHiddenFieldToResponse($content, $tokenValue); } if ($this->protectJqueryAjax) { $content = $this->injectJqueryToResponse($content, $tokenValue); } return $response->withBody($this->streamFactory->createStream($content)); }
php
private function injectTokenToResponse(ResponseInterface $response, string $tokenValue): ResponseInterface { // Check if response is html $contentTypes = $response->getHeader('content-type'); $contentType = reset($contentTypes) ?: ''; if (strpos($contentType, 'text/html') === false) { return $response; } $content = $response->getBody()->__toString(); if ($this->protectForms) { $content = $this->injectFormHiddenFieldToResponse($content, $tokenValue); } if ($this->protectJqueryAjax) { $content = $this->injectJqueryToResponse($content, $tokenValue); } return $response->withBody($this->streamFactory->createStream($content)); }
[ "private", "function", "injectTokenToResponse", "(", "ResponseInterface", "$", "response", ",", "string", "$", "tokenValue", ")", ":", "ResponseInterface", "{", "// Check if response is html", "$", "contentTypes", "=", "$", "response", "->", "getHeader", "(", "'conten...
Inject token to response object. @param ResponseInterface $response the response @param string $tokenValue token value @throws RuntimeException @return ResponseInterface the response
[ "Inject", "token", "to", "response", "object", "." ]
3022e03f610c7411b5ee6bc40e8560a5f56c169e
https://github.com/odan/csrf/blob/3022e03f610c7411b5ee6bc40e8560a5f56c169e/src/CsrfMiddleware.php#L222-L242
train
odan/csrf
src/CsrfMiddleware.php
CsrfMiddleware.injectFormHiddenFieldToResponse
private function injectFormHiddenFieldToResponse(string $body, string $tokenValue): string { $regex = '/(<form\b[^>]*>)(.*?)(<\/form>)/is'; $htmlHiddenField = sprintf('$1<input type="hidden" name="%s" value="%s">$2$3', $this->name, $tokenValue); $body = preg_replace($regex, $htmlHiddenField, $body); return (string)$body; }
php
private function injectFormHiddenFieldToResponse(string $body, string $tokenValue): string { $regex = '/(<form\b[^>]*>)(.*?)(<\/form>)/is'; $htmlHiddenField = sprintf('$1<input type="hidden" name="%s" value="%s">$2$3', $this->name, $tokenValue); $body = preg_replace($regex, $htmlHiddenField, $body); return (string)$body; }
[ "private", "function", "injectFormHiddenFieldToResponse", "(", "string", "$", "body", ",", "string", "$", "tokenValue", ")", ":", "string", "{", "$", "regex", "=", "'/(<form\\b[^>]*>)(.*?)(<\\/form>)/is'", ";", "$", "htmlHiddenField", "=", "sprintf", "(", "'$1<input...
Inject hidden field. @param string $body body @param string $tokenValue token @return string html
[ "Inject", "hidden", "field", "." ]
3022e03f610c7411b5ee6bc40e8560a5f56c169e
https://github.com/odan/csrf/blob/3022e03f610c7411b5ee6bc40e8560a5f56c169e/src/CsrfMiddleware.php#L252-L259
train
odan/csrf
src/CsrfMiddleware.php
CsrfMiddleware.injectJqueryToResponse
private function injectJqueryToResponse(string $body, string $tokenValue): string { $regex = '/(.*?)(<\/body>)/is'; $jQueryCode = sprintf( '<script>$.ajaxSetup({beforeSend: function (xhr) { xhr.setRequestHeader("X-CSRF-Token","%s"); }});</script>', $tokenValue ); $body = preg_replace($regex, '$1' . $jQueryCode . '$2', $body, -1, $count) ?? ''; if (!$count) { // Inject JS code anyway $body .= $jQueryCode; } return $body; }
php
private function injectJqueryToResponse(string $body, string $tokenValue): string { $regex = '/(.*?)(<\/body>)/is'; $jQueryCode = sprintf( '<script>$.ajaxSetup({beforeSend: function (xhr) { xhr.setRequestHeader("X-CSRF-Token","%s"); }});</script>', $tokenValue ); $body = preg_replace($regex, '$1' . $jQueryCode . '$2', $body, -1, $count) ?? ''; if (!$count) { // Inject JS code anyway $body .= $jQueryCode; } return $body; }
[ "private", "function", "injectJqueryToResponse", "(", "string", "$", "body", ",", "string", "$", "tokenValue", ")", ":", "string", "{", "$", "regex", "=", "'/(.*?)(<\\/body>)/is'", ";", "$", "jQueryCode", "=", "sprintf", "(", "'<script>$.ajaxSetup({beforeSend: funct...
Inject jquery code. @param string $body body data @param string $tokenValue token value @return string html
[ "Inject", "jquery", "code", "." ]
3022e03f610c7411b5ee6bc40e8560a5f56c169e
https://github.com/odan/csrf/blob/3022e03f610c7411b5ee6bc40e8560a5f56c169e/src/CsrfMiddleware.php#L269-L284
train
OXID-eSales/paymorrow-module
core/oxpsoxid2paymorrow.php
OxpsOxid2Paymorrow.getBuiltPaymorrowResourceProxy
public function getBuiltPaymorrowResourceProxy() { /** @var $oPmResourceProxy PaymorrowResourceProxy */ $oPmResourceProxy = oxNew( 'PaymorrowResourceProxy' ); $oPmSettings = $this->getPaymorrowSettings(); $oPmResourceProxy->setMerchantId( $oPmSettings->getMerchantId() ); $oPmResourceProxy->setEndPointUrl( $oPmSettings->getPaymorrowResourcePath() ); return $oPmResourceProxy; }
php
public function getBuiltPaymorrowResourceProxy() { /** @var $oPmResourceProxy PaymorrowResourceProxy */ $oPmResourceProxy = oxNew( 'PaymorrowResourceProxy' ); $oPmSettings = $this->getPaymorrowSettings(); $oPmResourceProxy->setMerchantId( $oPmSettings->getMerchantId() ); $oPmResourceProxy->setEndPointUrl( $oPmSettings->getPaymorrowResourcePath() ); return $oPmResourceProxy; }
[ "public", "function", "getBuiltPaymorrowResourceProxy", "(", ")", "{", "/** @var $oPmResourceProxy PaymorrowResourceProxy */", "$", "oPmResourceProxy", "=", "oxNew", "(", "'PaymorrowResourceProxy'", ")", ";", "$", "oPmSettings", "=", "$", "this", "->", "getPaymorrowSetting...
Get built resource proxy with merchant and endpoint url set. @return PaymorrowResourceProxy
[ "Get", "built", "resource", "proxy", "with", "merchant", "and", "endpoint", "url", "set", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpsoxid2paymorrow.php#L95-L106
train
OXID-eSales/paymorrow-module
core/oxpsoxid2paymorrow.php
OxpsOxid2Paymorrow.buildPaymorrowGateway
public function buildPaymorrowGateway() { $oPmGateway = $this->getPaymorrowGateway(); $oPmGateway->setPmClient( $this->getPaymorrowClient() ); $oPmGateway->setEshopDataProvider( $this->getEshopDataProvider() ); $oPmGateway->setEndPointUrl( $this->getPaymorrowSettings()->getEndPointURL() ); /** * Using singleton pattern in order to get access to this object later * and check response from Paymorrow */ $oPmGateway->setResponseHandler( oxRegistry::get( 'OxpsPaymorrowResponseHandler' ) ); return $oPmGateway; }
php
public function buildPaymorrowGateway() { $oPmGateway = $this->getPaymorrowGateway(); $oPmGateway->setPmClient( $this->getPaymorrowClient() ); $oPmGateway->setEshopDataProvider( $this->getEshopDataProvider() ); $oPmGateway->setEndPointUrl( $this->getPaymorrowSettings()->getEndPointURL() ); /** * Using singleton pattern in order to get access to this object later * and check response from Paymorrow */ $oPmGateway->setResponseHandler( oxRegistry::get( 'OxpsPaymorrowResponseHandler' ) ); return $oPmGateway; }
[ "public", "function", "buildPaymorrowGateway", "(", ")", "{", "$", "oPmGateway", "=", "$", "this", "->", "getPaymorrowGateway", "(", ")", ";", "$", "oPmGateway", "->", "setPmClient", "(", "$", "this", "->", "getPaymorrowClient", "(", ")", ")", ";", "$", "o...
Get initialized Paymorrow gateway instance. @return OxpsPaymorrowGateway
[ "Get", "initialized", "Paymorrow", "gateway", "instance", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpsoxid2paymorrow.php#L125-L139
train
OXID-eSales/paymorrow-module
core/oxpsoxid2paymorrow.php
OxpsOxid2Paymorrow.getBuiltPaymorrowRequestController
public function getBuiltPaymorrowRequestController() { $oPmRequestController = $this->getPaymorrowRequestController(); $oPmGateway = $this->buildPaymorrowGateway(); $oPmRequestController->setGateway( $oPmGateway ); return $oPmRequestController; }
php
public function getBuiltPaymorrowRequestController() { $oPmRequestController = $this->getPaymorrowRequestController(); $oPmGateway = $this->buildPaymorrowGateway(); $oPmRequestController->setGateway( $oPmGateway ); return $oPmRequestController; }
[ "public", "function", "getBuiltPaymorrowRequestController", "(", ")", "{", "$", "oPmRequestController", "=", "$", "this", "->", "getPaymorrowRequestController", "(", ")", ";", "$", "oPmGateway", "=", "$", "this", "->", "buildPaymorrowGateway", "(", ")", ";", "$", ...
Get built Paymorrow request controller with Paymorrow gateway set. @return RequestController
[ "Get", "built", "Paymorrow", "request", "controller", "with", "Paymorrow", "gateway", "set", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpsoxid2paymorrow.php#L146-L155
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorrowprepareorder.php
OxpsPaymorrowPrepareOrder.prepareOrder
public function prepareOrder() { $this->setPaymorrowPaymentMethodId(); /** @var OxpsPaymorrowRequestControllerProxy $pmGateWay */ $pmGateWay = oxNew('OxpsPaymorrowRequestControllerProxy'); $oUtils = oxRegistry::getUtils(); $oUtils->setHeader("Content-Type: application/json"); $oUtils->showMessageAndExit($pmGateWay->prepareOrder($_POST)); }
php
public function prepareOrder() { $this->setPaymorrowPaymentMethodId(); /** @var OxpsPaymorrowRequestControllerProxy $pmGateWay */ $pmGateWay = oxNew('OxpsPaymorrowRequestControllerProxy'); $oUtils = oxRegistry::getUtils(); $oUtils->setHeader("Content-Type: application/json"); $oUtils->showMessageAndExit($pmGateWay->prepareOrder($_POST)); }
[ "public", "function", "prepareOrder", "(", ")", "{", "$", "this", "->", "setPaymorrowPaymentMethodId", "(", ")", ";", "/** @var OxpsPaymorrowRequestControllerProxy $pmGateWay */", "$", "pmGateWay", "=", "oxNew", "(", "'OxpsPaymorrowRequestControllerProxy'", ")", ";", "$",...
Paymorrow function for Verifying Form Data against Paymorrow Services. Also set selected payment method ID revealed by Paymorrow payment method name.
[ "Paymorrow", "function", "for", "Verifying", "Form", "Data", "against", "Paymorrow", "Services", ".", "Also", "set", "selected", "payment", "method", "ID", "revealed", "by", "Paymorrow", "payment", "method", "name", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorrowprepareorder.php#L54-L64
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorrowprepareorder.php
OxpsPaymorrowPrepareOrder.setPaymorrowPaymentMethodId
protected function setPaymorrowPaymentMethodId() { /** @var oxPayment|OxpsPaymorrowOxPayment $payment */ $payment = oxNew('oxPayment'); $paymentIdField = self::OXPS_PAYMENT_ID_FIELD; $paymentName = (string) $this->getConfig()->getRequestParameter(self::OXPS_PM_PAYMENT_NAME_FIELD); if ($payment->loadByPaymorrowName($paymentName) and !$this->getConfig()->getRequestParameter($paymentIdField) ) { $this->appendPostData(array($paymentIdField => (string) $payment->getId())); } }
php
protected function setPaymorrowPaymentMethodId() { /** @var oxPayment|OxpsPaymorrowOxPayment $payment */ $payment = oxNew('oxPayment'); $paymentIdField = self::OXPS_PAYMENT_ID_FIELD; $paymentName = (string) $this->getConfig()->getRequestParameter(self::OXPS_PM_PAYMENT_NAME_FIELD); if ($payment->loadByPaymorrowName($paymentName) and !$this->getConfig()->getRequestParameter($paymentIdField) ) { $this->appendPostData(array($paymentIdField => (string) $payment->getId())); } }
[ "protected", "function", "setPaymorrowPaymentMethodId", "(", ")", "{", "/** @var oxPayment|OxpsPaymorrowOxPayment $payment */", "$", "payment", "=", "oxNew", "(", "'oxPayment'", ")", ";", "$", "paymentIdField", "=", "self", "::", "OXPS_PAYMENT_ID_FIELD", ";", "$", "paym...
Load payment instance by Paymorrow payment method name and set it to both, request and session if not yet set.
[ "Load", "payment", "instance", "by", "Paymorrow", "payment", "method", "name", "and", "set", "it", "to", "both", "request", "and", "session", "if", "not", "yet", "set", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorrowprepareorder.php#L71-L83
train
OXID-eSales/paymorrow-module
components/widgets/oxpspaymorrowinit.php
OxpsPaymorrowInit.getPaymorrowJavaScriptPmInitFull
public function getPaymorrowJavaScriptPmInitFull() { $sPmPrintData = $this->_getPaymorrowPrintData(); $sPmControllerPrepareOrder = $this->getPaymorrowControllerPrepareOrderProcessPaymentURL(); $sSelectedMethod = $this->getSelectedPaymorrowMethod(); $sNextButtonId = 'paymentNextStepBottom'; $sSDD = sprintf( 'pmInitFull("SDD", "pmsdd", "rb_payment_sdd", "dl_payment_sdd", "payment", %s, "%s", %s, "%s");', $sPmPrintData, $sPmControllerPrepareOrder, ($sSelectedMethod == 'pm_sdd') ? 'true' : 'false', $sNextButtonId ); $sInvoice = sprintf( 'pmInitFull("INVOICE", "pminvoice", "rb_payment_invoice", "dl_payment_invoice", "payment", %s, "%s", %s, "%s");', $sPmPrintData, $sPmControllerPrepareOrder, ($sSelectedMethod == 'pm_invoice') ? 'true' : 'false', $sNextButtonId ); return sprintf('$(document).ready(function(){%s%s});', $sSDD, $sInvoice); }
php
public function getPaymorrowJavaScriptPmInitFull() { $sPmPrintData = $this->_getPaymorrowPrintData(); $sPmControllerPrepareOrder = $this->getPaymorrowControllerPrepareOrderProcessPaymentURL(); $sSelectedMethod = $this->getSelectedPaymorrowMethod(); $sNextButtonId = 'paymentNextStepBottom'; $sSDD = sprintf( 'pmInitFull("SDD", "pmsdd", "rb_payment_sdd", "dl_payment_sdd", "payment", %s, "%s", %s, "%s");', $sPmPrintData, $sPmControllerPrepareOrder, ($sSelectedMethod == 'pm_sdd') ? 'true' : 'false', $sNextButtonId ); $sInvoice = sprintf( 'pmInitFull("INVOICE", "pminvoice", "rb_payment_invoice", "dl_payment_invoice", "payment", %s, "%s", %s, "%s");', $sPmPrintData, $sPmControllerPrepareOrder, ($sSelectedMethod == 'pm_invoice') ? 'true' : 'false', $sNextButtonId ); return sprintf('$(document).ready(function(){%s%s});', $sSDD, $sInvoice); }
[ "public", "function", "getPaymorrowJavaScriptPmInitFull", "(", ")", "{", "$", "sPmPrintData", "=", "$", "this", "->", "_getPaymorrowPrintData", "(", ")", ";", "$", "sPmControllerPrepareOrder", "=", "$", "this", "->", "getPaymorrowControllerPrepareOrderProcessPaymentURL", ...
Returns a JavaScript with Paymorrow payment methods initialization functions wrapped in document.ready. @nice-to-have Use a template for JS generation rather than doing in within PHP. @return string
[ "Returns", "a", "JavaScript", "with", "Paymorrow", "payment", "methods", "initialization", "functions", "wrapped", "in", "document", ".", "ready", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/components/widgets/oxpspaymorrowinit.php#L84-L108
train
OXID-eSales/paymorrow-module
components/widgets/oxpspaymorrowinit.php
OxpsPaymorrowInit.getSelectedPaymorrowMethod
public function getSelectedPaymorrowMethod() { $sSessionPaymentId = (string) oxRegistry::getSession()->getVariable( 'paymentid' ); /** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */ $oPayment = oxNew( 'OxpsPaymorrowOxPayment' ); if ( empty( $sSessionPaymentId ) or !$oPayment->load( $sSessionPaymentId ) or !$oPayment->isPaymorrowActiveAndMapped() ) { $oPayment->loadPaymorrowDefault(); } return (string) $oPayment->getPaymorrowPaymentType(); }
php
public function getSelectedPaymorrowMethod() { $sSessionPaymentId = (string) oxRegistry::getSession()->getVariable( 'paymentid' ); /** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */ $oPayment = oxNew( 'OxpsPaymorrowOxPayment' ); if ( empty( $sSessionPaymentId ) or !$oPayment->load( $sSessionPaymentId ) or !$oPayment->isPaymorrowActiveAndMapped() ) { $oPayment->loadPaymorrowDefault(); } return (string) $oPayment->getPaymorrowPaymentType(); }
[ "public", "function", "getSelectedPaymorrowMethod", "(", ")", "{", "$", "sSessionPaymentId", "=", "(", "string", ")", "oxRegistry", "::", "getSession", "(", ")", "->", "getVariable", "(", "'paymentid'", ")", ";", "/** @var OxpsPaymorrowOxPayment|oxPayment $oPayment */",...
Get a code of selected Paymorrow payment method. First session is checked for what user have selected, then payment methods configuration is checked. It applies only on payment methods linked to Paymorrow. @return string Paymorrow payment method code or empty string.
[ "Get", "a", "code", "of", "selected", "Paymorrow", "payment", "method", ".", "First", "session", "is", "checked", "for", "what", "user", "have", "selected", "then", "payment", "methods", "configuration", "is", "checked", ".", "It", "applies", "only", "on", "...
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/components/widgets/oxpspaymorrowinit.php#L117-L131
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasketitem.php
OxpsPaymorrowOxBasketItem.getProductNumber
public function getProductNumber() { /** @var $this OxpsPaymorrowOxBasketItem|oxBasketItem */ /** @var oxArticle $oArticle */ $oArticle = $this->getArticle(); return isset( $oArticle->oxarticles__oxartnum->value ) ? (string) $oArticle->oxarticles__oxartnum->value : ''; }
php
public function getProductNumber() { /** @var $this OxpsPaymorrowOxBasketItem|oxBasketItem */ /** @var oxArticle $oArticle */ $oArticle = $this->getArticle(); return isset( $oArticle->oxarticles__oxartnum->value ) ? (string) $oArticle->oxarticles__oxartnum->value : ''; }
[ "public", "function", "getProductNumber", "(", ")", "{", "/** @var $this OxpsPaymorrowOxBasketItem|oxBasketItem */", "/** @var oxArticle $oArticle */", "$", "oArticle", "=", "$", "this", "->", "getArticle", "(", ")", ";", "return", "isset", "(", "$", "oArticle", "->", ...
Get related article number. @return string
[ "Get", "related", "article", "number", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasketitem.php#L61-L69
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxbasketitem.php
OxpsPaymorrowOxBasketItem.getPaymorrowBasketItemSummary
public function getPaymorrowBasketItemSummary( $iLineItemCount ) { /** @var OxpsPaymorrowOxBasketItem|oxBasketItem $this */ $sPaymorrowLineItemPrefix = self::getPaymorrowBasketSummaryLineItemPrefix( $iLineItemCount ); return array( $sPaymorrowLineItemPrefix . 'quantity' => (double) $this->getAmount(), $sPaymorrowLineItemPrefix . 'articleId' => $this->_toUtf( $this->getProductNumber() ), $sPaymorrowLineItemPrefix . 'name' => $this->_toUtf( $this->getTitle(), 50 ), $sPaymorrowLineItemPrefix . 'type' => 'GOODS', $sPaymorrowLineItemPrefix . 'unitPriceGross' => (double) $this->getUnitPrice()->getBruttoPrice(), $sPaymorrowLineItemPrefix . 'grossAmount' => (double) $this->getPrice()->getBruttoPrice(), $sPaymorrowLineItemPrefix . 'vatAmount' => (double) $this->getPrice()->getVatValue(), $sPaymorrowLineItemPrefix . 'vatRate' => (double) $this->getVatPercent(), ); }
php
public function getPaymorrowBasketItemSummary( $iLineItemCount ) { /** @var OxpsPaymorrowOxBasketItem|oxBasketItem $this */ $sPaymorrowLineItemPrefix = self::getPaymorrowBasketSummaryLineItemPrefix( $iLineItemCount ); return array( $sPaymorrowLineItemPrefix . 'quantity' => (double) $this->getAmount(), $sPaymorrowLineItemPrefix . 'articleId' => $this->_toUtf( $this->getProductNumber() ), $sPaymorrowLineItemPrefix . 'name' => $this->_toUtf( $this->getTitle(), 50 ), $sPaymorrowLineItemPrefix . 'type' => 'GOODS', $sPaymorrowLineItemPrefix . 'unitPriceGross' => (double) $this->getUnitPrice()->getBruttoPrice(), $sPaymorrowLineItemPrefix . 'grossAmount' => (double) $this->getPrice()->getBruttoPrice(), $sPaymorrowLineItemPrefix . 'vatAmount' => (double) $this->getPrice()->getVatValue(), $sPaymorrowLineItemPrefix . 'vatRate' => (double) $this->getVatPercent(), ); }
[ "public", "function", "getPaymorrowBasketItemSummary", "(", "$", "iLineItemCount", ")", "{", "/** @var OxpsPaymorrowOxBasketItem|oxBasketItem $this */", "$", "sPaymorrowLineItemPrefix", "=", "self", "::", "getPaymorrowBasketSummaryLineItemPrefix", "(", "$", "iLineItemCount", ")",...
Compiles summary data array of basket item for Paymorrow. @param int $iLineItemCount @return array
[ "Compiles", "summary", "data", "array", "of", "basket", "item", "for", "Paymorrow", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxbasketitem.php#L78-L94
train
hostnet/accessor-generator-plugin-lib
src/Plugin.php
Plugin.getFilesAndReflectionClassesFromPackage
private function getFilesAndReflectionClassesFromPackage(PackageInterface $package) { $cache_id = $package->getName(); if (isset($this->metadata[$cache_id])) { return $this->metadata[$cache_id]; } $this->metadata[$cache_id] = []; foreach ($this->getFilesForPackage($package) as $filename) { $filename = (string) $filename; if (isset($this->metadata[$cache_id][$filename])) { continue; } $this->metadata[$cache_id][$filename] = new ReflectionClass($filename); } return $this->metadata[$package->getName()]; }
php
private function getFilesAndReflectionClassesFromPackage(PackageInterface $package) { $cache_id = $package->getName(); if (isset($this->metadata[$cache_id])) { return $this->metadata[$cache_id]; } $this->metadata[$cache_id] = []; foreach ($this->getFilesForPackage($package) as $filename) { $filename = (string) $filename; if (isset($this->metadata[$cache_id][$filename])) { continue; } $this->metadata[$cache_id][$filename] = new ReflectionClass($filename); } return $this->metadata[$package->getName()]; }
[ "private", "function", "getFilesAndReflectionClassesFromPackage", "(", "PackageInterface", "$", "package", ")", "{", "$", "cache_id", "=", "$", "package", "->", "getName", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "metadata", "[", "$", "cach...
Returns a key-value array of ReflectionClass instances for all the file names found in the given package. This method returns a cached instance when executed more than once for the same package. @param PackageInterface $package @return mixed @throws Reflection\Exception\FileException
[ "Returns", "a", "key", "-", "value", "array", "of", "ReflectionClass", "instances", "for", "all", "the", "file", "names", "found", "in", "the", "given", "package", ".", "This", "method", "returns", "a", "cached", "instance", "when", "executed", "more", "than...
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/Plugin.php#L214-L233
train
hostnet/accessor-generator-plugin-lib
src/Plugin.php
Plugin.getFilesForPackage
private function getFilesForPackage(PackageInterface $package) { if ($package instanceof RootPackageInterface) { $path = '.'; } else { $path = $this->composer->getInstallationManager()->getInstallPath($package); } $path .= '/src'; $finder = new Finder(); return $finder ->ignoreVCS(true) ->ignoreDotFiles(true) ->exclude(['Generated']) ->name('*.php') ->in($path) ->getIterator(); }
php
private function getFilesForPackage(PackageInterface $package) { if ($package instanceof RootPackageInterface) { $path = '.'; } else { $path = $this->composer->getInstallationManager()->getInstallPath($package); } $path .= '/src'; $finder = new Finder(); return $finder ->ignoreVCS(true) ->ignoreDotFiles(true) ->exclude(['Generated']) ->name('*.php') ->in($path) ->getIterator(); }
[ "private", "function", "getFilesForPackage", "(", "PackageInterface", "$", "package", ")", "{", "if", "(", "$", "package", "instanceof", "RootPackageInterface", ")", "{", "$", "path", "=", "'.'", ";", "}", "else", "{", "$", "path", "=", "$", "this", "->", ...
Find all the PHP files within a package. Excludes - all files in VCS directories - all files in vendor folders - all files in Generated folders - all hidden files @throws \LogicException @throws \InvalidArgumentException @param PackageInterface $package @return \Iterator|\SplFileInfo[]
[ "Find", "all", "the", "PHP", "files", "within", "a", "package", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/Plugin.php#L250-L268
train
techdivision/import-product
src/Observers/ProductInventoryUpdateObserver.php
ProductInventoryUpdateObserver.initializeStockItem
protected function initializeStockItem(array $attr) { // load the stock item with the passed item/product/stock ID $entity = $this->loadStockItem( $attr[MemberNames::PRODUCT_ID], $attr[MemberNames::WEBSITE_ID], $attr[MemberNames::STOCK_ID] ); // merge the attributes with the entity, if available if ($entity) { return $this->mergeEntity($entity, $attr); } // otherwise simply return the attributes return $attr; }
php
protected function initializeStockItem(array $attr) { // load the stock item with the passed item/product/stock ID $entity = $this->loadStockItem( $attr[MemberNames::PRODUCT_ID], $attr[MemberNames::WEBSITE_ID], $attr[MemberNames::STOCK_ID] ); // merge the attributes with the entity, if available if ($entity) { return $this->mergeEntity($entity, $attr); } // otherwise simply return the attributes return $attr; }
[ "protected", "function", "initializeStockItem", "(", "array", "$", "attr", ")", "{", "// load the stock item with the passed item/product/stock ID", "$", "entity", "=", "$", "this", "->", "loadStockItem", "(", "$", "attr", "[", "MemberNames", "::", "PRODUCT_ID", "]", ...
Initialize the stock item with the passed attributes and returns an instance. @param array $attr The stock item attributes @return array The initialized stock item
[ "Initialize", "the", "stock", "item", "with", "the", "passed", "attributes", "and", "returns", "an", "instance", "." ]
a596e0c4b0495c918139935a709815c739d61e95
https://github.com/techdivision/import-product/blob/a596e0c4b0495c918139935a709815c739d61e95/src/Observers/ProductInventoryUpdateObserver.php#L44-L61
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser.getUserPaymorrowDateOfBirth
public function getUserPaymorrowDateOfBirth( $blSplit = false ) { $mDate = $this->oxuser__oxbirthdate->value; if ( !empty( $blSplit ) ) { $aDate = explode( '-', $mDate ); $mDate = array( $this->_getDateComponentAsInteger( $aDate, 0, '0000' ), $this->_getDateComponentAsInteger( $aDate, 1 ), $this->_getDateComponentAsInteger( $aDate, 2 ), ); } return $mDate; }
php
public function getUserPaymorrowDateOfBirth( $blSplit = false ) { $mDate = $this->oxuser__oxbirthdate->value; if ( !empty( $blSplit ) ) { $aDate = explode( '-', $mDate ); $mDate = array( $this->_getDateComponentAsInteger( $aDate, 0, '0000' ), $this->_getDateComponentAsInteger( $aDate, 1 ), $this->_getDateComponentAsInteger( $aDate, 2 ), ); } return $mDate; }
[ "public", "function", "getUserPaymorrowDateOfBirth", "(", "$", "blSplit", "=", "false", ")", "{", "$", "mDate", "=", "$", "this", "->", "oxuser__oxbirthdate", "->", "value", ";", "if", "(", "!", "empty", "(", "$", "blSplit", ")", ")", "{", "$", "aDate", ...
Get user birth date. @param bool $blSplit If true return array with year, month, day, if false the date as string (default) @return string|array
[ "Get", "user", "birth", "date", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L80-L94
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser.getUserPaymorrowIpAddress
public function getUserPaymorrowIpAddress() { /** @var $oUtilsServer oxUtilsServer */ $oUtilsServer = oxRegistry::get( "oxUtilsServer" ); $sIpAddress = $oUtilsServer->getRemoteAddress(); return strpos( $sIpAddress, ':' ) ? $oUtilsServer->getServerVar( 'REMOTE_ADDR' ) : $sIpAddress; }
php
public function getUserPaymorrowIpAddress() { /** @var $oUtilsServer oxUtilsServer */ $oUtilsServer = oxRegistry::get( "oxUtilsServer" ); $sIpAddress = $oUtilsServer->getRemoteAddress(); return strpos( $sIpAddress, ':' ) ? $oUtilsServer->getServerVar( 'REMOTE_ADDR' ) : $sIpAddress; }
[ "public", "function", "getUserPaymorrowIpAddress", "(", ")", "{", "/** @var $oUtilsServer oxUtilsServer */", "$", "oUtilsServer", "=", "oxRegistry", "::", "get", "(", "\"oxUtilsServer\"", ")", ";", "$", "sIpAddress", "=", "$", "oUtilsServer", "->", "getRemoteAddress", ...
Get client remote IP address. For IPv6 got from utils, gets value from REMOTE_ADDR variable directly. @return string
[ "Get", "client", "remote", "IP", "address", ".", "For", "IPv6", "got", "from", "utils", "gets", "value", "from", "REMOTE_ADDR", "variable", "directly", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L154-L161
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser.getUserPaymorrowCountry
public function getUserPaymorrowCountry( $sCountryId = '' ) { /** @var oxCountry $oCountry */ $oCountry = oxNew( 'oxCountry' ); $oCountry->load( empty( $sCountryId ) ? $this->oxuser__oxcountryid->value : (string) $sCountryId ); return $oCountry->oxcountry__oxisoalpha2->value; }
php
public function getUserPaymorrowCountry( $sCountryId = '' ) { /** @var oxCountry $oCountry */ $oCountry = oxNew( 'oxCountry' ); $oCountry->load( empty( $sCountryId ) ? $this->oxuser__oxcountryid->value : (string) $sCountryId ); return $oCountry->oxcountry__oxisoalpha2->value; }
[ "public", "function", "getUserPaymorrowCountry", "(", "$", "sCountryId", "=", "''", ")", "{", "/** @var oxCountry $oCountry */", "$", "oCountry", "=", "oxNew", "(", "'oxCountry'", ")", ";", "$", "oCountry", "->", "load", "(", "empty", "(", "$", "sCountryId", "...
Get user billing address country code. @param string $sCountryId Optional country ID to load. If empty, default user billing country is loaded. @return string
[ "Get", "user", "billing", "address", "country", "code", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L288-L296
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser.getUserGroupNames
public function getUserGroupNames() { /** @var OxpsPaymorrowOxUser|oxUser $this */ /** @var oxList $oGroups */ if ( !( $oGroups = $this->getUserGroups() ) ) { return ''; } $aGroups = array(); foreach ( $oGroups as $oGroup ) { if ( $this->_isGroupValid( $oGroup ) ) { $aGroups[] = $oGroup->oxgroups__oxtitle->value; } } return implode( ', ', $aGroups ); }
php
public function getUserGroupNames() { /** @var OxpsPaymorrowOxUser|oxUser $this */ /** @var oxList $oGroups */ if ( !( $oGroups = $this->getUserGroups() ) ) { return ''; } $aGroups = array(); foreach ( $oGroups as $oGroup ) { if ( $this->_isGroupValid( $oGroup ) ) { $aGroups[] = $oGroup->oxgroups__oxtitle->value; } } return implode( ', ', $aGroups ); }
[ "public", "function", "getUserGroupNames", "(", ")", "{", "/** @var OxpsPaymorrowOxUser|oxUser $this */", "/** @var oxList $oGroups */", "if", "(", "!", "(", "$", "oGroups", "=", "$", "this", "->", "getUserGroups", "(", ")", ")", ")", "{", "return", "''", ";", "...
Get user group names as comma separated string. @return string
[ "Get", "user", "group", "names", "as", "comma", "separated", "string", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L353-L371
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser.mapDataAndSaveObject
public function mapDataAndSaveObject( array $aData, array $aMap, $oObject = null ) { if ( is_null( $oObject ) ) { $oObject = $this; } if ( $this->_mapDataFieldsToObject( $aData, $aMap, $oObject ) ) { return $oObject->save(); } return null; }
php
public function mapDataAndSaveObject( array $aData, array $aMap, $oObject = null ) { if ( is_null( $oObject ) ) { $oObject = $this; } if ( $this->_mapDataFieldsToObject( $aData, $aMap, $oObject ) ) { return $oObject->save(); } return null; }
[ "public", "function", "mapDataAndSaveObject", "(", "array", "$", "aData", ",", "array", "$", "aMap", ",", "$", "oObject", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "oObject", ")", ")", "{", "$", "oObject", "=", "$", "this", ";", "}", "...
Find and map object fields in data array, assign the values and save object. Updates only with not empty values and if values duffer from existing ones. @param array $aData @param array $aMap @param object|null $oObject @return bool|null
[ "Find", "and", "map", "object", "fields", "in", "data", "array", "assign", "the", "values", "and", "save", "object", ".", "Updates", "only", "with", "not", "empty", "values", "and", "if", "values", "duffer", "from", "existing", "ones", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L383-L394
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser._getDateComponentAsInteger
protected function _getDateComponentAsInteger( $aDate, $iKey, $sZeroString = '00' ) { if ( empty( $aDate[$iKey] ) or ( $aDate[$iKey] == $sZeroString ) ) { return 0; } return (int) $aDate[$iKey]; }
php
protected function _getDateComponentAsInteger( $aDate, $iKey, $sZeroString = '00' ) { if ( empty( $aDate[$iKey] ) or ( $aDate[$iKey] == $sZeroString ) ) { return 0; } return (int) $aDate[$iKey]; }
[ "protected", "function", "_getDateComponentAsInteger", "(", "$", "aDate", ",", "$", "iKey", ",", "$", "sZeroString", "=", "'00'", ")", "{", "if", "(", "empty", "(", "$", "aDate", "[", "$", "iKey", "]", ")", "or", "(", "$", "aDate", "[", "$", "iKey", ...
Get date component from an array by key as an integer. @param array $aDate Date components as array. @param int $iKey Date component index. @param string $sZeroString A zero representing string value, default is "00". @return int
[ "Get", "date", "component", "from", "an", "array", "by", "key", "as", "an", "integer", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L406-L413
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser._isGroupValid
protected function _isGroupValid( $oGroup ) { return ( !empty( $oGroup->oxgroups__oxactive->value ) and !empty( $oGroup->oxgroups__oxtitle->value ) ); }
php
protected function _isGroupValid( $oGroup ) { return ( !empty( $oGroup->oxgroups__oxactive->value ) and !empty( $oGroup->oxgroups__oxtitle->value ) ); }
[ "protected", "function", "_isGroupValid", "(", "$", "oGroup", ")", "{", "return", "(", "!", "empty", "(", "$", "oGroup", "->", "oxgroups__oxactive", "->", "value", ")", "and", "!", "empty", "(", "$", "oGroup", "->", "oxgroups__oxtitle", "->", "value", ")",...
Check if group is active and has non-empty title. @param object $oGroup @return bool
[ "Check", "if", "group", "is", "active", "and", "has", "non", "-", "empty", "title", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L422-L425
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser._mapDataFieldsToObject
protected function _mapDataFieldsToObject( array $aData, array $aMap, $oObject ) { $blValueSet = false; foreach ( $aData as $sKey => $mValue ) { $sValue = trim( (string) $mValue ); if ( $this->_isObjectFieldWithValidValue( $sKey, $sValue, $aMap, $oObject ) ) { $sField = $aMap[$sKey]; $oObject->$sField = new oxField( $sValue ); $blValueSet = true; } } return $blValueSet; }
php
protected function _mapDataFieldsToObject( array $aData, array $aMap, $oObject ) { $blValueSet = false; foreach ( $aData as $sKey => $mValue ) { $sValue = trim( (string) $mValue ); if ( $this->_isObjectFieldWithValidValue( $sKey, $sValue, $aMap, $oObject ) ) { $sField = $aMap[$sKey]; $oObject->$sField = new oxField( $sValue ); $blValueSet = true; } } return $blValueSet; }
[ "protected", "function", "_mapDataFieldsToObject", "(", "array", "$", "aData", ",", "array", "$", "aMap", ",", "$", "oObject", ")", "{", "$", "blValueSet", "=", "false", ";", "foreach", "(", "$", "aData", "as", "$", "sKey", "=>", "$", "mValue", ")", "{...
Check each data array field if it could be mapped to object and set the value if it is not empty and differ. @param array $aData @param array $aMap @param object $oObject @return bool True if at least one field updated, false otherwise.
[ "Check", "each", "data", "array", "field", "if", "it", "could", "be", "mapped", "to", "object", "and", "set", "the", "value", "if", "it", "is", "not", "empty", "and", "differ", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L436-L451
train
OXID-eSales/paymorrow-module
models/oxpspaymorrowoxuser.php
OxpsPaymorrowOxUser._isObjectFieldWithValidValue
protected function _isObjectFieldWithValidValue( $sKey, $sValue, $aMap, $oObject ) { if ( !array_key_exists( $sKey, $aMap ) ) { return false; } $sField = $aMap[$sKey]; if ( empty( $sValue ) or ( $oObject->$sField->value == $sValue ) ) { return false; } return true; }
php
protected function _isObjectFieldWithValidValue( $sKey, $sValue, $aMap, $oObject ) { if ( !array_key_exists( $sKey, $aMap ) ) { return false; } $sField = $aMap[$sKey]; if ( empty( $sValue ) or ( $oObject->$sField->value == $sValue ) ) { return false; } return true; }
[ "protected", "function", "_isObjectFieldWithValidValue", "(", "$", "sKey", ",", "$", "sValue", ",", "$", "aMap", ",", "$", "oObject", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "sKey", ",", "$", "aMap", ")", ")", "{", "return", "false", ";...
Check if field is in the map array and value is nor blank, neither same as already set. @param string $sKey @param string $sValue @param array $aMap @param object $oObject @return bool True if key is mapped with new non-blank value, false otherwise.
[ "Check", "if", "field", "is", "in", "the", "map", "array", "and", "value", "is", "nor", "blank", "neither", "same", "as", "already", "set", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/models/oxpspaymorrowoxuser.php#L463-L476
train
hostnet/accessor-generator-plugin-lib
src/Annotation/Generate.php
Generate.getMostLimitedVisibility
public static function getMostLimitedVisibility(...$requirements): string { foreach ([self::VISIBILITY_NONE, self::VISIBILITY_PRIVATE, self::VISIBILITY_PROTECTED] as $search_string) { foreach ($requirements as $requirement) { if ($requirement === $search_string) { return $search_string; } } } return self::VISIBILITY_PUBLIC; }
php
public static function getMostLimitedVisibility(...$requirements): string { foreach ([self::VISIBILITY_NONE, self::VISIBILITY_PRIVATE, self::VISIBILITY_PROTECTED] as $search_string) { foreach ($requirements as $requirement) { if ($requirement === $search_string) { return $search_string; } } } return self::VISIBILITY_PUBLIC; }
[ "public", "static", "function", "getMostLimitedVisibility", "(", "...", "$", "requirements", ")", ":", "string", "{", "foreach", "(", "[", "self", "::", "VISIBILITY_NONE", ",", "self", "::", "VISIBILITY_PRIVATE", ",", "self", "::", "VISIBILITY_PROTECTED", "]", "...
Resolves the most limited visibility for method generation. If A defines public and B defines private, the returned visibility modifier will be private. Precedence is as following: - none - private - protected - public @param array ...$requirements @return string
[ "Resolves", "the", "most", "limited", "visibility", "for", "method", "generation", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/Annotation/Generate.php#L224-L235
train
hostnet/accessor-generator-plugin-lib
src/Annotation/Generate.php
Generate.setDefaultVisibility
public function setDefaultVisibility(string $visibility): void { if (null === $this->get) { $this->get = $visibility; } if (null === $this->set) { $this->set = $visibility; } if (null === $this->add) { $this->add = $visibility; } if (null !== $this->remove) { return; } $this->remove = $visibility; }
php
public function setDefaultVisibility(string $visibility): void { if (null === $this->get) { $this->get = $visibility; } if (null === $this->set) { $this->set = $visibility; } if (null === $this->add) { $this->add = $visibility; } if (null !== $this->remove) { return; } $this->remove = $visibility; }
[ "public", "function", "setDefaultVisibility", "(", "string", "$", "visibility", ")", ":", "void", "{", "if", "(", "null", "===", "$", "this", "->", "get", ")", "{", "$", "this", "->", "get", "=", "$", "visibility", ";", "}", "if", "(", "null", "===",...
Sets the given visibility to all accessors if they are not explicitly defined. @param string $visibility
[ "Sets", "the", "given", "visibility", "to", "all", "accessors", "if", "they", "are", "not", "explicitly", "defined", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/Annotation/Generate.php#L242-L261
train
techdivision/import-product
src/Observers/ProductInventoryObserver.php
ProductInventoryObserver.prepareStockItemAttributes
protected function prepareStockItemAttributes() { return array_merge($this->prepareAttributes(), $this->attributeLoader->load($this, $this->getHeaderStockMappings())); }
php
protected function prepareStockItemAttributes() { return array_merge($this->prepareAttributes(), $this->attributeLoader->load($this, $this->getHeaderStockMappings())); }
[ "protected", "function", "prepareStockItemAttributes", "(", ")", "{", "return", "array_merge", "(", "$", "this", "->", "prepareAttributes", "(", ")", ",", "$", "this", "->", "attributeLoader", "->", "load", "(", "$", "this", ",", "$", "this", "->", "getHeade...
Prepare the stock item attributes of the entity that has to be persisted. @return array The prepared stock status item
[ "Prepare", "the", "stock", "item", "attributes", "of", "the", "entity", "that", "has", "to", "be", "persisted", "." ]
a596e0c4b0495c918139935a709815c739d61e95
https://github.com/techdivision/import-product/blob/a596e0c4b0495c918139935a709815c739d61e95/src/Observers/ProductInventoryObserver.php#L125-L128
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider.collectCommonData
public function collectCommonData() { /** @var OxpsPaymorrowSettings $oPmSettings */ $oPmSettings = oxNew( 'OxpsPaymorrowSettings' ); /** @var oxUser|OxpsPaymorrowOxUser $oUser */ $oUser = $this->getUser(); return array( 'merchantId' => $oPmSettings->getMerchantId(), 'mpiSignature' => $oPmSettings->getMpiSignature(), 'request_languageCode' => $oUser->getUserPaymorrowRequestLanguage(), 'request_id' => $this->getUniqueString(), ); }
php
public function collectCommonData() { /** @var OxpsPaymorrowSettings $oPmSettings */ $oPmSettings = oxNew( 'OxpsPaymorrowSettings' ); /** @var oxUser|OxpsPaymorrowOxUser $oUser */ $oUser = $this->getUser(); return array( 'merchantId' => $oPmSettings->getMerchantId(), 'mpiSignature' => $oPmSettings->getMpiSignature(), 'request_languageCode' => $oUser->getUserPaymorrowRequestLanguage(), 'request_id' => $this->getUniqueString(), ); }
[ "public", "function", "collectCommonData", "(", ")", "{", "/** @var OxpsPaymorrowSettings $oPmSettings */", "$", "oPmSettings", "=", "oxNew", "(", "'OxpsPaymorrowSettings'", ")", ";", "/** @var oxUser|OxpsPaymorrowOxUser $oUser */", "$", "oUser", "=", "$", "this", "->", "...
Compiles an array with mandatory authentication data. @return array
[ "Compiles", "an", "array", "with", "mandatory", "authentication", "data", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L49-L63
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider.collectEshopData
public function collectEshopData( $blLogData = true ) { /** @var OxpsPaymorrowOxUser|oxUser $oUser */ $oUser = $this->getUser(); // If user does not exist return null if ( !$oUser->exists() ) { return null; } /** @var OxpsPaymorrowSettings $oPmSettings */ $oPmSettings = oxNew( 'OxpsPaymorrowSettings' ); // Mandatory authentication data $aData = $this->collectCommonData(); $aData['addressEditing_disabled'] = 'N'; $aData['order_id'] = $this->_getBasketAndSessionHash(); $aData['source'] = 'PAYMORROW_GATEWAY_JS'; $aData['operationMode'] = $oPmSettings->getPaymorrowOperationMode(); // Order data $aData = $this->_addOrderData( $aData, $oUser ); // User profile data $aData = $this->_addUserProfileData( $aData, $oUser ); // User shipping address data $aData = $this->_addUserShippingAddressData( $aData, $oUser ); // User order history data $aData = $this->_addOrderHistoryData( $aData, $oUser ); // Device and client data $aData = $this->_addDeviceAndClientData( $aData, $oUser ); if ( !empty( $blLogData ) ) { /** @var OxpsPaymorrowLogger $oLogger */ $oLogger = oxRegistry::get( 'OxpsPaymorrowLogger' ); $oLogger->logWithType( $aData, 'collectEshopData' ); } return $aData; }
php
public function collectEshopData( $blLogData = true ) { /** @var OxpsPaymorrowOxUser|oxUser $oUser */ $oUser = $this->getUser(); // If user does not exist return null if ( !$oUser->exists() ) { return null; } /** @var OxpsPaymorrowSettings $oPmSettings */ $oPmSettings = oxNew( 'OxpsPaymorrowSettings' ); // Mandatory authentication data $aData = $this->collectCommonData(); $aData['addressEditing_disabled'] = 'N'; $aData['order_id'] = $this->_getBasketAndSessionHash(); $aData['source'] = 'PAYMORROW_GATEWAY_JS'; $aData['operationMode'] = $oPmSettings->getPaymorrowOperationMode(); // Order data $aData = $this->_addOrderData( $aData, $oUser ); // User profile data $aData = $this->_addUserProfileData( $aData, $oUser ); // User shipping address data $aData = $this->_addUserShippingAddressData( $aData, $oUser ); // User order history data $aData = $this->_addOrderHistoryData( $aData, $oUser ); // Device and client data $aData = $this->_addDeviceAndClientData( $aData, $oUser ); if ( !empty( $blLogData ) ) { /** @var OxpsPaymorrowLogger $oLogger */ $oLogger = oxRegistry::get( 'OxpsPaymorrowLogger' ); $oLogger->logWithType( $aData, 'collectEshopData' ); } return $aData; }
[ "public", "function", "collectEshopData", "(", "$", "blLogData", "=", "true", ")", "{", "/** @var OxpsPaymorrowOxUser|oxUser $oUser */", "$", "oUser", "=", "$", "this", "->", "getUser", "(", ")", ";", "// If user does not exist return null", "if", "(", "!", "$", "...
Compiles an array with all user and order data to pass to Paymorrow. @param bool $blLogData @return array
[ "Compiles", "an", "array", "with", "all", "user", "and", "order", "data", "to", "pass", "to", "Paymorrow", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L72-L116
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider.collectConfirmData
public function collectConfirmData() { $aData = $this->collectEshopData(false); // Add transaction data from session $aData['pm_order_transaction_id'] = oxRegistry::get('OxpsPaymorrowModule')->getPaymentTransactionId(); $aData['order_id'] = oxRegistry::getSession()->getVariable('pm_order_id'); // Add verification data /** @var OxpsPaymorrowGateway $oGateway */ $oGateway = oxRegistry::get('OxpsOxid2Paymorrow')->getPaymorrowGateway(); $aData['verification_customer_email'] = $this->_findInArray($aData, 'customer_email'); $aData['verification_shippingHash'] = $oGateway->getAddressHash( array( 'lastName' => $this->_findInArray($aData, 'customer_lastName'), 'street' => $this->_findInArray($aData, 'customer_shippingAddress_street'), 'houseNo' => $this->_findInArray($aData, 'customer_shippingAddress_houseNo'), 'zip' => $this->_findInArray($aData, 'customer_shippingAddress_postalCode'), ) ); $aData['verification_billingHash'] = $oGateway->getAddressHash( array( 'lastName' => $this->_findInArray($aData, 'customer_lastName'), 'street' => $this->_findInArray($aData, 'customer_billingAddress_street'), 'houseNo' => $this->_findInArray($aData, 'customer_billingAddress_houseNo'), 'zip' => $this->_findInArray($aData, 'customer_billingAddress_postalCode'), ) ); $aData['verification_order_grossAmount'] = $this->_findInArray($aData, 'order_grossAmount'); /** @var OxpsPaymorrowLogger $oLogger */ $oLogger = oxRegistry::get('OxpsPaymorrowLogger'); $oLogger->logWithType($aData, 'collectConfirmData'); return $aData; }
php
public function collectConfirmData() { $aData = $this->collectEshopData(false); // Add transaction data from session $aData['pm_order_transaction_id'] = oxRegistry::get('OxpsPaymorrowModule')->getPaymentTransactionId(); $aData['order_id'] = oxRegistry::getSession()->getVariable('pm_order_id'); // Add verification data /** @var OxpsPaymorrowGateway $oGateway */ $oGateway = oxRegistry::get('OxpsOxid2Paymorrow')->getPaymorrowGateway(); $aData['verification_customer_email'] = $this->_findInArray($aData, 'customer_email'); $aData['verification_shippingHash'] = $oGateway->getAddressHash( array( 'lastName' => $this->_findInArray($aData, 'customer_lastName'), 'street' => $this->_findInArray($aData, 'customer_shippingAddress_street'), 'houseNo' => $this->_findInArray($aData, 'customer_shippingAddress_houseNo'), 'zip' => $this->_findInArray($aData, 'customer_shippingAddress_postalCode'), ) ); $aData['verification_billingHash'] = $oGateway->getAddressHash( array( 'lastName' => $this->_findInArray($aData, 'customer_lastName'), 'street' => $this->_findInArray($aData, 'customer_billingAddress_street'), 'houseNo' => $this->_findInArray($aData, 'customer_billingAddress_houseNo'), 'zip' => $this->_findInArray($aData, 'customer_billingAddress_postalCode'), ) ); $aData['verification_order_grossAmount'] = $this->_findInArray($aData, 'order_grossAmount'); /** @var OxpsPaymorrowLogger $oLogger */ $oLogger = oxRegistry::get('OxpsPaymorrowLogger'); $oLogger->logWithType($aData, 'collectConfirmData'); return $aData; }
[ "public", "function", "collectConfirmData", "(", ")", "{", "$", "aData", "=", "$", "this", "->", "collectEshopData", "(", "false", ")", ";", "// Add transaction data from session", "$", "aData", "[", "'pm_order_transaction_id'", "]", "=", "oxRegistry", "::", "get"...
Compiles an array with order confirmation data to pass to Paymorrow. @return array
[ "Compiles", "an", "array", "with", "order", "confirmation", "data", "to", "pass", "to", "Paymorrow", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L123-L159
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider.printPmData
public function printPmData() { $aData = $this->collectEshopData(); $aPrintData = array( 'phone' => $this->_findInArray( $aData, 'customer_phoneNumber' ), 'mobile' => $this->_findInArray( $aData, 'customer_mobileNumber' ), 'session_id' => $this->_findInArray( $aData, 'client_browser_session_id' ), 'cookie_id' => $this->_findInArray( $aData, 'client_cookies_id' ), 'firstName' => $this->_findInArray( $aData, 'customer_firstName' ), 'lastName' => $this->_findInArray( $aData, 'customer_lastName' ), 'dob' => $this->_findInArray( $aData, 'customer_dateOfBirth' ), 'gender' => $this->_findInArray( $aData, 'customer_gender' ), 'email' => $this->_findInArray( $aData, 'customer_email' ), 'street' => $this->_findInArray( $aData, 'customer_billingAddress_street' ), 'houseNumber' => $this->_findInArray( $aData, 'customer_billingAddress_houseNo' ), 'locality' => $this->_findInArray( $aData, 'customer_billingAddress_city' ), 'postalCode' => $this->_findInArray( $aData, 'customer_billingAddress_postalCode' ), 'country' => $this->_findInArray( $aData, 'customer_billingAddress_country' ), 'shippingStreet' => $this->_findInArray( $aData, 'customer_shippingAddress_street' ), 'shippingHouseNumber' => $this->_findInArray( $aData, 'customer_shippingAddress_houseNo' ), 'shippingLocality' => $this->_findInArray( $aData, 'customer_shippingAddress_city' ), 'shippingPostalCode' => $this->_findInArray( $aData, 'customer_shippingAddress_postalCode' ), 'shippingCountry' => $this->_findInArray( $aData, 'customer_shippingAddress_country' ), 'shippingFirstName' => $this->_findInArray( $aData, 'customer_shippingAddress_firstName' ), 'shippingLastName' => $this->_findInArray( $aData, 'customer_shippingAddress_lastName' ), 'orderAmount' => $this->_findInArray( $aData, 'order_grossAmount' ), 'langcode' => $this->_findInArray( $aData, 'request_languageCode' ), 'client_ip' => $this->_findInArray( $aData, 'client_ipAddress' ), 'currencyCode' => $this->_findInArray( $aData, 'order_currency' ), ); // Check if there are session fields set and add to print data if available $aSessionData = (array) oxRegistry::getSession()->getVariable( 'pm_init_data' ); if ( !empty( $aSessionData ) ) { $aPrintData = array_merge( $aPrintData, $aSessionData ); } return json_encode( $aPrintData ); }
php
public function printPmData() { $aData = $this->collectEshopData(); $aPrintData = array( 'phone' => $this->_findInArray( $aData, 'customer_phoneNumber' ), 'mobile' => $this->_findInArray( $aData, 'customer_mobileNumber' ), 'session_id' => $this->_findInArray( $aData, 'client_browser_session_id' ), 'cookie_id' => $this->_findInArray( $aData, 'client_cookies_id' ), 'firstName' => $this->_findInArray( $aData, 'customer_firstName' ), 'lastName' => $this->_findInArray( $aData, 'customer_lastName' ), 'dob' => $this->_findInArray( $aData, 'customer_dateOfBirth' ), 'gender' => $this->_findInArray( $aData, 'customer_gender' ), 'email' => $this->_findInArray( $aData, 'customer_email' ), 'street' => $this->_findInArray( $aData, 'customer_billingAddress_street' ), 'houseNumber' => $this->_findInArray( $aData, 'customer_billingAddress_houseNo' ), 'locality' => $this->_findInArray( $aData, 'customer_billingAddress_city' ), 'postalCode' => $this->_findInArray( $aData, 'customer_billingAddress_postalCode' ), 'country' => $this->_findInArray( $aData, 'customer_billingAddress_country' ), 'shippingStreet' => $this->_findInArray( $aData, 'customer_shippingAddress_street' ), 'shippingHouseNumber' => $this->_findInArray( $aData, 'customer_shippingAddress_houseNo' ), 'shippingLocality' => $this->_findInArray( $aData, 'customer_shippingAddress_city' ), 'shippingPostalCode' => $this->_findInArray( $aData, 'customer_shippingAddress_postalCode' ), 'shippingCountry' => $this->_findInArray( $aData, 'customer_shippingAddress_country' ), 'shippingFirstName' => $this->_findInArray( $aData, 'customer_shippingAddress_firstName' ), 'shippingLastName' => $this->_findInArray( $aData, 'customer_shippingAddress_lastName' ), 'orderAmount' => $this->_findInArray( $aData, 'order_grossAmount' ), 'langcode' => $this->_findInArray( $aData, 'request_languageCode' ), 'client_ip' => $this->_findInArray( $aData, 'client_ipAddress' ), 'currencyCode' => $this->_findInArray( $aData, 'order_currency' ), ); // Check if there are session fields set and add to print data if available $aSessionData = (array) oxRegistry::getSession()->getVariable( 'pm_init_data' ); if ( !empty( $aSessionData ) ) { $aPrintData = array_merge( $aPrintData, $aSessionData ); } return json_encode( $aPrintData ); }
[ "public", "function", "printPmData", "(", ")", "{", "$", "aData", "=", "$", "this", "->", "collectEshopData", "(", ")", ";", "$", "aPrintData", "=", "array", "(", "'phone'", "=>", "$", "this", "->", "_findInArray", "(", "$", "aData", ",", "'customer_phon...
Get user data for the payment form initialization in JSON format. @return string
[ "Get", "user", "data", "for", "the", "payment", "form", "initialization", "in", "JSON", "format", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L167-L206
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider.toUtf
public static function toUtf( $sSting, $mLimitLength = null ) { if ( !oxRegistry::getConfig()->getConfigParam( 'iUtfMode' ) ) { $sSting = iconv( 'ISO-8859-15', 'UTF-8', $sSting ); } if ( is_integer( $mLimitLength ) and $mLimitLength > 0 ) { $sSting = mb_substr( $sSting, 0, $mLimitLength, 'UTF-8' ); } return $sSting; }
php
public static function toUtf( $sSting, $mLimitLength = null ) { if ( !oxRegistry::getConfig()->getConfigParam( 'iUtfMode' ) ) { $sSting = iconv( 'ISO-8859-15', 'UTF-8', $sSting ); } if ( is_integer( $mLimitLength ) and $mLimitLength > 0 ) { $sSting = mb_substr( $sSting, 0, $mLimitLength, 'UTF-8' ); } return $sSting; }
[ "public", "static", "function", "toUtf", "(", "$", "sSting", ",", "$", "mLimitLength", "=", "null", ")", "{", "if", "(", "!", "oxRegistry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'iUtfMode'", ")", ")", "{", "$", "sSting", "=", "icon...
Convert default OXID encoding ISO-8859-15 to UTF-8. Additionally it checks if shop it not on UTF-8 encoding already. Optionally crops string to fit provided length. @codeCoverageIgnore @param string $sSting @param null|int $mLimitLength @return string
[ "Convert", "default", "OXID", "encoding", "ISO", "-", "8859", "-", "15", "to", "UTF", "-", "8", ".", "Additionally", "it", "checks", "if", "shop", "it", "not", "on", "UTF", "-", "8", "encoding", "already", ".", "Optionally", "crops", "string", "to", "f...
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L233-L244
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider._findInArray
protected function _findInArray( array $aData, $mKey, $sDefault = '' ) { $sVal = $sDefault; if ( array_key_exists( $mKey, $aData ) and is_scalar( $aData[$mKey] ) ) { $sVal = trim( (string) $aData[$mKey] ); } return $sVal; }
php
protected function _findInArray( array $aData, $mKey, $sDefault = '' ) { $sVal = $sDefault; if ( array_key_exists( $mKey, $aData ) and is_scalar( $aData[$mKey] ) ) { $sVal = trim( (string) $aData[$mKey] ); } return $sVal; }
[ "protected", "function", "_findInArray", "(", "array", "$", "aData", ",", "$", "mKey", ",", "$", "sDefault", "=", "''", ")", "{", "$", "sVal", "=", "$", "sDefault", ";", "if", "(", "array_key_exists", "(", "$", "mKey", ",", "$", "aData", ")", "and", ...
Get array value by key. @param array $aData @param mixed $mKey @param mixed $sDefault @return string
[ "Get", "array", "value", "by", "key", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L256-L265
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider._getBrowserHeaders
protected function _getBrowserHeaders() { $sHeaders = ''; $aHeaders = apache_request_headers(); foreach ( $aHeaders as $sHeader => $sValue ) { $sHeaders .= " $sHeader: $sValue\n"; } return base64_encode( $sHeaders ); }
php
protected function _getBrowserHeaders() { $sHeaders = ''; $aHeaders = apache_request_headers(); foreach ( $aHeaders as $sHeader => $sValue ) { $sHeaders .= " $sHeader: $sValue\n"; } return base64_encode( $sHeaders ); }
[ "protected", "function", "_getBrowserHeaders", "(", ")", "{", "$", "sHeaders", "=", "''", ";", "$", "aHeaders", "=", "apache_request_headers", "(", ")", ";", "foreach", "(", "$", "aHeaders", "as", "$", "sHeader", "=>", "$", "sValue", ")", "{", "$", "sHea...
Get request headers string. @codeCoverageIgnore @return string
[ "Get", "request", "headers", "string", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L274-L284
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider._getBasketAndSessionHash
protected function _getBasketAndSessionHash() { $oSession = oxRegistry::getSession(); $oBasket = $oSession->getBasket(); return md5( $oSession->getId() . serialize( $oBasket ) . $this->getUniqueString( self::OXPS_PAYMORROW_ORDER_HASH_SALT ) ); }
php
protected function _getBasketAndSessionHash() { $oSession = oxRegistry::getSession(); $oBasket = $oSession->getBasket(); return md5( $oSession->getId() . serialize( $oBasket ) . $this->getUniqueString( self::OXPS_PAYMORROW_ORDER_HASH_SALT ) ); }
[ "protected", "function", "_getBasketAndSessionHash", "(", ")", "{", "$", "oSession", "=", "oxRegistry", "::", "getSession", "(", ")", ";", "$", "oBasket", "=", "$", "oSession", "->", "getBasket", "(", ")", ";", "return", "md5", "(", "$", "oSession", "->", ...
Compiles a hash string to identify a basket in current session. Used as temporary order ID. @return string
[ "Compiles", "a", "hash", "string", "to", "identify", "a", "basket", "in", "current", "session", ".", "Used", "as", "temporary", "order", "ID", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L292-L301
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider._addOrderData
protected function _addOrderData( array $aData, oxUser $oUser ) { /** @var OxpsPaymorrowOxBasket|oxBasket $oBasket */ $oBasket = $oUser->getUserPaymorrowUserBasketFromSession(); // Common order fields $aData['order_grossAmount'] = (double) $oBasket->getPaymorrowTotalAmount(); $aData['order_vatAmount'] = (double) $oBasket->getPaymorrowTotalVatAmount(); $aData['order_currency'] = self::toUtf( $oBasket->getPaymorrowBasketCurrency() ); // Summarized line items array: products, costs, vouchers $aData = array_merge( $aData, $oBasket->getPaymorrowBasketLineItems() ); return $aData; }
php
protected function _addOrderData( array $aData, oxUser $oUser ) { /** @var OxpsPaymorrowOxBasket|oxBasket $oBasket */ $oBasket = $oUser->getUserPaymorrowUserBasketFromSession(); // Common order fields $aData['order_grossAmount'] = (double) $oBasket->getPaymorrowTotalAmount(); $aData['order_vatAmount'] = (double) $oBasket->getPaymorrowTotalVatAmount(); $aData['order_currency'] = self::toUtf( $oBasket->getPaymorrowBasketCurrency() ); // Summarized line items array: products, costs, vouchers $aData = array_merge( $aData, $oBasket->getPaymorrowBasketLineItems() ); return $aData; }
[ "protected", "function", "_addOrderData", "(", "array", "$", "aData", ",", "oxUser", "$", "oUser", ")", "{", "/** @var OxpsPaymorrowOxBasket|oxBasket $oBasket */", "$", "oBasket", "=", "$", "oUser", "->", "getUserPaymorrowUserBasketFromSession", "(", ")", ";", "// Com...
Add order related data to array. @param array $aData @param OxpsPaymorrowOxUser|oxUser $oUser @return array
[ "Add", "order", "related", "data", "to", "array", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L312-L326
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider._addOrderHistoryData
protected function _addOrderHistoryData( array $aData, oxUser $oUser ) { /** @var oxList $oOrdersList */ $oOrdersList = $oUser->getOrders( 10 ); if ( empty( $oOrdersList ) or !$oOrdersList->count() ) { return $aData; } $sFieldPrefix = 'customer_history_%d_%s'; $iItemNumber = 1; foreach ( $oOrdersList as $oOrder ) { /** @var OxpsPaymorrowOxOrder|oxOrder $oOrder */ $aData[sprintf( $sFieldPrefix, $iItemNumber, 'orderDate' )] = $oOrder->getOrderDate(); $aData[sprintf( $sFieldPrefix, $iItemNumber, 'totalAmount' )] = $oOrder->getTotalOrderSum(); $aData[sprintf( $sFieldPrefix, $iItemNumber, 'paymentMethod' )] = $oOrder->getPaymentMethodName(); $aData[sprintf( $sFieldPrefix, $iItemNumber, 'orderStatus' )] = $oOrder->getOrderStatus(); $iItemNumber++; } return $aData; }
php
protected function _addOrderHistoryData( array $aData, oxUser $oUser ) { /** @var oxList $oOrdersList */ $oOrdersList = $oUser->getOrders( 10 ); if ( empty( $oOrdersList ) or !$oOrdersList->count() ) { return $aData; } $sFieldPrefix = 'customer_history_%d_%s'; $iItemNumber = 1; foreach ( $oOrdersList as $oOrder ) { /** @var OxpsPaymorrowOxOrder|oxOrder $oOrder */ $aData[sprintf( $sFieldPrefix, $iItemNumber, 'orderDate' )] = $oOrder->getOrderDate(); $aData[sprintf( $sFieldPrefix, $iItemNumber, 'totalAmount' )] = $oOrder->getTotalOrderSum(); $aData[sprintf( $sFieldPrefix, $iItemNumber, 'paymentMethod' )] = $oOrder->getPaymentMethodName(); $aData[sprintf( $sFieldPrefix, $iItemNumber, 'orderStatus' )] = $oOrder->getOrderStatus(); $iItemNumber++; } return $aData; }
[ "protected", "function", "_addOrderHistoryData", "(", "array", "$", "aData", ",", "oxUser", "$", "oUser", ")", "{", "/** @var oxList $oOrdersList */", "$", "oOrdersList", "=", "$", "oUser", "->", "getOrders", "(", "10", ")", ";", "if", "(", "empty", "(", "$"...
Add user order history data. Maximum 10 last orders fields are added. @param array $aData @param oxUser $oUser @return array
[ "Add", "user", "order", "history", "data", ".", "Maximum", "10", "last", "orders", "fields", "are", "added", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L416-L440
train
OXID-eSales/paymorrow-module
core/oxpspaymorroweshopdataprovider.php
OxpsPaymorrowEshopDataProvider._addDeviceAndClientData
protected function _addDeviceAndClientData( array $aData, oxUser $oUser ) { $oSession = oxRegistry::getSession(); $sSessionId = $oSession->getId(); $aData['device_checkId'] = $sSessionId; $aData['client_browser_session_id'] = $sSessionId; $aData['client_cookies_id'] = $sSessionId; $aData['client_ipAddress'] = $oUser->getUserPaymorrowIpAddress(); $aData['client_browser_header'] = $this->_getBrowserHeaders(); return $aData; }
php
protected function _addDeviceAndClientData( array $aData, oxUser $oUser ) { $oSession = oxRegistry::getSession(); $sSessionId = $oSession->getId(); $aData['device_checkId'] = $sSessionId; $aData['client_browser_session_id'] = $sSessionId; $aData['client_cookies_id'] = $sSessionId; $aData['client_ipAddress'] = $oUser->getUserPaymorrowIpAddress(); $aData['client_browser_header'] = $this->_getBrowserHeaders(); return $aData; }
[ "protected", "function", "_addDeviceAndClientData", "(", "array", "$", "aData", ",", "oxUser", "$", "oUser", ")", "{", "$", "oSession", "=", "oxRegistry", "::", "getSession", "(", ")", ";", "$", "sSessionId", "=", "$", "oSession", "->", "getId", "(", ")", ...
Add device and user client data. @param array $aData @param OxpsPaymorrowOxUser|oxUser $oUser @return array
[ "Add", "device", "and", "user", "client", "data", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/core/oxpspaymorroweshopdataprovider.php#L450-L462
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorroworder.php
OxpsPaymorrowOrder._updatePaymentDescription
protected function _updatePaymentDescription(oxPayment $oxPayment) { $oLang = oxRegistry::getLang(); if ($oxPayment->getPaymorrowPaymentType() == 'pm_invoice') { $oxPayment->oxpayments__oxdesc = new oxField( $oLang->translateString('PAYMORROW_PAYMENT_METHOD_NAME_INVOICE') ); } elseif ($oxPayment->getPaymorrowPaymentType() == 'pm_sdd') { $oxPayment->oxpayments__oxdesc = new oxField( $oLang->translateString('PAYMORROW_PAYMENT_METHOD_NAME_DIRECT_DEBIT') ); } $this->_oPayment = $oxPayment; }
php
protected function _updatePaymentDescription(oxPayment $oxPayment) { $oLang = oxRegistry::getLang(); if ($oxPayment->getPaymorrowPaymentType() == 'pm_invoice') { $oxPayment->oxpayments__oxdesc = new oxField( $oLang->translateString('PAYMORROW_PAYMENT_METHOD_NAME_INVOICE') ); } elseif ($oxPayment->getPaymorrowPaymentType() == 'pm_sdd') { $oxPayment->oxpayments__oxdesc = new oxField( $oLang->translateString('PAYMORROW_PAYMENT_METHOD_NAME_DIRECT_DEBIT') ); } $this->_oPayment = $oxPayment; }
[ "protected", "function", "_updatePaymentDescription", "(", "oxPayment", "$", "oxPayment", ")", "{", "$", "oLang", "=", "oxRegistry", "::", "getLang", "(", ")", ";", "if", "(", "$", "oxPayment", "->", "getPaymorrowPaymentType", "(", ")", "==", "'pm_invoice'", "...
Update payment model description fields with custom translations and set the payment. @param OxpsPaymorrowOxPayment|oxPayment $oxPayment
[ "Update", "payment", "model", "description", "fields", "with", "custom", "translations", "and", "set", "the", "payment", "." ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorroworder.php#L74-L89
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorroworder.php
OxpsPaymorrowOrder._getNextStep
protected function _getNextStep( $iSuccess ) { /** @var OxpsPaymorrowResponseHandler $oPmResponseHandler */ $oPmResponseHandler = oxRegistry::get( 'OxpsPaymorrowResponseHandler' ); /** * If after validating confirmOrder against Paymorrow services there are errors, * return to order step and render error message */ if ( $oPmResponseHandler->hasErrors() ) { $iErrorCode = $oPmResponseHandler->getErrorCode(); /** @var OxpsPaymorrowErrorHandler $oPmErrorHandler */ $oPmErrorHandler = oxNew( 'OxpsPaymorrowErrorHandler' ); $oPmErrorHandler->redirectWithError( $iErrorCode ); } /** * At this step assuming everything went fine * we need to delete SESSION variables created by Paymorrow * to avoid any incompatibilities if user has decided to * order again * * @doc: oxid_js_plugin.doc - 7.1 Controlling of customer’s browser session storage * * sess_challenge is deleted by `ThankYou` controller */ $oSession = oxRegistry::getSession(); $oSession->deleteVariable('pm_verify'); $oSession->deleteVariable('pm_response'); $oSession->deleteVariable('pm_responseINVOICE'); $oSession->deleteVariable('pm_responseSDD'); $oSession->deleteVariable('pm_order_transaction_id'); $oSession->deleteVariable('pm_order_transaction_idINVOICE'); $oSession->deleteVariable('pm_order_transaction_idSDD'); // Set payment method error instead of shipping method error if ( $iSuccess == 4 ) { $iSuccess = 5; } return $this->_OxpsPaymorrowOrder_getNextStep_parent( $iSuccess ); }
php
protected function _getNextStep( $iSuccess ) { /** @var OxpsPaymorrowResponseHandler $oPmResponseHandler */ $oPmResponseHandler = oxRegistry::get( 'OxpsPaymorrowResponseHandler' ); /** * If after validating confirmOrder against Paymorrow services there are errors, * return to order step and render error message */ if ( $oPmResponseHandler->hasErrors() ) { $iErrorCode = $oPmResponseHandler->getErrorCode(); /** @var OxpsPaymorrowErrorHandler $oPmErrorHandler */ $oPmErrorHandler = oxNew( 'OxpsPaymorrowErrorHandler' ); $oPmErrorHandler->redirectWithError( $iErrorCode ); } /** * At this step assuming everything went fine * we need to delete SESSION variables created by Paymorrow * to avoid any incompatibilities if user has decided to * order again * * @doc: oxid_js_plugin.doc - 7.1 Controlling of customer’s browser session storage * * sess_challenge is deleted by `ThankYou` controller */ $oSession = oxRegistry::getSession(); $oSession->deleteVariable('pm_verify'); $oSession->deleteVariable('pm_response'); $oSession->deleteVariable('pm_responseINVOICE'); $oSession->deleteVariable('pm_responseSDD'); $oSession->deleteVariable('pm_order_transaction_id'); $oSession->deleteVariable('pm_order_transaction_idINVOICE'); $oSession->deleteVariable('pm_order_transaction_idSDD'); // Set payment method error instead of shipping method error if ( $iSuccess == 4 ) { $iSuccess = 5; } return $this->_OxpsPaymorrowOrder_getNextStep_parent( $iSuccess ); }
[ "protected", "function", "_getNextStep", "(", "$", "iSuccess", ")", "{", "/** @var OxpsPaymorrowResponseHandler $oPmResponseHandler */", "$", "oPmResponseHandler", "=", "oxRegistry", "::", "get", "(", "'OxpsPaymorrowResponseHandler'", ")", ";", "/**\n * If after validat...
Overridden for Paymorrow Services validation @param $iSuccess @return string
[ "Overridden", "for", "Paymorrow", "Services", "validation" ]
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorroworder.php#L98-L141
train
OXID-eSales/paymorrow-module
controllers/oxpspaymorroworder.php
OxpsPaymorrowOrder._checkForErrorsToRedirect
protected function _checkForErrorsToRedirect() { if ( oxRegistry::getSession()->getVariable( 'pm_init_data' ) ) { $sUrl = oxRegistry::getConfig()->getShopCurrentUrl() . "cl=payment"; $sUrl = oxRegistry::get( "oxUtilsUrl" )->processUrl( $sUrl ); oxRegistry::getUtils()->redirect( $sUrl, false ); } }
php
protected function _checkForErrorsToRedirect() { if ( oxRegistry::getSession()->getVariable( 'pm_init_data' ) ) { $sUrl = oxRegistry::getConfig()->getShopCurrentUrl() . "cl=payment"; $sUrl = oxRegistry::get( "oxUtilsUrl" )->processUrl( $sUrl ); oxRegistry::getUtils()->redirect( $sUrl, false ); } }
[ "protected", "function", "_checkForErrorsToRedirect", "(", ")", "{", "if", "(", "oxRegistry", "::", "getSession", "(", ")", "->", "getVariable", "(", "'pm_init_data'", ")", ")", "{", "$", "sUrl", "=", "oxRegistry", "::", "getConfig", "(", ")", "->", "getShop...
Check session for init error and redirect to payment step is any found. The error or order declination entries are set during order confirmation. This data is used on payment step ho inform user and handle payment forms and it is always unset there. @codeCoverageIgnore
[ "Check", "session", "for", "init", "error", "and", "redirect", "to", "payment", "step", "is", "any", "found", ".", "The", "error", "or", "order", "declination", "entries", "are", "set", "during", "order", "confirmation", ".", "This", "data", "is", "used", ...
adb5d7f50c2fa5b566abd262161c483c42847b42
https://github.com/OXID-eSales/paymorrow-module/blob/adb5d7f50c2fa5b566abd262161c483c42847b42/controllers/oxpspaymorroworder.php#L150-L158
train
hostnet/accessor-generator-plugin-lib
src/AnnotationProcessor/DoctrineAnnotationProcessor.php
DoctrineAnnotationProcessor.processBidirectional
private function processBidirectional($annotation, PropertyInformation $information): void { // Parse the mappedBy and inversedBy columns, there is no nice interface // on them so we have to check for existence of the property. if (property_exists($annotation, 'inversedBy') && $annotation->inversedBy) { $information->setReferencedProperty($annotation->inversedBy); } elseif (property_exists($annotation, 'mappedBy') && $annotation->mappedBy) { $information->setReferencedProperty($annotation->mappedBy); } if ($annotation instanceof ManyToOne || $annotation instanceof ManyToMany) { $information->setReferencingCollection(true); } // Set default value for nullable. if ($information->isNullable() === null) { $information->setNullable((new JoinColumn())->nullable); } // Set field name for index on this collection. if (!property_exists($annotation, 'indexBy') || !$annotation->indexBy) { return; } $information->setIndex($annotation->indexBy); }
php
private function processBidirectional($annotation, PropertyInformation $information): void { // Parse the mappedBy and inversedBy columns, there is no nice interface // on them so we have to check for existence of the property. if (property_exists($annotation, 'inversedBy') && $annotation->inversedBy) { $information->setReferencedProperty($annotation->inversedBy); } elseif (property_exists($annotation, 'mappedBy') && $annotation->mappedBy) { $information->setReferencedProperty($annotation->mappedBy); } if ($annotation instanceof ManyToOne || $annotation instanceof ManyToMany) { $information->setReferencingCollection(true); } // Set default value for nullable. if ($information->isNullable() === null) { $information->setNullable((new JoinColumn())->nullable); } // Set field name for index on this collection. if (!property_exists($annotation, 'indexBy') || !$annotation->indexBy) { return; } $information->setIndex($annotation->indexBy); }
[ "private", "function", "processBidirectional", "(", "$", "annotation", ",", "PropertyInformation", "$", "information", ")", ":", "void", "{", "// Parse the mappedBy and inversedBy columns, there is no nice interface", "// on them so we have to check for existence of the property.", "...
Return referenced entity if we have a bidirectional doctrine association. @throws \DomainException @throws \InvalidArgumentException @param mixed $annotation with annotation Annotation @param PropertyInformation $information
[ "Return", "referenced", "entity", "if", "we", "have", "a", "bidirectional", "doctrine", "association", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/AnnotationProcessor/DoctrineAnnotationProcessor.php#L114-L139
train
hostnet/accessor-generator-plugin-lib
src/AnnotationProcessor/DoctrineAnnotationProcessor.php
DoctrineAnnotationProcessor.processColumn
protected function processColumn(Column $column, PropertyInformation $information): void { $information->setType($this->transformType($column->type)); $information->setFixedPointNumber(strtolower($column->type) === Type::DECIMAL); $information->setLength($column->length ?: 0); $information->setPrecision($column->precision); $information->setScale($column->scale); $information->setUnique($column->unique !== false); $information->setNullable($column->nullable !== false || \in_array($column->type, self::NULLABLE_TYPES, true)); $information->setIntegerSize($this->getIntegerSizeForType($column->type)); if ($information->isFixedPointNumber() && $information->getPrecision() === 0 && $information->getScale() === 0 ) { throw new InvalidColumnSettingsException( sprintf( 'Decimal type of "%s::%s" has scale and precision set to 0 or not set at all.' . PHP_EOL . 'Usage: e.g. @ORM\Column(type="decimal", precision=2, scale=4).' . PHP_EOL . '"The precision represents the number of digits that are stored for values,' . PHP_EOL . ' and the scale represents the number of digits that can be stored' . PHP_EOL . ' following the decimal point".', $information->getClass(), $information->getName() ) ); } }
php
protected function processColumn(Column $column, PropertyInformation $information): void { $information->setType($this->transformType($column->type)); $information->setFixedPointNumber(strtolower($column->type) === Type::DECIMAL); $information->setLength($column->length ?: 0); $information->setPrecision($column->precision); $information->setScale($column->scale); $information->setUnique($column->unique !== false); $information->setNullable($column->nullable !== false || \in_array($column->type, self::NULLABLE_TYPES, true)); $information->setIntegerSize($this->getIntegerSizeForType($column->type)); if ($information->isFixedPointNumber() && $information->getPrecision() === 0 && $information->getScale() === 0 ) { throw new InvalidColumnSettingsException( sprintf( 'Decimal type of "%s::%s" has scale and precision set to 0 or not set at all.' . PHP_EOL . 'Usage: e.g. @ORM\Column(type="decimal", precision=2, scale=4).' . PHP_EOL . '"The precision represents the number of digits that are stored for values,' . PHP_EOL . ' and the scale represents the number of digits that can be stored' . PHP_EOL . ' following the decimal point".', $information->getClass(), $information->getName() ) ); } }
[ "protected", "function", "processColumn", "(", "Column", "$", "column", ",", "PropertyInformation", "$", "information", ")", ":", "void", "{", "$", "information", "->", "setType", "(", "$", "this", "->", "transformType", "(", "$", "column", "->", "type", ")"...
Process a Column Annotation, extract information about scale and precision for decimal types, length and size of string and integer types, if the column may be null and if it should be a unique value. @param Column $column @param PropertyInformation $information @throws InvalidColumnSettingsException @throws \DomainException @throws \InvalidArgumentException @throws \RangeException @throws \Hostnet\Component\AccessorGenerator\Reflection\Exception\ClassDefinitionNotFoundException @throws \OutOfBoundsException
[ "Process", "a", "Column", "Annotation", "extract", "information", "about", "scale", "and", "precision", "for", "decimal", "types", "length", "and", "size", "of", "string", "and", "integer", "types", "if", "the", "column", "may", "be", "null", "and", "if", "i...
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/AnnotationProcessor/DoctrineAnnotationProcessor.php#L156-L183
train
hostnet/accessor-generator-plugin-lib
src/AnnotationProcessor/DoctrineAnnotationProcessor.php
DoctrineAnnotationProcessor.processJoinColumn
private function processJoinColumn(JoinColumn $join_column, PropertyInformation $information): void { $information->setNullable($join_column->nullable); $information->setUnique($join_column->unique); }
php
private function processJoinColumn(JoinColumn $join_column, PropertyInformation $information): void { $information->setNullable($join_column->nullable); $information->setUnique($join_column->unique); }
[ "private", "function", "processJoinColumn", "(", "JoinColumn", "$", "join_column", ",", "PropertyInformation", "$", "information", ")", ":", "void", "{", "$", "information", "->", "setNullable", "(", "$", "join_column", "->", "nullable", ")", ";", "$", "informat...
Process a JoinColumn Annotation, extract nullable. @param JoinColumn $join_column @param PropertyInformation $information
[ "Process", "a", "JoinColumn", "Annotation", "extract", "nullable", "." ]
0ff78bed5dddb4bec9fd64500f822a28ce987f62
https://github.com/hostnet/accessor-generator-plugin-lib/blob/0ff78bed5dddb4bec9fd64500f822a28ce987f62/src/AnnotationProcessor/DoctrineAnnotationProcessor.php#L191-L195
train