| Total Complexity | 7 |
| Total Lines | 78 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 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 |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @return bool |
||
| 89 | */ |
||
| 90 | public function isInverse(): bool |
||
| 93 | } |
||
| 94 | } |