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 | * Sets document unique id. |
||
51 | * |
||
52 | * @param string $documentId |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function setId($documentId) |
||
62 | |||
63 | /** |
||
64 | * Returns document id. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getId() |
||
72 | |||
73 | /** |
||
74 | * Sets document score. |
||
75 | * |
||
76 | * @param string $documentScore |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function setScore($documentScore) |
||
86 | |||
87 | /** |
||
88 | * Gets document score. |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getScore() |
||
96 | |||
97 | /** |
||
98 | * Sets parent document id. |
||
99 | * |
||
100 | * @param string $parent |
||
101 | * |
||
102 | * @return $this |
||
103 | */ |
||
104 | public function setParent($parent) |
||
110 | |||
111 | /** |
||
112 | * Returns parent document id. |
||
113 | * |
||
114 | * @return null|string |
||
115 | */ |
||
116 | public function getParent() |
||
120 | |||
121 | /** |
||
122 | * Checks if document has a parent. |
||
123 | * |
||
124 | * @return bool |
||
125 | */ |
||
126 | public function hasParent() |
||
130 | |||
131 | /** |
||
132 | * Sets time to live timestamp. |
||
133 | * |
||
134 | * @param string $ttl |
||
135 | * |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function setTtl($ttl) |
||
144 | |||
145 | /** |
||
146 | * Returns time to live value. |
||
147 | * |
||
148 | * @return int |
||
149 | */ |
||
150 | public function getTtl() |
||
154 | } |
||
155 |