protected function checkConnection() { if (!@$this->ping()) { $this->close(); return $this->connect(); } return true; }