protected function writeCollection($collection) { file_put_contents($this->file, json_encode($collection)); }