public function isConnected() { if (!($this->mongoClient instanceof \MongoClient || $this->mongoClient instanceof \Mongo)) { return false; } return count($this->mongoClient->getHosts()) > 0; }
/** * Return whether this datasource is connected or not to the persistent storage server * * @return boolean */ public function isConnected() { return $this->connection->isConnected(); }