Kdyby\Doctrine\Connection::ping PHP Method

ping() public method

public ping ( )
    public function ping()
    {
        $conn = $this->getWrappedConnection();
        if ($conn instanceof Driver\PingableConnection) {
            return $conn->ping();
        }
        set_error_handler(function ($severity, $message) {
            throw new \PDOException($message, $severity);
        });
        try {
            $this->query($this->getDatabasePlatform()->getDummySelectSQL());
            restore_error_handler();
            return TRUE;
        } catch (Doctrine\DBAL\DBALException $e) {
            restore_error_handler();
            return FALSE;
        } catch (\Exception $e) {
            restore_error_handler();
            throw $e;
        }
    }