fix(webservice): Polished code
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Websmid\WsOrderReference\Entity\OrderReference;
|
||||
use Websmid\WsOrderReference\Repository\OrderReferenceRepository;
|
||||
use Websmid\OrderReference\Entity\OrderReference;
|
||||
use Websmid\OrderReference\Repository\OrderReferenceRepository;
|
||||
|
||||
if (file_exists(__DIR__ . '../../vendor/autoload.php')) {
|
||||
require_once __DIR__ . '../../vendor/autoload.php';
|
||||
@@ -29,6 +29,7 @@ class ws_orderreferenceAjaxModuleFrontController extends ModuleFrontController
|
||||
]));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
/** @var \Doctrine\ORM\EntityManagerInterface $entityManager */
|
||||
@@ -37,11 +38,11 @@ class ws_orderreferenceAjaxModuleFrontController extends ModuleFrontController
|
||||
/** @var OrderReferenceRepository $repository */
|
||||
$repository = $entityManager->getRepository(OrderReference::class);
|
||||
|
||||
$orderRef = $repository->findByCartId($idCart);
|
||||
$orderRef = $repository->findByCartId((int)$idCart);
|
||||
|
||||
if (!$orderRef) {
|
||||
$orderRef = new OrderReference();
|
||||
$orderRef->setIdCart($idCart);
|
||||
$orderRef->setIdCart((int)$idCart);
|
||||
}
|
||||
|
||||
$orderRef->setOrderReference(pSQL($orderReference));
|
||||
|
||||
Reference in New Issue
Block a user