I'm trying to add pages to the Silverstripe Site tree using a background process that calls an external API.
I'm just trying to get the code to create a new Programme Page right. At the moment I have:
$mySiteTree = new SiteTree();
$mySiteTree->ClassName = "Programme";
$mySiteTree->URLSegment = $newurl;
$mySiteTree->URLSegment = 'testurl';
$mySiteTree->Title = 'testing title';
$mySiteTree->ShowInMenus = '1';
$mySiteTree->ParentID = '86';
$mySiteTree->write();
This doesn't seem to create any page. Any suggestions as to what I'm doing wrong or what I could try to do to debug this?