private function hasIterator($obj) {
        $hasIterator = false;
        foreach ($obj as $key => $dummy) {
            $hasIterator = true;
            break;
        }
        return $hasIterator;
    }