Skip to content

Commit f10ee30

Browse files
committed
Added setJSON() function
1 parent e53d33f commit f10ee30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Base.php

+6
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ public function getJSON() {
4242
public function getObject() {
4343
return $this->object;
4444
}
45+
46+
// Added in v2
47+
public function setJSON($object) {
48+
if (is_array($object)) $this->object = $object;
49+
elseif (is_string($object)) $this->object = json_decode($object, true);
50+
}
4551
}

0 commit comments

Comments
 (0)