public function toJSON($options = 0) { $json = array(); foreach ($this->getPatches() as $patch) { $json[] = $patch->toArray(); } return str_replace('\\/', '/', json_encode($json, $options)); }