eZContentObject relatedContentObjectArray

Author Message

Lucas Aguilar

Thursday 06 May 2010 5:41:05 am

Dear, good morning, I commented:
'm trying to get objects related to this php code:

$ IdObjTramitesDestacados = 2214
$ ObjTramimesDestacados = & eZContentObject:: fetch ($ idObjTramitesDestacados)
$ArrayObjRelacionados = $objTramimesDestacados-> relatedContentObjectArray ();

print_r ($objTramimesDestacados)
print_r ($arrayObjRelacionados)


foreach ($arrayObjRelacionados as $tramite_relacionado) (
echo '<br> processed:'. $tramite_relacionado;
)

And do not return anything ... observation if I use the method:
echo ('<br> Object ID:'. $ objTramimesDestacados-> ID);
echo ('Number of objects related <br>'. $ objTramimesDestacados-> relatedContentObjectCount ());

It returns the correct amount of related objects.

q know could be happening?
thanks

Lucas Aguilar

Thursday 06 May 2010 8:46:18 am

From this line "sql" query when the query is empty brings, such as repair it, is some language settings that I may be missing?.
He clarified that previously realized the steps from the 4.0.1 update to version 4.3
greetings and I hope some help.

This is the sql:

SELECT
ezcontentclass.serialized_name_list AS class_serialized_name_list,
ezcontentclass.identifier as contentclass_identifier,
ezcontentclass.is_container as is_container,
ezcontentobject.* , ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM
ezcontentclass,
ezcontentobject,
ezcontentobject_link
, ezcontentobject_name
WHERE
ezcontentclass.id=ezcontentobject.contentclass_id
AND ezcontentclass.version=0
AND ezcontentobject.status=1
AND ezcontentobject_link.op_code='0'
AND ( relation_type & 7 ) <> 0
AND ezcontentobject.id=ezcontentobject_link.to_contentobject_id
AND ezcontentobject_link.from_contentobject_id='2214'
AND ezcontentobject_link.from_contentobject_version='10'
AND ezcontentobject.id = ezcontentobject_name.contentobject_id
AND ezcontentobject.current_version = ezcontentobject_name.content_version
AND ( ezcontentobject_name.language_id & ezcontentobject.language_mask > 0
*/If you remove this last part brings the right data ... */

AND ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 1 )
< ( ezcontentobject_name.language_id & 1 ) )

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