Skip to content

Commit

Permalink
BP-3700-Change-Zend-to-Laminas
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbinaBaraliu committed Sep 16, 2024
1 parent 73abf07 commit 8283ed7
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions Model/Service/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
use Buckaroo\Magento2\Helper\Data;
use Magento\Framework\App\ResourceConnection;
use Laminas\Db\Sql\Expression;

class Order
{
Expand All @@ -43,16 +44,17 @@ class Order
private Factory $configProviderFactory;

public function __construct(
Account $accountConfig,
MethodFactory $configProviderMethodFactory,
Factory $configProviderFactory,
Account $accountConfig,
MethodFactory $configProviderMethodFactory,
Factory $configProviderFactory,
StoreRepositoryInterface $storeRepository,
CollectionFactory $orderFactory,
OrderStatusFactory $orderStatusFactory,
Data $helper,
Log $logging,
ResourceConnection $resourceConnection
) {
CollectionFactory $orderFactory,
OrderStatusFactory $orderStatusFactory,
Data $helper,
Log $logging,
ResourceConnection $resourceConnection
)
{
$this->accountConfig = $accountConfig;
$this->configProviderMethodFactory = $configProviderMethodFactory;
$this->configProviderFactory = $configProviderFactory;
Expand Down Expand Up @@ -94,11 +96,11 @@ protected function cancelExpiredTransferOrdersPerStore($store)
)
->addFieldToFilter(
'created_at',
['lt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . $dueDays . ' DAY')]
['lt' => new Expression('NOW() - INTERVAL ' . $dueDays . ' DAY')]
)
->addFieldToFilter(
'created_at',
['gt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
['gt' => new Expression('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
);

$orderCollection->getSelect()
Expand Down Expand Up @@ -154,11 +156,11 @@ protected function cancelExpiredPPEOrdersPerStore($store)
)
->addFieldToFilter(
'created_at',
['lt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . $dueDays . ' DAY')]
['lt' => new Expression('NOW() - INTERVAL ' . $dueDays . ' DAY')]
)
->addFieldToFilter(
'created_at',
['gt' => new \Zend_Db_Expr('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
['gt' => new Expression('NOW() - INTERVAL ' . ($dueDays + 7) . ' DAY')]
);

$orderCollection->getSelect()
Expand Down Expand Up @@ -216,7 +218,7 @@ public function cancel($order, $statusCode)
$this->logging->addDebug(__METHOD__ . '|20|');

if (in_array($order->getPayment()->getMethodInstance()->buckarooPaymentMethodCode, ['klarnakp'])) {
$methodInstanceClass = get_class($order->getPayment()->getMethodInstance());
$methodInstanceClass = get_class($order->getPayment()->getMethodInstance());
$methodInstanceClass::$requestOnVoid = false;
}

Expand Down

0 comments on commit 8283ed7

Please sign in to comment.