php - Accessing Object variable -
I am using an API that is the result of an array like this in the form of data:
object (stud class) # 38 (5) {["returncode"] = & gt; Int (1) ["EntityResults"] = & gt; Object (stdClass) # 39 (1) {["unit"] = & gt; Object (Stud Class) # 40 (15) {["id"] = & gt; Int (43622) ["User Defined Field"] = & gt; Object (stdClass) # 41 (0) {} ["Tikida"] => Int (3,1024) ["Internal Unprocessed"] = & gt; Int (28303142) ["Date"] = & gt; String (19) "2011-03-24 T 00: 00: 00" ["start date"] = & gt; String (19) "2011-03-2411 11: 41: 00" ["Endadetime"] = & gt; String (19) "2011-03-2411 11: 46: 00" ["Hours Work"] = & gt; Float (0.08) ["Hour Tablet"] = & gt; Float (0.0833333358) ["OffsetHours"] = & gt; Float (0) ["summary notes"] = & gt; String (584) "Hi Steve ..." ["Internal Notes"] = & gt; String (0) "" ["rolled"] = & gt; Int (24482927) ... ... ... Then I have some records that return the result:
object (stdClass) ) # 33 (5) {["ReturnCode"] = & gt; Int (1) ["EntityResults"] = & gt; Object (Stud Class) # 34 (0) {} ["Anti-Result Type"] = & gt; String (9) "Timer" ["Errors"] = & gt; Object (Stud Class) # 35 (0) {} ["Antiterrorist Infractions"] = & gt; # 36 (0) {} }
I get an error with this end result
Illicitity: Notice
Message: Undefined property: stdClass :: $ Entity
file name: model / ticket_model.fp
My question is that How can I avoid this error? I have tried
if ($ result-> query sage-> unit = result-> unit): $ noteso = $ result-> QueryResult-> Unit-result-> Unit; If (count ($ note)): Return $ Notes; Other: Return false; end if; end if; But then I get the same error but in the IF statement.
Hope is enough for someone to understand what is happening.
Billy
Most appreciated with any help,
If I understand correctly, then this is what you want:
if (isset ($ result-> queryResult- & gt; unit-result- & Gt; unit)):
Comments
Post a Comment