Thursday 12 March 2009 3:45:27 am
Hi eZ Forum,
In PHP code, i fetched an object that have reverse related objects. I got the reverse related list like this :
// Fetch object ID 1231
$object = eZContentObject::fetch( 1231 );
// Get all reverse relations grouped by attribute
$all_reverse_related_object_list = $object->reverseRelatedObjectList( false, 0, true, array( 'AllRelations' => true ) );
Now i got this in $all_reverse_related_object_list :
array(1) {
[391]=>
array(8) {
[0]=>
object(eZContentObject)#48 (22) {
["ID"]=>
string(4) "1252"
["Name"]=>
string(28) "My reverse related object title 1"
....
[8]=>
object(eZContentObject)#48 (22) {
["ID"]=>
string(4) "1260"
["Name"]=>
string(28) "My reverse related object title 8"
... }
}
My attribute ID is <b>391</b> and i would like to fetch this attribute, and check his identifier (media is the identifier). Without knowing from which content class is part of, neither his version, just fetching it by his ID. I tried this :
$reverse_attribute = eZContentObjectAttribute::fetch( 391 );
or this
$reverse_attribute = eZContentObjectAttribute::fetchByClassAttributeID( 391 );
without any success.
Does any one could help me on this ?
Thanks Olivier
|