Processes product by setting link type and in case list type is search adds search parameters to details link.

@param object $oProduct Product to process.
354289
protected function _processProduct($oProduct)
    {
        $oProduct->setLinkType($this->getLinkType());
        if ($sAddParams = $this->_getAddUrlParams()) {
            $oProduct->appendLink($sAddParams);
        }
    }
818131
public void setProductViewDetails(java.util.Collection<ProductViewDetail> productViewDetails) {
        if (productViewDetails == null) {
            this.productViewDetails = null;
            return;
        }

        this.productViewDetails = new java.util.ArrayList<ProductViewDetail>(productViewDetails);
    }
36035
protected function process()
    {

        // prepare the store view code
        $this->getSubject()->prepareStoreViewCode();

        // set the entity ID for the product with the passed SKU
        if ($product = $this->loadProduct($this->getValue(ColumnKeys::SKU))) {
            $this->setIds($product);
        } else {
            $this->setIds(array());
        }

        // query whether or not the URL key column has a value
        if ($this->hasValue(ColumnKeys::URL_KEY)) {
            $this->setValue(ColumnKeys::URL_KEY, $this->makeUrlKeyUnique($this->getValue(ColumnKeys::URL_KEY)));
            return;
        }

        // query whether or not a product name is available
        if ($this->hasValue(ColumnKeys::NAME)) {
            $this->setValue(ColumnKeys::URL_KEY, $this->makeUrlKeyUnique($this->convertNameToUrlKey($this->getValue(ColumnKeys::NAME))));
            return;
        }

        // throw an exception, that the URL key can not be initialized and we're in admin store view
        if ($this->getSubject()->getStoreViewCode(StoreViewCodes::ADMIN) === StoreViewCodes::ADMIN) {
            throw new \Exception('Can\'t initialize the URL key because either columns "url_key" or "name" have a value set for default store view');
        }
    }
1014522
protected function _process()
	{
		$this->_msg('Adding product media performance data', 0);


		$context = $this->_getContext();

		$mediaManager = MShop_Media_Manager_Factory::createManager( $context );
		$mediaTypeManager = $mediaManager->getSubManager( 'type' );

		$expr = array();
		$search = $mediaTypeManager->createSearch();
		$expr[] = $search->compare('==', 'media.type.domain', 'product');
		$expr[] = $search->compare('==', 'media.type.code', 'default');
		$search->setConditions( $search->combine( '&&', $expr ) );
		$types = $mediaTypeManager->searchItems($search);

		if ( ($mediaTypeItem = reset($types)) === false) {
			throw new Exception('Media type item not found');
		}


		$productManager = MShop_Product_Manager_Factory::createManager( $context );
		$productListManager = $productManager->getSubManager( 'list' );
		$productListTypeManager = $productListManager->getSubManager( 'type' );

		$expr = array();
		$search = $productListTypeManager->createSearch();
		$expr[] = $search->compare('==', 'product.list.type.domain', 'media');
		$expr[] = $search->compare('==', 'product.list.type.code', 'default');
		$search->setConditions( $search->combine( '&&', $expr ) );
		$types = $productListTypeManager->searchItems($search);

		if ( ($productListTypeItem = reset($types)) === false) {
			throw new Exception('Product list type item not found');
		}

		$expr = array();
		$search = $productListTypeManager->createSearch();
		$expr[] = $search->compare('==', 'product.list.type.domain', 'media');
		$expr[] = $search->compare('==', 'product.list.type.code', 'download');
		$search->setConditions( $search->combine( '&&', $expr ) );
		$types = $productListTypeManager->searchItems($search);

		if ( ($downloadListTypeItem = reset($types)) === false) {
			throw new Exception('Product list type item not found');
		}


		$mediaItem = $mediaManager->createItem();
		$mediaItem->setTypeId( $mediaTypeItem->getId() );
		$mediaItem->setLanguageId( null );
		$mediaItem->setDomain( 'product' );
		$mediaItem->setMimeType( 'image/jpeg' );
		$mediaItem->setStatus( 1 );

		$downloadItem = $mediaManager->createItem();
		$downloadItem->setTypeId( $mediaTypeItem->getId() );
		$downloadItem->setLanguageId( null );
		$downloadItem->setDomain( 'product' );
		$downloadItem->setMimeType( 'application/pdf' );
		$downloadItem->setLabel( 'PDF download' );
		$downloadItem->setPreview( 'unitperf/download-preview.jpg' );
		$downloadItem->setUrl( 'unitperf/download.pdf' );
		$downloadItem->setStatus( 1 );

		$mediaManager->saveItem( $downloadItem );


		$listItem = $productListManager->createItem();
		$listItem->setTypeId( $productListTypeItem->getId() );
		$listItem->setDomain( 'media' );

		$downloadListItem = $productListManager->createItem();
		$downloadListItem->setTypeId( $downloadListTypeItem->getId() );
		$downloadListItem->setRefId( $downloadItem->getId() );
		$downloadListItem->setDomain( 'media' );
		$downloadListItem->setPosition( 0 );


		$search = $productManager->createSearch();
		$search->setSortations( array( $search->sort( '+', 'product.id' ) ) );


		$this->_txBegin();

		$start = $pos = 0;

		do
		{
			$result = $productManager->searchItems( $search );

			foreach ( $result as $id => $item )
			{
				$mediaItem->setId( null );
				$mediaItem->setLabel( '1. picture for ' . $item->getLabel() );
				$mediaItem->setPreview( 'unitperf/' . ( ($pos + 0) % 4 + 1 ) . '.jpg' );
				$mediaItem->setUrl( 'unitperf/' . ( ($pos + 0) % 4 + 1 ) . '-big.jpg' );
				$mediaManager->saveItem( $mediaItem );

				$listItem->setId( null );
				$listItem->setParentId( $id );
				$listItem->setRefId( $mediaItem->getId() );
				$listItem->setPosition( 0 );
				$productListManager->saveItem( $listItem, false );


				$mediaItem->setId( null );
				$mediaItem->setLabel( '2. picture for ' . $item->getLabel() );
				$mediaItem->setPreview( 'unitperf/' . ( ($pos + 1) % 4 + 1 ) . '.jpg' );
				$mediaItem->setUrl( 'unitperf/' . ( ($pos + 1) % 4 + 1 ) . '-big.jpg' );
				$mediaManager->saveItem( $mediaItem );

				$listItem->setId( null );
				$listItem->setParentId( $id );
				$listItem->setRefId( $mediaItem->getId() );
				$listItem->setPosition( 1 );
				$productListManager->saveItem( $listItem, false );


				$mediaItem->setId( null );
				$mediaItem->setLabel( '3. picture for ' . $item->getLabel() );
				$mediaItem->setPreview( 'unitperf/' . ( ($pos + 2) % 4 + 1 ) . '.jpg' );
				$mediaItem->setUrl( 'unitperf/' . ( ($pos + 2) % 4 + 1 ) . '-big.jpg' );
				$mediaManager->saveItem( $mediaItem );

				$listItem->setId( null );
				$listItem->setParentId( $id );
				$listItem->setRefId( $mediaItem->getId() );
				$listItem->setPosition( 2 );
				$productListManager->saveItem( $listItem, false );


				$mediaItem->setId( null );
				$mediaItem->setLabel( '4. picture for ' . $item->getLabel() );
				$mediaItem->setPreview( 'unitperf/' . ( ($pos + 3) % 4 + 1 ) . '.jpg' );
				$mediaItem->setUrl( 'unitperf/' . ( ($pos + 3) % 4 + 1 ) . '-big.jpg' );
				$mediaManager->saveItem( $mediaItem );

				$listItem->setId( null );
				$listItem->setParentId( $id );
				$listItem->setRefId( $mediaItem->getId() );
				$listItem->setPosition( 3 );
				$productListManager->saveItem( $listItem, false );


				$pos++;


				$downloadListItem->setId( null );
				$downloadListItem->setParentId( $id );
				$productListManager->saveItem( $downloadListItem, false );
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );

		$this->_txCommit();


		$this->_status( 'done' );
	}
598808
protected function process()
    {

        // process the link type attributes
        $productLinkAttribute = $this->getProductLinkAttributeByLinkTypeCodeAndAttributeCode($this->getValue(ColumnKeys::LINK_TYPE_CODE), $this->getValue(ColumnKeys::LINK_TYPE_ATTRIBUTE_CODE));

        // try to load the product link attribute
        $this->setProductLinkAttributeId($productLinkAttribute[MemberNames::PRODUCT_LINK_ATTRIBUTE_ID]);

        // load the link attribute data type
        $dataType = $productLinkAttribute[MemberNames::DATA_TYPE];

        // concatenate the initialize/persist method names
        $intializeMethod = sprintf('initializeProductLinkAttribute%s', $dataType);
        $persistMethod = sprintf('persistProductLinkAttribute%s', $dataType);

        // prepare, initialize and persist the product link attribute int entity
        $this->$persistMethod($this->$intializeMethod($this->prepareAttributes()));
    }
101380
protected function _process()
	{
		$this->_msg('Adding product stock performance data', 0);


		$context =  $this->_getContext();

		$productManager = MShop_Factory::createManager( $context, 'product' );
		$productStockManager = $productManager->getSubManager( 'stock' );
		$productWarehouseManager = $productStockManager->getSubManager( 'warehouse' );


		$search = $productWarehouseManager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.stock.warehouse.code', 'default' ) );
		$result = $productWarehouseManager->searchItems( $search );

		if( ( $whItem = reset( $result ) ) === false ) {
			throw new Exception( 'No warehouse with code "default" found' );
		}


		$item = $productStockManager->createItem();
		$search = $productManager->createSearch();
		$search->setSortations( array( $search->sort( '+', 'product.id' ) ) );

		$start = 0;
		$warehouseid = $whItem->getId();
		$stocklevels = array( null, 100, 80, 60, 40, 20, 10, 5, 2, 0 );


		$this->_txBegin();

		do
		{
			$result = $productManager->searchItems( $search );

			foreach ( $result as $id => $product )
			{
				$item->setId( null );
				$item->setProductId( $id );
				$item->setWarehouseId( $warehouseid );
				$item->setStockLevel( current( $stocklevels ) );
				$productStockManager->saveItem( $item );

				if( next( $stocklevels ) === false ) {
					reset( $stocklevels );
				}
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );

		$this->_txCommit();


		$this->_status( 'done' );
	}
87971
protected function submitEditProductClass()
    {
        if ($this->isPosted('delete') && $this->canDeleteProductClass()) {
            $this->deleteProductClass();
        } else if ($this->isPosted('save') && $this->validateEditProductClass()) {
            if (isset($this->data_product_class['product_class_id'])) {
                $this->updateProductClass();
            } else {
                $this->addProductClass();
            }
        }
    }
1147111
protected function _process( $stmt )
	{
		$msg = 'Changing code from "product" to "default" in "mshop_product_type"';
		$this->_msg($msg, 0);

		if ($this->_schema->tableExists('mshop_product_type') )
		{
			$result = $this->_conn->create( $stmt )->execute();
			$cntRows = $result->affectedRows();
			$result->finish();

			if ( $cntRows ) {
				$this->_status( sprintf( 'migrated (%1$d)', $cntRows ) );
			} else {
				$this->_status( 'OK' );
			}
		}
		else
		{
			$this->_status('OK');
		}
	}
227909
protected function process()
    {

        // prepare the store view code
        $this->prepareStoreViewCode($this->getRow());

        // prepare the attributes
        $attr = $this->prepareAttributes();

        // load store/option ID
        $storeId = $attr[MemberNames::STORE_ID];
        $optionId = $attr[MemberNames::OPTION_ID];

        // if the store has already been mapped, return immediately
        if ($this->isMapped($optionId, $storeId)) {
            return;
        }

        // initialize and save the product bundle option value
        if ($bundleOption = $this->initializeBundleOptionValue($attr)) {
            $this->persistProductBundleOptionValue($bundleOption);
        }

        // add the store => option mapping
        $this->addOptionValueStoreMapping($optionId, $storeId);
    }
941876
@Override
	public void cacheResult(CProduct cProduct) {
		entityCache.putResult(CProductModelImpl.ENTITY_CACHE_ENABLED,
			CProductImpl.class, cProduct.getPrimaryKey(), cProduct);

		finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
			new Object[] { cProduct.getUuid(), cProduct.getGroupId() }, cProduct);

		cProduct.resetOriginalValues();
	}
614017
protected function _process()
	{
		$this->_msg('Adding product config attribute performance data', 0);


		$this->_txBegin();

		$attrList = $this->_getAttributeList();

		$this->_txCommit();


		$context =  $this->_getContext();

		$productManager = MShop_Product_Manager_Factory::createManager( $context );
		$productListManager = $productManager->getSubManager( 'list' );
		$productListTypeManager = $productListManager->getSubManager( 'type' );

		$expr = array();
		$search = $productListTypeManager->createSearch();
		$expr[] = $search->compare('==', 'product.list.type.domain', 'attribute');
		$expr[] = $search->compare('==', 'product.list.type.code', 'config');
		$search->setConditions( $search->combine( '&&', $expr ) );
		$types = $productListTypeManager->searchItems($search);

		if ( ($productListTypeItem = reset($types)) === false) {
			throw new Exception('Product list type item not found');
		}


		$search = $productManager->createSearch();
		$search->setSortations( array( $search->sort( '+', 'product.id' ) ) );

		$listItem = $productListManager->createItem();
		$listItem->setTypeId( $productListTypeItem->getId() );
		$listItem->setDomain( 'attribute' );


		$this->_txBegin();

		$start = 0;

		do
		{
			$result = $productManager->searchItems( $search );

			foreach ( $result as $id => $item )
			{
				$pos = 0;
				foreach( $attrList as $attrId => $attrItem )
				{
					$listItem->setId( null );
					$listItem->setParentId( $id );
					$listItem->setRefId( $attrId );
					$listItem->setPosition( $pos++ );

					$productListManager->saveItem( $listItem, false );
				}
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );

		$this->_txCommit();


		$this->_status( 'done' );
	}
136471
private function processCustomLinkbases( &$linkbaseType )
	{
		// $this->log()->info( "Process definition linkbases: " . $this->namespace );
		foreach ( $linkbaseType as $linkbaseRefkey => &$linkbaseRef )
		{
			$this->processCustomLinkbaseArcRoles( $linkbaseRef );
			$linkbaseRef['processed'] = true;
		}
	}
1269030
protected function LoadFromBasketPostProcessData($oBasket, &$aOrderData)
    {
        parent::LoadFromBasketPostProcessData($oBasket, $aOrderData);
        $aOrderData['pkg_shop_currency_id'] = TdbPkgShopCurrency::GetActiveCurrencyId();
    }
379158
protected function process()
    {

        // initialize the array for the links
        $artefacts = array();

        // load the link type mappings
        $linkTypes = $this->getLinkTypeMappings();

        // prepare the links for the found link types and merge the found artefacts
        foreach ($linkTypes as $linkTypeCode => $columns) {
            $artefacts = array_merge($artefacts, $this->prepareArtefacts($linkTypeCode, $columns));
        }

        // append the links to the subject
        $this->addArtefacts($artefacts);
    }
947440
public function setProductId( $productid )
	{
		if ( $productid == $this->getProductId() ) { return; }

		$this->_values['ordprodid'] = (int) $productid;
		$this->setModified();
	}
1065368
public function addCartProduct($cartProduct) {
    if ($this->orderCartContent == null || !is_array($this->orderCartContent)) {
      $this->orderCartContent = array();
    }

    if ($cartProduct instanceof CartProduct) {
      $this->orderCartContent[] = $cartProduct;
    }

    return $this;
  }
152612
protected function _process()
	{
		$this->_msg('Adding product price performance data', 0);


		$context =  $this->_getContext();


		$priceTypeManager = MShop_Factory::createManager( $context, 'price/type' );

		$expr = array();
		$search = $priceTypeManager->createSearch();
		$expr[] = $search->compare('==', 'price.type.domain', 'product');
		$expr[] = $search->compare('==', 'price.type.code', 'default' );
		$search->setConditions( $search->combine( '&&', $expr ) );
		$types = $priceTypeManager->searchItems($search);

		if ( ($priceTypeItem = reset($types)) === false) {
			throw new Exception('Price type item not found');
		}


		$priceManager = MShop_Factory::createManager( $context, 'price' );

		$priceItem = $priceManager->createItem();
		$priceItem->setTypeId( $priceTypeItem->getId() );
		$priceItem->setDomain( 'product' );
		$priceItem->setCurrencyId( 'EUR' );
		$priceItem->setCosts( '0.00' );
		$priceItem->setTaxRate( '20.00' );
		$priceItem->setQuantity( 1 );
		$priceItem->setStatus( 1 );


		$productListTypeManager = MShop_Factory::createManager( $context, 'product/list/type' );

		$expr = array();
		$search = $productListTypeManager->createSearch();
		$expr[] = $search->compare('==', 'product.list.type.code', 'default');
		$expr[] = $search->compare('==', 'product.list.type.domain', 'price');
		$search->setConditions( $search->combine( '&&', $expr ) );
		$types = $productListTypeManager->searchItems($search);

		if ( ($listTypeItem = reset($types)) === false) {
			throw new Exception('Product list type item not found');
		}


		$productListManager = MShop_Factory::createManager( $context, 'product/list' );

		$listItem = $productListManager->createItem();
		$listItem->setTypeId( $listTypeItem->getId() );
		$listItem->setDomain( 'price' );
		$listItem->setPosition( 0 );


		$productManager = MShop_Factory::createManager( $context, 'product' );

		$search = $productManager->createSearch();
		$search->setSortations( array( $search->sort( '+', 'product.id' ) ) );

		$start = 0;
		$price = 100;
		$value = +1;

		$this->_txBegin();

		do
		{
			$result = $productManager->searchItems( $search );

			foreach ( $result as $id => $item )
			{
				$listItem->setParentId( $id );

				for( $i = 0; $i < 3; $i++ )
				{
					$priceItem->setId( null );
					$priceItem->setLabel( 'from ' . (1 + $i * 5) );
					$priceItem->setQuantity( 1 + $i * 5 );
					$priceItem->setValue( $price - $i * 10 );
					$priceItem->setRebate( $i * 10 );
					$priceManager->saveItem( $priceItem );

					$listItem->setId( null );
					$listItem->setPosition( $i );
					$listItem->setRefId( $priceItem->getId() );
					$productListManager->saveItem( $listItem, false );
				}

				if( $price >= 999 ) {
					$value = -1;
				} else if( $price <= 100 ) {
					$value = +1;
				}

				$price += $value;
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );

		$this->_txCommit();


		$this->_status( 'done' );
	}