function add(&$obj, $parentexpr, $value, $name = "") { $parent =& JsonStore::get($obj, $parentexpr); if ($name != "") { $parent[$name] = $value; } else { $parent[] = $value; } }
protected function filterJSON($json, $path) { if (preg_match("/^\\\$/", $path)) { // jsonpath $store = new JsonStore($json); $result = $store->get($path); } else { // xpath $result = $this->xPathFilter("json", $json, $path); } return $result; }