| Total Complexity | 7 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Coverage | 65% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | abstract class AbstractOneRelation extends AbstractRelation |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \Swis\JsonApi\Client\Interfaces\ItemInterface |
||
| 12 | */ |
||
| 13 | protected $included; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var int |
||
| 17 | */ |
||
| 18 | protected $id; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param \Swis\JsonApi\Client\Interfaces\DataInterface $included |
||
| 22 | * |
||
| 23 | * @throws \InvalidArgumentException |
||
| 24 | * |
||
| 25 | * @return $this |
||
| 26 | */ |
||
| 27 | 50 | public function associate(DataInterface $included) |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | public function dissociate() |
||
| 47 | { |
||
| 48 | $this->included = null; |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return mixed |
||
| 55 | */ |
||
| 56 | 30 | public function getId() |
|
| 57 | { |
||
| 58 | 30 | return $this->id; |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param mixed $id |
||
| 63 | * |
||
| 64 | * @return $this |
||
| 65 | */ |
||
| 66 | 55 | public function setId($id) |
|
| 67 | { |
||
| 68 | 55 | $this->id = $id; |
|
| 69 | |||
| 70 | 55 | return $this; |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return \Swis\JsonApi\Client\Interfaces\ItemInterface|null |
||
| 75 | */ |
||
| 76 | 30 | public function getIncluded() |
|
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return bool |
||
| 83 | */ |
||
| 84 | public function hasIncluded(): bool |
||
| 87 | } |
||
| 88 | } |
||
| 89 |