API: Adding a page in unapproved mode

Permalink
Hey All,
I'm trying to write some code to add a page in the unapproved state. So, I'm working at it in this way:
$parent = Page::getByID($parent_id);
$ct =CollectionType::getByID($collection_type);            
            $data = array('cName' => 'Page Name', 'cDescription' => 'Page Desc, here', 'cDatePublic' => $date);
            $p = $parent->add($ct, $data);
//do something with $p here to make it unapproved


So yeah, not sure what to call from here to put it into an unapproved state. Maybe:
$p->loadVersionObject('')

but I'm just not getting it. Thanks for any help

 
mbone99 replied on at Permalink Best Answer Reply
Just add as an unapproved page, ie:
$data = array('cName' => 'Page Name', 'cDescription' => 'Page Desc, here', 'cDatePublic' => $date, 'cvIsApproved'=> false);


mb
mgraves10 replied on at Permalink Reply
Thanks, that's what I was looking for. I couldn't find how to do that in the API docs. Cheers!
-Mgraves