1 | <?php |
||
19 | trait DocumentTrait |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | * |
||
24 | * @ES\MetaField(name="_id") |
||
25 | */ |
||
26 | public $id; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | * |
||
31 | * @ES\MetaField(name="_score") |
||
32 | */ |
||
33 | public $score; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | * |
||
38 | * @ES\MetaField(name="_parent") |
||
39 | */ |
||
40 | public $parent; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | * |
||
45 | * @ES\MetaField(name="_ttl") |
||
46 | */ |
||
47 | public $ttl; |
||
48 | |||
49 | /** |
||
50 | * When document is cloned id is set to null. |
||
51 | */ |
||
52 | public function __clone() |
||
56 | |||
57 | /** |
||
58 | * Sets document unique id. |
||
59 | * |
||
60 | * @param string $documentId |
||
61 | * |
||
62 | * @return $this |
||
63 | */ |
||
64 | public function setId($documentId) |
||
70 | |||
71 | /** |
||
72 | * Returns document id. |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getId() |
||
80 | |||
81 | /** |
||
82 | * Sets document score. |
||
83 | * |
||
84 | * @param string $documentScore |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function setScore($documentScore) |
||
94 | |||
95 | /** |
||
96 | * Gets document score. |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getScore() |
||
104 | |||
105 | /** |
||
106 | * Sets parent document id. |
||
107 | * |
||
108 | * @param string $parent |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function setParent($parent) |
||
118 | |||
119 | /** |
||
120 | * Returns parent document id. |
||
121 | * |
||
122 | * @return null|string |
||
123 | */ |
||
124 | public function getParent() |
||
128 | |||
129 | /** |
||
130 | * Checks if document has a parent. |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | public function hasParent() |
||
138 | |||
139 | /** |
||
140 | * Sets time to live timestamp. |
||
141 | * |
||
142 | * @param string $ttl |
||
143 | * |
||
144 | * @return $this |
||
145 | */ |
||
146 | public function setTtl($ttl) |
||
152 | |||
153 | /** |
||
154 | * Returns time to live value. |
||
155 | * |
||
156 | * @return int |
||
157 | */ |
||
158 | public function getTtl() |
||
162 | } |
||
163 |