Hi,
I have a table that will have PageID 0 (zero) it wont insert the ID of the User class <<uses>>
class SomeData extends DataObject
{
public static $db = array(
'Stuff' => 'Varchar(50)',
);
public static $has_one = array(
"Page" => "ThaPage"
);
}
and
class ThaPage extends SiteTree{
public static $has_many = array(
"SomeDataz" => "SomeData" // ??? do I need this ???
);
}
class ThaPage_Controller extends ContentController{
public function doStuff(){
$Stuff = new SomeData();
$Stuff->Stuff = "some stuff to tbl";
$Stuff->write();
}
}
The PageID ( <- SiteTree.ID ) will be 0, Do I have to make a method for SomeData that will insert the PageID ?
or im missing something?
Thanks