From 9bc2e4e065bd64f1664055419138e77bd6c09b30 Mon Sep 17 00:00:00 2001 From: cuixin Date: Tue, 27 Jan 2015 02:28:39 +0800 Subject: [PATCH] add user/group ser --- Westdc/User/Group.php | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Westdc/User/Group.php diff --git a/Westdc/User/Group.php b/Westdc/User/Group.php new file mode 100644 index 0000000..3566d8c --- /dev/null +++ b/Westdc/User/Group.php @@ -0,0 +1,47 @@ +serviceManager = $serviceManager; + + $this->init(); + + return $this; + } + + private function init() + { + $dbService = $this->serviceManager->get('Db'); + $this->db = $dbService->getPdo(); + } + + + /** + * @return mixed + */ + public function fetchAll () { + + $sql = "SELECT * FROM groups"; + $rs = $this->db->query($sql); + + return $rs->fetchAll(\PDO::FETCH_ASSOC); + } + +} \ No newline at end of file