Wednesday 04 February 2009 8:48:47 am
Hi, I'm a bit confused about how to create a new translation for an existing object in pure code. I've not been able to create a new translation in the current version of the object (that is the way how the user interface works). Instead, a new version is created containing the new translation. Here is my code:
$version = $contentObject->createNewVersionIn( $contentObjectTargetLanguage, $contentObjectSourceLanguage, false, true, eZContentObjectVersion::STATUS_PUBLISHED );
foreach ( $contentObject->fetchDataMap() as $attribute_identifier => $attribute )
{
$attribute->fromString( 'New attribute translation' );
$attribute->store();
}
What am I doing wrong? Maybe it has something to do with createNewVersionIn()... Please help!
|