5 use RootedData\RootedJsonData;
19 $schema = file_get_contents(__DIR__ .
"/../../docs/query.json");
20 parent::__construct($json, $schema);
21 $this->populateDefaults();
27 private function populateDefaults() {
28 $schemaJson =
new RootedJsonData($this->getSchema());
29 $properties = $schemaJson->{
"$.properties"};
30 foreach ($properties as $key => $property) {
31 if (isset($property[
'default']) && !isset($this->{
"$.$key"})) {
32 $this->{
"$.$key"} = $property[
'default'];