Criteria::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 6
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiSkeletons\Doctrine\ORM\GraphQL\Event;
6
7
use Doctrine\Common\Collections\Criteria as DoctrineCriteria;
8
use GraphQL\Type\Definition\ResolveInfo;
9
use League\Event\HasEventName;
10
11
/**
12
 * This event is dispatched when a Doctrine Criteria is created.
13
 * Define an event using the Association::$criteriaEventName
14
 */
15
class Criteria implements
16
    HasEventName
17
{
18
    /** @param mixed[] $args */
19
    public function __construct(
20
        protected readonly DoctrineCriteria $criteria,
21
        protected readonly string $eventName,
22
        protected readonly mixed $objectValue,
23
        protected readonly array $args,
24
        protected readonly mixed $context,
25
        protected readonly ResolveInfo $info,
26
    ) {
27
    }
28
29
    public function eventName(): string
30
    {
31
        return $this->eventName;
32
    }
33
34
    public function getCriteria(): DoctrineCriteria
35
    {
36
        return $this->criteria;
37
    }
38
39
    public function getObjectValue(): mixed
40
    {
41
        return $this->objectValue;
42
    }
43
44
    /** @return mixed[] */
45
    public function getArgs(): array
46
    {
47
        return $this->args;
48
    }
49
50
    public function getContext(): mixed
51
    {
52
        return $this->context;
53
    }
54
55
    public function getInfo(): ResolveInfo
56
    {
57
        return $this->info;
58
    }
59
}
60