Passed
Push — master ( 6b54e3...ae25c0 )
by Anton
01:55
created

Relation::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
namespace Cycle\Schema\Definition;
11
12
use Cycle\Schema\Definition\Map\OptionMap;
13
use Cycle\Schema\Definition\Traits\OptionsTrait;
14
15
final class Relation
16
{
17
    use OptionsTrait;
18
19
    /** @var string */
20
    private $type;
21
22
    /** @var string */
23
    private $target;
24
25
    /** @var OptionMap */
26
    private $options;
27
28
    /** @var bool */
29
    private $inverse = false;
30
31
    /**
32
     * Relation constructor.
33
     */
34
    public function __construct()
35
    {
36
        $this->options = new OptionMap();
37
    }
38
39
    /**
40
     * @param string $type
41
     * @return Relation
42
     */
43
    public function setType(string $type): Relation
44
    {
45
        $this->type = $type;
46
47
        return $this;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getType(): string
54
    {
55
        return $this->type;
56
    }
57
58
    /**
59
     * @param string $target
60
     * @return Relation
61
     */
62
    public function setTarget(string $target): Relation
63
    {
64
        $this->target = $target;
65
66
        return $this;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getTarget(): string
73
    {
74
        return $this->target;
75
    }
76
77
    /**
78
     * @param bool $inverse
79
     * @return Relation
80
     */
81
    public function setInverse(bool $inverse): Relation
82
    {
83
        $this->inverse = $inverse;
84
        return $this;
85
    }
86
87
    /**
88
     * @return bool
89
     */
90
    public function isInverse(): bool
91
    {
92
        return $this->inverse;
93
    }
94
}