controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php
protected function addListItems( $productId, array $productIds )
	{
		if( empty( $productIds ) ) {
			return;
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' );
		$item = $manager->createItem();

		foreach( $productIds as $pos => $refid )
		{
			$item->setId( null );
			$item->setParentId( $productId );
			$item->setDomain( 'product' );
			$item->setType( 'bought-together' );
			$item->setPosition( $pos );
			$item->setRefId( $refid );
			$item->setStatus( 1 );

			$manager->saveItem( $item, false );
		}
	}
protected function addListItems( $productId, array $productIds )
	{
		if( empty( $productIds ) ) {
			return;
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' );
		$item = $manager->createItem();

		foreach( $productIds as $pos => $refid )
		{
			$item->setId( null );
			$item->setParentId( $productId );
			$item->setDomain( 'product' );
			$item->setType( 'bought-together' );
			$item->setPosition( $pos );
			$item->setRefId( $refid );
			$item->setStatus( 1 );

			$manager->saveItem( $item, false );
		}
	}
protected function addListItems ( $ productId , array $ productIds ) { if ( empty ( $ productIds ) ) { return ; } $ manager = \ Aimeos \ MShop :: create ( $ this -> getContext ( ) , 'product/lists' ) ; $ item = $ manager -> createItem ( ) ; foreach ( $ productIds as $ pos => $ refid ) { $ item -> setId ( null ) ; $ item -> setParentId ( $ productId ) ; $ item -> setDomain ( 'product' ) ; $ item -> setType ( 'bought-together' ) ; $ item -> setPosition ( $ pos ) ; $ item -> setRefId ( $ refid ) ; $ item -> setStatus ( 1 ) ; $ manager -> saveItem ( $ item , false ) ; } }
Adds products as referenced products to the product list.

@param string $productId Unique ID of the product the given products should be referenced to
@param array $productIds List of position as key and product ID as value
Adds products as referenced products to the product list .