Passed
Pull Request — master (#9)
by Mariusz
02:39
created

Association::isLoadModeFull()   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
namespace Xsolve\Associate\DoctrineOrm\Association\Path;
4
5
class Association
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $relationshipName;
11
12
    /**
13
     * @var ?string
14
     */
15
    protected $alias;
16
17
    /**
18
     * @var string
19
     */
20
    protected $loadMode = 'proxy';
21
22
    /**
23
     * AssociationPath constructor.
24
     *
25
     * @param string $relationshipName
26
     */
27
    public function __construct(string $relationshipName)
28
    {
29
        $this->relationshipName = $relationshipName;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getRelationshipName(): string
36
    {
37
        return $this->relationshipName;
38
    }
39
40
    /**
41
     * @param mixed $alias
42
     *
43
     * @return self
44
     */
45
    public function setAlias($alias): self
46
    {
47
        $this->alias = $alias;
48
49
        return $this;
50
    }
51
52
    /**
53
     * @return mixed
54
     */
55
    public function getAlias()
56
    {
57
        return $this->alias;
58
    }
59
60
    /**
61
     * @param string $loadMode
62
     *
63
     * @return self
64
     */
65
    public function setLoadMode(string $loadMode): self
66
    {
67
        $this->loadMode = $loadMode;
68
69
        return $this;
70
    }
71
72
    /**
73
     * @return bool
74
     */
75
    public function isLoadModeFull(): bool
76
    {
77
        return 'full' === $this->loadMode;
78
    }
79
80
    /**
81
     * @return bool
82
     */
83
    public function isLoadModeProxy(): bool
84
    {
85
        return 'proxy' === $this->loadMode;
86
    }
87
}
88