From 663dd31ad07be34f135af2e5846ba5bba6527828 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 29 Sep 2017 17:13:38 +0200 Subject: [PATCH] Add getters for connection --- .../Connection/ConnectionAbstract.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/DataStorage/Database/Connection/ConnectionAbstract.php b/DataStorage/Database/Connection/ConnectionAbstract.php index 1a97a9a1d..7300e3a2b 100644 --- a/DataStorage/Database/Connection/ConnectionAbstract.php +++ b/DataStorage/Database/Connection/ConnectionAbstract.php @@ -110,6 +110,42 @@ abstract class ConnectionAbstract implements ConnectionInterface return $this->status; } + /** + * Get database name. + * + * @return string + * + * @since 1.0.0 + */ + public function getDatabase() : string + { + return $this->dbdata['database']; + } + + /** + * Get database host. + * + * @return string + * + * @since 1.0.0 + */ + public function getHost() : string + { + return $this->dbdata['host']; + } + + /** + * Get database port. + * + * @return int + * + * @since 1.0.0 + */ + public function getPort() : int + { + return (int) $this->dbdata['port']; + } + /** * Get table prefix. *