| 1 | <?php |
||
| 6 | |||
| 7 | trait RefPart { |
||
| 8 | |||
| 9 | /** @var string */ |
||
| 10 | private $ref; |
||
| 11 | |||
| 12 | private function parseRef(Map $data) { |
||
| 13 | $this->ref = $data->get('$ref'); |
||
| 14 | 12 | } |
|
| 15 | 12 | ||
| 16 | 12 | private function mergeRef(static $model, $overwrite = false) { |
|
|
|
|||
| 17 | 12 | MergeHelper::mergeFields($this->ref, $model->ref, $overwrite); |
|
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * |
||
| 22 | * @return the string |
||
| 23 | 1 | */ |
|
| 24 | 1 | public function getRef() { |
|
| 25 | return $this->ref; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * |
||
| 30 | * @param |
||
| 31 | * $ref |
||
| 32 | 1 | */ |
|
| 33 | 1 | public function setRef($ref) { |
|
| 34 | 1 | $this->ref = $ref; |
|
| 35 | 1 | return $this; |
|
| 36 | } |
||
| 37 | |||
| 38 | 12 | public function hasRef() { |
|
| 39 | 12 | return null !== $this->ref; |
|
| 40 | } |
||
| 41 | |||
| 42 | } |
||
| 43 |