CsvBulkLoader for SiteTree objects

56 Views Asked by At

I'm trying to use a custom CsvBulkLoader loader to create Pages, however the loader isn't working proprely. If I use a subclass of SiteTree it tells me method parent() is not avaiable on the class. I tried writing directly to SiteTree then changing the instance to the Target class on the last write, but the Content disappears.

protected function processRecord($record, $columnMap, &$results, $preview = false)
{
    $post = BlogPost::create();

    $post->update($record);

    $post->writeToStage('Stage');


    $post->publish("Stage", "Live");

    return $post->ID;
}
0

There are 0 best solutions below