From 2d796d48df6f4371111bcbc776ea781e4f45c831 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 8 Jul 2017 11:11:53 -0400 Subject: Expand on query and result, begin sql design --- private/Controller/Controller.php | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 private/Controller/Controller.php (limited to 'private/Controller/Controller.php') diff --git a/private/Controller/Controller.php b/private/Controller/Controller.php new file mode 100644 index 0000000..188345a --- /dev/null +++ b/private/Controller/Controller.php @@ -0,0 +1,56 @@ + $err->getMessage())); + } + } + + /** + * Creates and returns a Result object. + * + * @param string $resultType The type of result to send back to the client. + * @param array $result The result object to send back to the client. + * + * @return Model\Result + */ + public static function createResult ( + string $resultType, + array $result + ): Model\Result { + try { + return new Model\Result ($resultType, $result); + } catch (\Exception $err) { + return new Model\Result ("ERROR", array($err->getMessage())); + } + } +} -- cgit