1 | <?php |
||
9 | class BelongsToRelationship |
||
10 | { |
||
11 | /** |
||
12 | * @var ElasticsearchModel |
||
13 | */ |
||
14 | protected $child; |
||
15 | |||
16 | /** |
||
17 | * @var ElasticsearchModel |
||
18 | */ |
||
19 | protected $parentClassName; |
||
20 | |||
21 | function __construct(ElasticsearchModel $child, $parentClassName) |
||
26 | |||
27 | public function associate($parent) |
||
31 | |||
32 | /** |
||
33 | * Return parent instance via inner_hits objects. |
||
34 | * |
||
35 | * @return ElasticsearchModel |
||
36 | */ |
||
37 | public function get() |
||
64 | |||
65 | /** |
||
66 | * Return parent instance via inner_hits objects. |
||
67 | * |
||
68 | * @return ElasticsearchModel |
||
69 | */ |
||
70 | public function getOrFail() |
||
80 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.