Index: kernel/classes/ezcontentobject.php
===================================================================
--- kernel/classes/ezcontentobject.php	(revision 25151)
+++ kernel/classes/ezcontentobject.php	(working copy)
@@ -2865,7 +2865,8 @@
                 $params['SortBy']           - related objects sorting mode.
                             Supported modes: class_identifier, class_name, modified, name, published, section
                 $params['IgnoreVisibility'] - ignores 'hidden' state of related objects if true
-     \param $reverseRelatedObjects : if "true" returns reverse related contentObjects
+                $params['RelatedClassIdentifiers'] - limit returned relations to objects of the specified class identifiers
+       \param $reverseRelatedObjects : if "true" returns reverse related contentObjects
                                      if "false" returns related contentObjects
     */
     function relatedObjects( $fromObjectVersion = false,
@@ -2892,6 +2893,7 @@
         $sortingString = '';
         $sortingInfo = array( 'attributeFromSQL' => '',
                               'attributeWhereSQL' => '' );
+        $relatedClassIdentifiersSQL = '';
 
         $showInvisibleNodesCond = '';
         // process params (only SortBy and IgnoreVisibility currently supported):
@@ -2908,6 +2910,11 @@
             {
                 $showInvisibleNodesCond = self::createFilterByVisibilitySQLString( $params['IgnoreVisibility'] );
             }
+            if ( isset( $params['RelatedClassIdentifiers'] ) )
+            {
+                $relatedClassIdentifiersString = implode( "', '", $params['RelatedClassIdentifiers'] );
+                $relatedClassIdentifiersSQL = "ezcontentclass.identifier IN ('$relatedClassIdentifiersString') AND ";
+            }
         }
 
         $relationTypeMasking = '';
@@ -2931,7 +2938,7 @@
         {
             $relationTypeMasking .= " AND ( relation_type & $relationTypeMask ) <> 0 ";
         }
-
+        
         // Create SQL
         $versionNameTables = ', ezcontentobject_name ';
         $versionNameTargets = ', ezcontentobject_name.name as name,  ezcontentobject_name.real_translation ';
@@ -2968,6 +2975,7 @@
                         ezcontentclass.version=0 AND
                         ezcontentobject.status=" . eZContentObject::STATUS_PUBLISHED . " AND
                         $sortingInfo[attributeWhereSQL]
+                        $relatedClassIdentifiersSQL
                         ezcontentobject_link.op_code='0'
                         $relationTypeMasking
                         $fromOrToContentObjectID
@@ -3038,6 +3046,7 @@
                 $params['SortBy']           - related objects sorting mode.
                             Supported modes: class_identifier, class_name, modified, name, published, section
                 $params['IgnoreVisibility'] - ignores 'hidden' state of related objects if true
+                $params['RelatedClassIdentifiers'] - limit returned relations to objects of the specified class identifiers
     */
     function relatedContentObjectList( $fromObjectVersion = false,
                                        $fromObjectID = false,
Index: kernel/content/ezcontentfunctioncollection.php
===================================================================
--- kernel/content/ezcontentfunctioncollection.php	(revision 25151)
+++ kernel/content/ezcontentfunctioncollection.php	(working copy)
@@ -1192,7 +1192,7 @@
     }
 
     // Fetches reverse related objects
-    static public function fetchRelatedObjects( $objectID, $attributeID, $allRelations, $groupByAttribute, $sortBy, $limit = false, $offset = false, $asObject = true, $loadDataMap = false, $ignoreVisibility = null )
+    static public function fetchRelatedObjects( $objectID, $attributeID, $allRelations, $groupByAttribute, $sortBy, $limit = false, $offset = false, $asObject = true, $loadDataMap = false, $ignoreVisibility = null, $relatedClassIdentifiers = null )
     {
         if ( !is_numeric( $objectID ) )
         {
@@ -1250,6 +1250,11 @@
                 $params['AllRelations'] = eZContentFunctionCollection::contentobjectRelationTypeMask( $allRelations );
             }
         }
+        
+        if ( $relatedClassIdentifiers !== null )
+        {
+            $params['RelatedClassIdentifiers'] = $relatedClassIdentifiers;
+        }
 
         if ( $attributeID && !is_numeric( $attributeID ) && !is_bool( $attributeID ) )
         {
Index: kernel/content/function_definition.php
===================================================================
--- kernel/content/function_definition.php	(revision 25151)
+++ kernel/content/function_definition.php	(working copy)
@@ -1086,6 +1086,10 @@
                                                         array( 'name' => 'ignore_visibility',
                                                                'type' => 'boolean',
                                                                'required' => false,
+                                                               'default' => null ),
+                                                        array( 'name' => 'related_class_identifiers',
+                                                               'type' => 'array',
+                                                               'required' => false,
                                                                'default' => null ) ) );
 
 $FunctionList['related_objects_count'] = array( 'name' => 'object',
