Леший Posted January 19, 2012 Report Share Posted January 19, 2012 Taisu vienu projektu uz fuelphp, un vēlos visās darbības ar datiem veikt ar ORM. Problēma ir pie datu saglābāšanas, konkrēti ar relācijām Kods (fuela ORM modelis): var_dump(static::${'_'.$rel_name}); //ieliku es foreach (static::${'_'.$rel_name} as $key => $settings) Rezultāts: array(1) { ["translates"]=> array(4) { ["join_type"]=> string(4) "left" ["key_from"]=> string(2) "id" ["model_to"]=> string(27) "Model_Translates_Translates" ["key_to"]=> string(7) "item_id" } } ErrorException [ Warning ]: Invalid argument supplied for foreach() Kas var būt par vainu? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted January 19, 2012 Report Share Posted January 19, 2012 Pamēģini: $t = static::${'_'.$rel_name}; foreach ($t as ... Quote Link to comment Share on other sites More sharing options...
Леший Posted January 19, 2012 Author Report Share Posted January 19, 2012 (edited) Tas bija pirmais, ko provēju, tā pati kļūda. Pagiadam uzliku foreach ((array)(static::${'_'.$rel_name}) as $key => $settings) un paziņoju fuelistiem par bugu. Edited January 19, 2012 by Леший Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.