Modifying the object from withing a datatype

Author Message

Xavier Dutoit

Friday 15 September 2006 12:49:48 am

Hi,

I want to modify the remoteid attribute from a datatype (contained in the object), but can't find a way to access it.

Any suggestion ?

What's the best place (method) to change it ? storeObjectAttribute ?

X+

http://www.sydesy.com

K259

Friday 15 September 2006 1:40:53 am

What is actually the remoteid doing?

Xavier Dutoit

Friday 15 September 2006 1:49:06 am

By default, that looks like an MD5 of something.

That's supposed to be unique, even between installations if I'm right. I want to use it to store some external ids on it (I guessed that the name remoteID is what it's meant for.

This being said, my question could equaly apply to any attribute of the content object. For instance set the publication date based on the date from an attribute, or set the owner or whatever...

X+

http://www.sydesy.com

Claudia Kosny

Friday 15 September 2006 1:53:35 am

Hello there

The remote id is an identifier that you can give your objects. This can be useful for importing/updating data via script. If you don't set it, Ez sets it to a md5 of some object specific data during creation of this object, I forgot which one. As EZ does not use this remote id, you can overwrite it with your own value (e.g. the product reference for products).

You can access and overwrite the remote id the usual way:

$remoteId = $contentObject->attribute('remote_id');
$contentObject->setAttribute('remote_id', <your key here>);

Greetings from Luxembourg

Claudia

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.