kernel/classes/ezcontentobjecttreenode.php
static function getParentNodeIdListByContentObjectID( $objectIDs, $groupByObjectId = false, $onlyMainNode = false )
    {
        if ( !$objectIDs )
            return null;
        if ( !is_array( $objectIDs ) )
            $objectIDs = array( $objectIDs );

        $db = eZDB::instance();
        $query = 'SELECT
                    parent_node_id, contentobject_id
                  FROM
                    ezcontentobject_tree
                  WHERE ' . $db->generateSQLINStatement( $objectIDs, 'contentobject_id', false, false, 'int' );

        if ( $onlyMainNode )
        {
            $query .= ' AND node_id = main_node_id';
        }

        $list = $db->arrayQuery( $query );
        $parentNodeIDs = array();
        if ( $groupByObjectId )
        {
            foreach( $list as $item )
            {
                $objectID = $item['contentobject_id'];
                if ( !isset( $parentNodeIDs[$objectID] ) )
                {
                    $parentNodeIDs[$objectID] = array();
                }
                $parentNodeIDs[$objectID][] = $item['parent_node_id'];
            }
        }
        else
        {
            foreach( $list as $item )
            {
                $parentNodeIDs[] = $item['parent_node_id'];
            }
        }
        return $parentNodeIDs;
    }
static function getParentNodeIdListByContentObjectID( $objectIDs, $groupByObjectId = false, $onlyMainNode = false )
    {
        if ( !$objectIDs )
            return null;
        if ( !is_array( $objectIDs ) )
            $objectIDs = array( $objectIDs );

        $db = eZDB::instance();
        $query = 'SELECT
                    parent_node_id, contentobject_id
                  FROM
                    ezcontentobject_tree
                  WHERE ' . $db->generateSQLINStatement( $objectIDs, 'contentobject_id', false, false, 'int' );

        if ( $onlyMainNode )
        {
            $query .= ' AND node_id = main_node_id';
        }

        $list = $db->arrayQuery( $query );
        $parentNodeIDs = array();
        if ( $groupByObjectId )
        {
            foreach( $list as $item )
            {
                $objectID = $item['contentobject_id'];
                if ( !isset( $parentNodeIDs[$objectID] ) )
                {
                    $parentNodeIDs[$objectID] = array();
                }
                $parentNodeIDs[$objectID][] = $item['parent_node_id'];
            }
        }
        else
        {
            foreach( $list as $item )
            {
                $parentNodeIDs[] = $item['parent_node_id'];
            }
        }
        return $parentNodeIDs;
    }
static function getParentNodeIdListByContentObjectID ( $ objectIDs , $ groupByObjectId = false , $ onlyMainNode = false ) { if ( ! $ objectIDs ) return null ; if ( ! is_array ( $ objectIDs ) ) $ objectIDs = array ( $ objectIDs ) ; $ db = eZDB :: instance ( ) ; $ query = 'SELECT
                    parent_node_id, contentobject_id
                  FROM
                    ezcontentobject_tree
                  WHERE ' . $ db -> generateSQLINStatement ( $ objectIDs , 'contentobject_id' , false , false , 'int' ) ; if ( $ onlyMainNode ) { $ query .= ' AND node_id = main_node_id' ; } $ list = $ db -> arrayQuery ( $ query ) ; $ parentNodeIDs = array ( ) ; if ( $ groupByObjectId ) { foreach ( $ list as $ item ) { $ objectID = $ item [ 'contentobject_id' ] ; if ( ! isset ( $ parentNodeIDs [ $ objectID ] ) ) { $ parentNodeIDs [ $ objectID ] = array ( ) ; } $ parentNodeIDs [ $ objectID ] [ ] = $ item [ 'parent_node_id' ] ; } } else { foreach ( $ list as $ item ) { $ parentNodeIDs [ ] = $ item [ 'parent_node_id' ] ; } } return $ parentNodeIDs ; }
Get parent node id's by content object id's.

@static
@since Version 4.1
@param int|array $objectIDs
@param bool $groupByObjectId groups parent node ids by object id they belong to.
@param bool $onlyMainNode limits result to parent node id of main node.

@return array Returns array of parent node id's
Get parent node id s by content object id s .