I'm trying to get a task running that I have created in mysite/tasks. When I try to run the cli like:
php framework/cli-script.php ImporterTask
with this code:
class ImporterTask extends HourlyTask
{
function process() {
$page = new Page;
$page->Title = 'cron';
$page->MenuTitle = 'cron';
$page->Content = 'this is some test content';
$page->URLSegment = 'test';
$page->Status = 'Published';
$page->doRestoreToStage();
$page->write();
}
}
It throws the error:
Uncaught Exception: Object->__call(): the method 'setowner' does not exist on 'ImporterTask'
IN GET ./FranchiseImporterTask
There is nothing I can find that the class needs a setowner function and when I put it in it throws the error:
ERROR [User Error]: Uncaught SS_DatabaseException: Couldn't run query:
INSERT INTO "SiteTree" ("ID") VALUES ($1)
Though I might not be returning the right thing for it.