protected function wrapObject($obj)
    {
        if (is_object($obj)) {
            // if it's an object, just check the type and wrap if needed
            if ($obj instanceof ViewableWrapper) {
                return $obj;
            } else {
                return new ViewableWrapper($obj);
            }
        } elseif (is_array($obj)) {
            // if it's an assoc array just wrap it, otherwise make a dataobjectset
            if (ArrayLib::is_associative($obj)) {
                return new ViewableWrapper($obj);
            } else {
                $set = new ArrayList();
        
                foreach ($obj as $i => $item) {
                    $wrap = $this->wrapObject($item);
                    $set->push($wrap);
                }
        
                return $set;
            }
        } else {
            // it's a simple type, just return it
            return $obj;
        }
    }