eZ Community » Forums » Developer » Modifying the object from withing a...
expandshrink

Modifying the object from withing a datatype

Modifying the object from withing a datatype

Friday 15 September 2006 9:49:48 am - 3 replies

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+

Friday 15 September 2006 10:40:53 am

What is actually the remoteid doing?

Friday 15 September 2006 10: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+

Friday 15 September 2006 10: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

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from