Wednesday 15 September 2010 1:52:58 pm
"
Take a look at ezcontentobject_link, relation_type comes from constants on eZContentObject class:
const RELATION_COMMON = 1;
const RELATION_EMBED = 2;
const RELATION_LINK = 4;
const RELATION_ATTRIBUTE = 8; If you want to add relations by code you can do it like this (where $object is instance of eZContentObject):
$object->addContentObjectRelation( $newObjectID, $objectVersion, 0, eZContentObject::RELATION_EMBED );
"
Hi André, I have similar problem. I created custom class and added attribute of "Object Relations" type. Using method similar to the one you presented:
$object->addContentObjectRelation( $newObjectID, $objectVersion, $attributeId, eZContentObject::RELATION_EMBED ); where $attributeId is ID of my attribute in that class of "Object Relations" type. I can see that relation is being created on "Relations" tab of that object (and "Reverse Related Relation" in destination object has been also created) however in "preview" and when I hit "edit" on that object, I don't see related object(s) being selected in list of checkboxes which represent this relation (note: I chosen to represent this relation as list of checkboxes when adding Object Relations attribute to my class). Can you give me some hints here? regards, Michal
|