Models comes back ok I can print it var dump it etc I can use print_r($formula_list->operatorformulas); etc etc and get an object with two or three operator models. Perfect... However if I then use foreach ($formula_list->operatorformulas as $operator_model) //code
I get ErrorException [ Notice ]: Trying to get property of non-object. The error is on that line, not anything within the foreach but on that $formula_list->operatorformulas entity. I've checked my models and my database all seem ok. This works if my formula only has instances of operatorformula and field formula but fails when using metric formula although the db tables and the models are the same. Anyone had anything like this or can thing of where I moight be going wrong? I just dont understand why it will print the related models but not iterate through them. Thanks