Welcome Guest, Not a member yet? Register   Sign In
self-referencing relationship is not working using datamapper
#7

[eluser]WanWizard[/eluser]
Read the manual on relations.

Datamapper doesn't do anything automagically, If you want to save a relation, you have to explicitly do so:
Code:
$mother = new Mother();
$category = new Category(6); // as an example, load existing category with id 6

// add some data
$mother->fieldA = 'valueA';
$mother->fieldB = 'valueB';

// save the mother record, and relate it to the loaded category
$mother->save($category);


Messages In This Thread
self-referencing relationship is not working using datamapper - by El Forum - 04-10-2011, 10:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB