We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72128f1 commit b225c52Copy full SHA for b225c52
src/Jsonq.php
@@ -151,14 +151,22 @@ public function exists()
151
* reset given data to the $_map
152
*
153
* @param mixed $data
154
+ * @param bool $instance
155
* @return jsonq
156
*/
- public function reset($data = null)
157
+ public function reset($data = null, $instance = false)
158
{
159
if (!is_null($data)) {
160
$this->_baseContents = $data;
161
}
162
163
+ if ($instance) {
164
+ $self = new self();
165
+ $self->collect($this->_baseContents);
166
+
167
+ return $self;
168
+ }
169
170
$this->_map = $this->_baseContents;
171
$this->reProcess();
172
0 commit comments