public function destroy() { if ($this->resource) { $this->resource->clear(); $this->resource->destroy(); } parent::destroy(); }