Share » Forums » Developer » How to edit / store user attributes...

How to edit / store user attributes within a extension

How to edit / store user attributes within a extension

Thursday 10 November 2005 3:25:11 pm - 2 replies

Author Message

Bruce Morrison

Thursday 10 November 2005 3:46:29 pm

Hi Norman

You need to republish the object after changing the attribute.

Something like this should do the trick:

include_once( "kernel/classes/ezcontentobject.php" );
$userObject=eZContentObject::fetch('59');

$newuserObject =& $userObject->createNewVersion();

$dataMap =& $newuserObject->attribute ( 'data_map' );
$dataMap['punkte']->setAttribute( 'data_int', '5' );
$dataMap['punkte']->store();

include_once ('lib/ezutils/classes/ezoperationhandler.php');
operationResult = eZOperationHandler::execute( 'content', 'publish',
   array( 'object_id' => $newuserObject->attribute( 'id' ),
          'version' => $newuserObject->attribute( 'current_version' ) ) );

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Norman Leutner

Saturday 12 November 2005 8:43:10 am

Thanks Bruce.
It´s been a little bit late that day ...
(12:25:11 am)

should have seen it by myself ;)

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu