Monday 24 January 2011 3:30:12 pm
Thanks for the info Peter. I ended up having to dig a little further to figure this one out, but found some similar code in the cronjobs/rssimport.php file. For anyone that's interested, here's what I ended up with. Would be curious if anyone sees anything wrong with this, or if there's a better way to accomplish it. So, after my initial createAndPublishObject call, I proceeded with this: $contentObject = eZContentFunctions::createAndPublishObject( $params );<span> </span>
$db = eZDB::instance();
$db->begin();
$object = eZContentObject::fetch( $contentObject->attribute('id') );
$version = $object->attribute('current');
$object->setAttribute( 'published', strtotime($date) );
$version->setAttribute( 'created', strtotime($date) );
$object->setAttribute( 'modified', strtotime($date) );
$version->setAttribute( 'modified', strtotime($date) );
$version->store();
$object->store();
$db->commit();
Hopefully this will save someone some time down the road...
|