|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace ApiSkeletons\Doctrine\ORM\GraphQL\Event; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\ORM\QueryBuilder as DoctrineQueryBuilder; |
|
8
|
|
|
use GraphQL\Type\Definition\ResolveInfo; |
|
9
|
|
|
use League\Event\HasEventName; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* This event is fired when the QueryBuilder is created for an entity |
|
13
|
|
|
*/ |
|
14
|
|
|
class QueryBuilder implements |
|
15
|
|
|
HasEventName |
|
16
|
|
|
{ |
|
17
|
|
|
/** @param mixed[] $args */ |
|
18
|
|
|
public function __construct( |
|
19
|
|
|
protected readonly string $eventName, |
|
20
|
|
|
protected readonly DoctrineQueryBuilder $queryBuilder, |
|
21
|
|
|
protected readonly int $offset, |
|
22
|
|
|
protected readonly int $limit, |
|
23
|
|
|
protected readonly mixed $objectValue, |
|
24
|
|
|
protected readonly array $args, |
|
25
|
|
|
protected readonly mixed $context, |
|
26
|
|
|
protected readonly ResolveInfo $info, |
|
27
|
|
|
) { |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public function eventName(): string |
|
31
|
|
|
{ |
|
32
|
|
|
return $this->eventName; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function getQueryBuilder(): DoctrineQueryBuilder |
|
36
|
|
|
{ |
|
37
|
|
|
return $this->queryBuilder; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function getOffset(): int |
|
41
|
|
|
{ |
|
42
|
|
|
return $this->offset; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function getLimit(): int |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->limit; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function getObjectValue(): mixed |
|
51
|
|
|
{ |
|
52
|
|
|
return $this->objectValue; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** @return mixed[] */ |
|
56
|
|
|
public function getArgs(): array |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->args; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function getContext(): mixed |
|
62
|
|
|
{ |
|
63
|
|
|
return $this->context; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
public function getInfo(): ResolveInfo |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->info; |
|
69
|
|
|
} |
|
70
|
|
|
} |
|
71
|
|
|
|