kernel/content/ezcontentfunctioncollection.php
static public function fetchReverseRelatedObjectsID( $objectID, $attributeID, $allRelations )
    {
        if ( !is_array( $allRelations ) || $allRelations === array() )
        {
            $allRelations = array( 'common', 'xml_embed', 'attribute' );
            if ( eZContentObject::isObjectRelationTyped() )
            {
                $allRelations[] = 'xml_link';
            }
        }

        $relatedObjectsTyped = array();
        foreach ( $allRelations as $relationType )
        {
            $relatedObjectsTyped[$relationType] =
                eZContentFunctionCollection::fetchReverseRelatedObjects( $objectID, $attributeID, array( $relationType ), false, array(), null );
        }

        $relatedObjectsTypedIDArray = array();
        foreach ( $relatedObjectsTyped as $relationTypeName => $relatedObjectsByType )
        {
            $relatedObjectsTypedIDArray[$relationTypeName] = array();
            foreach ( $relatedObjectsByType['result'] as $relatedObjectByType )
            {
                $relatedObjectsTypedIDArray[$relationTypeName][] = $relatedObjectByType->ID;
            }
        }

        return array( 'result' =>$relatedObjectsTypedIDArray );
    }
static public function fetchReverseRelatedObjectsID( $objectID, $attributeID, $allRelations )
    {
        if ( !is_array( $allRelations ) || $allRelations === array() )
        {
            $allRelations = array( 'common', 'xml_embed', 'attribute' );
            if ( eZContentObject::isObjectRelationTyped() )
            {
                $allRelations[] = 'xml_link';
            }
        }

        $relatedObjectsTyped = array();
        foreach ( $allRelations as $relationType )
        {
            $relatedObjectsTyped[$relationType] =
                eZContentFunctionCollection::fetchReverseRelatedObjects( $objectID, $attributeID, array( $relationType ), false, array(), null );
        }

        $relatedObjectsTypedIDArray = array();
        foreach ( $relatedObjectsTyped as $relationTypeName => $relatedObjectsByType )
        {
            $relatedObjectsTypedIDArray[$relationTypeName] = array();
            foreach ( $relatedObjectsByType['result'] as $relatedObjectByType )
            {
                $relatedObjectsTypedIDArray[$relationTypeName][] = $relatedObjectByType->ID;
            }
        }

        return array( 'result' =>$relatedObjectsTypedIDArray );
    }
static public function fetchReverseRelatedObjectsID ( $ objectID , $ attributeID , $ allRelations ) { if ( ! is_array ( $ allRelations ) || $ allRelations === array ( ) ) { $ allRelations = array ( 'common' , 'xml_embed' , 'attribute' ) ; if ( eZContentObject :: isObjectRelationTyped ( ) ) { $ allRelations [ ] = 'xml_link' ; } } $ relatedObjectsTyped = array ( ) ; foreach ( $ allRelations as $ relationType ) { $ relatedObjectsTyped [ $ relationType ] = eZContentFunctionCollection :: fetchReverseRelatedObjects ( $ objectID , $ attributeID , array ( $ relationType ) , false , array ( ) , null ) ; } $ relatedObjectsTypedIDArray = array ( ) ; foreach ( $ relatedObjectsTyped as $ relationTypeName => $ relatedObjectsByType ) { $ relatedObjectsTypedIDArray [ $ relationTypeName ] = array ( ) ; foreach ( $ relatedObjectsByType [ 'result' ] as $ relatedObjectByType ) { $ relatedObjectsTypedIDArray [ $ relationTypeName ] [ ] = $ relatedObjectByType -> ID ; } } return array ( 'result' => $ relatedObjectsTypedIDArray ) ; }
Fetches reverse related objects id grouped by relation types
Fetches reverse related objects id grouped by relation types