Skip to content

Commit 63a15e3

Browse files
simsternsaimaz
authored andcommitted
Initialize static serializer on wakeup (#288)
* master branch dev versions set to 6.1-dev * introducing field aware trait and named builder interface * Adding param `track_total_hits` (#273) * Add getQuery Method to FunctionScoreQuery (#271) * Add getQuery Method to FunctionScoreQuery Add getQuery Method to FunctionScoreQuery in order to apply changes to query of FunctionScoreQuery. * Update FunctionScoreQuery.php * added new NestedSort for replacing deprecated nested_filter and nested_path (#267) * added new NestedSort for replacing deprecated nested_filter and nested_path * made the filter optional * remove keyed option condition for to have range key * update readme version matrix * fix php psr2 style issues in the FunctionScore class * Initialize static serializer on wakeup
1 parent 06c553b commit 63a15e3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/Search.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,25 @@ class Search
171171
private $endpoints = [];
172172

173173
/**
174-
* Initializes serializer.
174+
* Constructor to initialize static properties
175175
*/
176176
public function __construct()
177+
{
178+
$this->initializeSerializer();
179+
}
180+
181+
/**
182+
* Wakeup method to initialize static properties
183+
*/
184+
public function __wakeup()
185+
{
186+
$this->initializeSerializer();
187+
}
188+
189+
/**
190+
* Initializes the serializer
191+
*/
192+
private function initializeSerializer()
177193
{
178194
if (static::$serializer === null) {
179195
static::$serializer = new OrderedSerializer(

0 commit comments

Comments
 (0)