Hi,
I have a many_many relationship in my Page class to a Tag class.
* MyPage extends SiteTee
* Tag extends DataObject
* MyPage many_many -> (Tags, Tag)
* Tag belongs_many_many (MyPages, MyPage)
Now I'm importing stuff from a XML file and create Pages from it. I want to assign the Tags form my XML to the newly created page.
Here is the pseudo-code:
$page = new MyPage();
$page->ParentID = $parentID
$page->Title = $title;
$page->Content = $content;
$tag = DataObject::get_by_id("Tag", (int)$myTagID);
$page->Tags()->push($tag, $tag->ID);
$page->writeToStage('Stage');
Well, the page is create fine, but it has no refference to the Tag specified... Is it right to call $page->Tags()->push(...) ?
$page->Tags()->write() didn't was no good as well...
thanks,
mco