public function getListarDignidad() { try { $dataAcces = new DataAccesComponents(); $data = $dataAcces->listarDignidad(); if ($data != NULL) { foreach ($data as $col) { $datos[] = new Dignidad($col[1], $col[2], $col[3]); } } return $datos; } catch (Exception $ex) { echo "No se pudo pudieron obtener los datos Error" . $ex->getMessage(); } }