| Total Complexity | 8 |
| Total Lines | 84 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class Relation |
||
| 15 | { |
||
| 16 | /** @var string */ |
||
| 17 | private $type; |
||
| 18 | |||
| 19 | /** @var string */ |
||
| 20 | private $target; |
||
| 21 | |||
| 22 | /** @var OptionMap */ |
||
| 23 | private $options; |
||
| 24 | |||
| 25 | /** @var bool */ |
||
| 26 | private $inverse = false; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Relation constructor. |
||
| 30 | */ |
||
| 31 | public function __construct() |
||
| 32 | { |
||
| 33 | $this->options = new OptionMap(); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param string $type |
||
| 38 | * @return Relation |
||
| 39 | */ |
||
| 40 | public function setType(string $type): Relation |
||
| 41 | { |
||
| 42 | $this->type = $type; |
||
| 43 | |||
| 44 | return $this; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | public function getType(): string |
||
| 51 | { |
||
| 52 | return $this->type; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param string $target |
||
| 57 | * @return Relation |
||
| 58 | */ |
||
| 59 | public function setTarget(string $target): Relation |
||
| 60 | { |
||
| 61 | $this->target = $target; |
||
| 62 | |||
| 63 | return $this; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function getTarget(): string |
||
| 70 | { |
||
| 71 | return $this->target; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return OptionMap |
||
| 76 | */ |
||
| 77 | public function getOptions(): OptionMap |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @param bool $inverse |
||
| 84 | * @return Relation |
||
| 85 | */ |
||
| 86 | public function setInverse(bool $inverse): Relation |
||
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @return bool |
||
| 94 | */ |
||
| 95 | public function isInverse(): bool |
||
| 98 | } |
||
| 99 | } |