내가중첩 된 구조 만들기, 더 좋은 방법은 무엇입니까?
<cffunction name="setDataAllWithFilter" output="false" access="public">
<cfargument name="stCollection" required="true" type="Struct" />
<cfif NOT StructKeyExists(Session, this.LOCAL) >
<cfset Session[this.LOCAL] = StructNew() />
</cfif>
<cfif NOT StructKeyExists(Session[this.LOCAL], "Data") >
<cfset Session[this.LOCAL]["Data"] = StructNew() />
</cfif>
<cfif NOT StructKeyExists(Session[this.LOCAL]["Data"], "Filtered") >
<cfset Session[this.LOCAL]["Data"]["Filtered"] = StructNew() />
</cfif>
<cfreturn SetAll(Arguments.stCollection, Session[this.LOCAL]["Data"]["Filtered"]) />
</cffunction>
같은 중첩 된 구조체 뭔가를 만들려고하고 그것은 이런 OK인가? 아니면 그렇게 할 수있는 더 좋은 방법이 있습니까?
감사
여기서 무엇을 하려는지 확실하지 않습니다. 왜 세션에서 그런 구조체를 생성해야합니까? – Henry
응답 해 주셔서 감사합니다. 사용할 수없는 경우 중첩 된 구조체를 만드는 것이 더 나은 방법일까요? 세션, 요청 또는 기타 LOCAL 구조가 될 수 있습니다. 제가 묻기를 원하는 것은 중첩 된 구조를 만드는 더 좋은 방법이 있습니까? 감사합니다 – user160820
당신은 struct 내에서 구조체로 많은 키를 가진 구조체를 돌리고 있습니까? – Henry