protected function _convertToArray($obj) {
        $arr    = array();
        $arrObj = is_object($obj) ? get_object_vars($obj) : $obj;

        foreach ($arrObj as $key => $val) {
            if (is_object($val)) {
                switch (get_class($val)) {
                case 'Garp_Spawn_Relation_Set':
                    $val = $val->getRelations();
                    break;
                case 'Garp_Spawn_Behaviors':
                    $val = $val->getBehaviors();
                    break;
                case 'Garp_Spawn_Fields':
                    $val = $val->getFields();
                }

                $val = $this->_convertToArray($val);
            } elseif (is_array($val)) {
                $val = $this->_convertToArray($val);
            }
            $arr[$key] = $val;
        }

        return $arr;
    }