Passed
Pull Request — main (#39)
by Tom
02:35
created

Criteria::getObjectValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
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 DoctrineCriteria $criteria,
21
        protected string $eventName,
22
        protected mixed $objectValue,
23
        protected array $args,
24
        protected mixed $context,
25
        protected 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