Hi all,
i attempt to create & publish an Page with the ORM till 5 hours now. The Problem i see, is the versioning. I can't find a Dokumentation of this SS Part. Now, i need help.
My Code Snippet :
Referenz extends Page { ... }
.....
ReferenzHolder extends Page {
.....
$referenz = new Referenz();
$referenz->ParentID = $this->dataRecord->ID; // ID of ReferenzHolder
$referenz->Title = $data['Title'];
$referenz->Status = "Published"
$referenz->write();
$referenz->publish('Stage', 'Live');
....
}
SS creates two Records in SiteTree. One ReferenzHolder and one Referenz. My Questions :
1. Why SS creates an ReferenzHolder?
2. Why SS creates the two Records with the Status Attribute "New Page" instead of "Published"?
If anyone has a link to some Documentions about creating & publishing Pages with ORM, i become relieved.
Regards,
Stefan