1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Service; |
4
|
|
|
|
5
|
|
|
use ControleOnline\Entity\Invoice; |
|
|
|
|
6
|
|
|
use ControleOnline\Entity\OrderProduct; |
7
|
|
|
use ControleOnline\Entity\OrderProductQueue; |
8
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
|
9
|
|
|
use Symfony\Component\Security\Core\Security; |
|
|
|
|
10
|
|
|
use Doctrine\ORM\QueryBuilder; |
|
|
|
|
11
|
|
|
use Symfony\Component\HttpFoundation\RequestStack; |
|
|
|
|
12
|
|
|
|
13
|
|
|
class OrderProductQueueService |
14
|
|
|
{ |
15
|
|
|
private $request; |
16
|
|
|
public function __construct( |
17
|
|
|
private EntityManagerInterface $manager, |
18
|
|
|
private Security $security, |
19
|
|
|
private PeopleService $PeopleService, |
|
|
|
|
20
|
|
|
RequestStack $requestStack |
21
|
|
|
|
22
|
|
|
) { |
23
|
|
|
$this->request = $requestStack->getCurrentRequest(); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
public function addProductToQueue(OrderProduct $orderProduct) |
27
|
|
|
{ |
28
|
|
|
$product = $orderProduct->getProduct(); |
29
|
|
|
$queue = $product->getQueue(); |
30
|
|
|
if ($queue) { |
31
|
|
|
|
32
|
|
|
$orderProductQueue = $this->manager->getRepository(OrderProductQueue::class)->findOneBy([ |
33
|
|
|
'order_product' => $orderProduct |
34
|
|
|
]); |
35
|
|
|
if (!$orderProductQueue) { |
36
|
|
|
$orderProductQueue = new OrderProductQueue(); |
37
|
|
|
$orderProductQueue->setPriority('priority'); |
38
|
|
|
$orderProductQueue->setOrderProduct($orderProduct); |
39
|
|
|
$orderProductQueue->setStatus($queue->getStatusIn()); |
40
|
|
|
$orderProductQueue->setQueue($queue); |
41
|
|
|
$this->manager->persist($orderProductQueue); |
42
|
|
|
$this->manager->flush(); |
43
|
|
|
} |
44
|
|
|
} |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths