controller/jobs/src/Controller/Jobs/Customer/Email/Watch/Standard.php
protected function getProducts( \Aimeos\MShop\Context\Item\Iface $context, array $prodIds, $stockType )
	{
		$productCodes = $stockMap = [];
		$productItems = $this->getProductItems( $context, $prodIds );

		foreach( $productItems as $productItem ) {
			$productCodes[] = $productItem->getCode();
		}

		foreach( $this->getStockItems( $context, $productCodes, $stockType ) as $stockItem ) {
			$stockMap[ $stockItem->getProductCode() ] = true;
		}

		foreach( $productItems as $productId => $productItem )
		{
			if( !isset( $stockMap[ $productItem->getCode() ] ) ) {
				unset( $productItems[$productId] );
			}
		}

		return $productItems;
	}
protected function getProducts( \Aimeos\MShop\Context\Item\Iface $context, array $prodIds, $stockType )
	{
		$productCodes = $stockMap = [];
		$productItems = $this->getProductItems( $context, $prodIds );

		foreach( $productItems as $productItem ) {
			$productCodes[] = $productItem->getCode();
		}

		foreach( $this->getStockItems( $context, $productCodes, $stockType ) as $stockItem ) {
			$stockMap[ $stockItem->getProductCode() ] = true;
		}

		foreach( $productItems as $productId => $productItem )
		{
			if( !isset( $stockMap[ $productItem->getCode() ] ) ) {
				unset( $productItems[$productId] );
			}
		}

		return $productItems;
	}
protected function getProducts ( \ Aimeos \ MShop \ Context \ Item \ Iface $ context , array $ prodIds , $ stockType ) { $ productCodes = $ stockMap = [ ] ; $ productItems = $ this -> getProductItems ( $ context , $ prodIds ) ; foreach ( $ productItems as $ productItem ) { $ productCodes [ ] = $ productItem -> getCode ( ) ; } foreach ( $ this -> getStockItems ( $ context , $ productCodes , $ stockType ) as $ stockItem ) { $ stockMap [ $ stockItem -> getProductCode ( ) ] = true ; } foreach ( $ productItems as $ productId => $ productItem ) { if ( ! isset ( $ stockMap [ $ productItem -> getCode ( ) ] ) ) { unset ( $ productItems [ $ productId ] ) ; } } return $ productItems ; }
Returns the products for the given IDs which are in stock

@param \Aimeos\MShop\Context\Item\Iface $context Context item object
@param array $prodIds List of product IDs
@param string $stockType Stock type code
Returns the products for the given IDs which are in stock