Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of Evaluate with Object function call

I call a function through object at runtime. In this specific case, the function name is supplied through a logic from another page at runtime (the function exists in cfc). At present we use Evaluate and that is very slow. Any way I can get rid of this? I know I can use [] with a structure but here I am lost. qryData is the query object which I pass to the function.

<cfset someData = Evaluate("objTicket.#arrayItem[ItemID].FunctionName#(qryData)")>
<!---this is how it would look like--->
<cfset someData = objTicket.getTickets(qryData)>
like image 779
CFML_Developer Avatar asked Mar 03 '23 00:03

CFML_Developer


1 Answers

Does this fix it for you?

<cfset someData = objTicket[arrayItem[ItemID].FunctionName](qryData)>
like image 109
rrk Avatar answered Mar 04 '23 12:03

rrk