Association::getFirst()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlgoWeb\PODataLaravel\Models\ObjectMap\Entities\Associations;
6
7
abstract class Association
8
{
9
    /** @var array<int, string>  */
10
    protected $multArray = [
11
        AssociationStubRelationType::MANY => '*',
12
        AssociationStubRelationType::ONE => '1',
13
        AssociationStubRelationType::NULL_ONE => '0..1',
14
    ];
15
16
    /**
17
     * @var AssociationStubBase
18
     */
19
    protected $first;
20
21
    /**
22
     * @return AssociationStubBase
23
     */
24
    public function getFirst(): AssociationStubBase
25
    {
26
        return $this->first;
27
    }
28
29
    /**
30
     * @param AssociationStubBase $first
31
     */
32
    public function setFirst(AssociationStubBase $first): void
33
    {
34
        $this->first = $first;
35
        $first->addAssociation($this);
36
    }
37
38
    /**
39
     * @return AssociationStubBase|AssociationStubBase[]
40
     */
41
    abstract public function getLast();
42
43
    /**
44
     * @return bool
45
     */
46
    abstract public function isOk(): bool;
47
48
    /**
49
     * @return AssociationType|AssociationType[]
50
     */
51
    abstract public function getAssociationType();
52
}
53