From ee29facb67a7533d3d1dcd21ad3a9743fa4f8201 Mon Sep 17 00:00:00 2001 From: Tom Van Looy Date: Tue, 22 Jan 2019 16:10:02 +0100 Subject: [PATCH] Add GetMysqlDatabase command --- README.md | 6 +++- .../MysqlDatabases/GetMysqlDatabase.php | 35 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/Command/MysqlDatabases/GetMysqlDatabase.php diff --git a/README.md b/README.md index 38a6cfa..a58fe95 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,10 @@ array(3) { ## Changelog +**21-01-2019 - v2.0.5** + +- Added command to get Mysql database + **21-03-2018 - v2.0.4** - Added structured representation to LinuxHostings namespace @@ -122,4 +126,4 @@ array(3) { **pre 19-03-2018** -- No changelog has been kept prior to this point. If you really need to know, please see the Git history to get an idead of what changed. \ No newline at end of file +- No changelog has been kept prior to this point. If you really need to know, please see the Git history to get an idead of what changed. diff --git a/src/Command/MysqlDatabases/GetMysqlDatabase.php b/src/Command/MysqlDatabases/GetMysqlDatabase.php new file mode 100644 index 0000000..d6f9925 --- /dev/null +++ b/src/Command/MysqlDatabases/GetMysqlDatabase.php @@ -0,0 +1,35 @@ +databaseName = $databaseName; + } + + public function prepare() + { + $this->setEndPoint("/v2/mysqldatabases/" . $this->databaseName); + } + + public function processResponse($response) + { + $db = $response['body']; + + $response['response'] = new MysqlDatabase($db->account_id, $db->name, $db->hostname, $db->user_count, $db->max_size, $db->actual_size); + + return $response; + } +}