Jump to content
php.lv forumi

Masīvs, kuru neņem pretī foreach()


Леший

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...