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); } }