protected function destroy() { if ($this->resource) { $this->resource->clear(); $this->resource->destroy(); $this->resource = null; } }