Block/Adminhtml/Post/Edit/Tab/Products.php
public function getSelectedRelatedProducts()
    {
        $products = [];
        foreach ($this->getPost()->getRelatedProducts() as $product) {
            $products[$product->getId()] = ['position' => 0];
        }

        return $products;
    }
public function getSelectedRelatedProducts()
    {
        $products = [];
        foreach ($this->getPost()->getRelatedProducts() as $product) {
            $products[$product->getId()] = ['position' => 0];
        }

        return $products;
    }
public function getSelectedRelatedProducts ( ) { $ products = [ ] ; foreach ( $ this -> getPost ( ) -> getRelatedProducts ( ) as $ product ) { $ products [ $ product -> getId ( ) ] = [ 'position' => 0 ] ; } return $ products ; }
Retrieve related products

@return array
Retrieve related products