Process the observer's business logic.

@return array The processed row
359953
protected function process()
    {

        // query whether or not, the image changed
        if ($this->isParentImage($imagePath = $this->getValue(ColumnKeys::IMAGE_PATH))) {
            return;
        }

        // initialize and persist the product media gallery value
        $productMediaGalleryValue = $this->initializeProductMediaGalleryValue($this->prepareAttributes());
        $this->persistProductMediaGalleryValue($productMediaGalleryValue);

        // temporarily persist the image name
        $this->setParentImage($imagePath);
    }
875785
public function process()
    {
        list($action, $ids) = $this->Process->getRequestVars($this->name);
        return $this->Process->make($this->Groups, $action, $ids);
    }
1321306
public function process()
    {
        synapse()->brain->topic()->triggers()->each(function ($data, $trigger) {
            $this->searchTriggers($trigger);

            if ($this->output !== 'Error: Response could not be determined.') {
                return false;
            }
        });

        return $this->output;
    }
297283
protected function process()
    {

        // query whether or not we've found a bundle product
        if ($this->getValue(ColumnKeys::PRODUCT_TYPE) !== ProductTypes::BUNDLE) {
            return;
        }

        // query whether or not, we've a bundle
        if ($bundleValues = $this->getValue(ColumnKeys::BUNDLE_VALUES)) {
            // initialize the array for the product bundles
            $artefacts = array();

            // load the parent SKU from the row
            $parentSku = $this->getValue(ColumnKeys::SKU);

            // initialize the bundle with the found values
            foreach ($this->explode($bundleValues, '|') as $bundleValue) {
                // initialize the product bundle itself
                $bundle = $this->newArtefact(
                    array(
                        ColumnKeys::BUNDLE_PARENT_SKU    => $parentSku,
                        ColumnKeys::STORE_VIEW_CODE      => $this->getValue(ColumnKeys::STORE_VIEW_CODE),
                        ColumnKeys::BUNDLE_SKU_TYPE      => $this->getValue(ColumnKeys::BUNDLE_SKU_TYPE),
                        ColumnKeys::BUNDLE_PRICE_TYPE    => $this->getValue(ColumnKeys::BUNDLE_PRICE_TYPE),
                        ColumnKeys::BUNDLE_PRICE_VIEW    => $this->getValue(ColumnKeys::BUNDLE_PRICE_VIEW),
                        ColumnKeys::BUNDLE_WEIGHT_TYPE   => $this->getValue(ColumnKeys::BUNDLE_WEIGHT_TYPE),
                        ColumnKeys::BUNDLE_SHIPMENT_TYPE => $this->getValue(ColumnKeys::BUNDLE_SHIPMENT_TYPE),
                    ),
                    array(
                        ColumnKeys::BUNDLE_PARENT_SKU        => ColumnKeys::SKU,
                        ColumnKeys::STORE_VIEW_CODE          => ColumnKeys::STORE_VIEW_CODE,
                        ColumnKeys::BUNDLE_SKU_TYPE          => ColumnKeys::BUNDLE_SKU_TYPE,
                        ColumnKeys::BUNDLE_PRICE_TYPE        => ColumnKeys::BUNDLE_PRICE_TYPE,
                        ColumnKeys::BUNDLE_PRICE_VIEW        => ColumnKeys::BUNDLE_PRICE_VIEW,
                        ColumnKeys::BUNDLE_WEIGHT_TYPE       => ColumnKeys::BUNDLE_WEIGHT_TYPE,
                        ColumnKeys::BUNDLE_SHIPMENT_TYPE     => ColumnKeys::BUNDLE_SHIPMENT_TYPE,
                        ColumnKeys::BUNDLE_VALUE_NAME        => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_TYPE        => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_REQUIRED    => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_SKU         => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_PRICE       => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_DEFAULT     => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_DEFAULT_QTY => ColumnKeys::BUNDLE_VALUES,
                        ColumnKeys::BUNDLE_VALUE_PRICE_TYPE  => ColumnKeys::BUNDLE_VALUES
                    )
                );

                // initialize the columns
                foreach ($this->columns as $columnKey) {
                    $bundle[$columnKey] = null;
                }

                // set the values
                $values = array();
                foreach (explode(',', $bundleValue) as $values) {
                    list ($key, $value) = explode('=', $values);
                    $bundle[$this->columns[$key]] = $value;
                }

                // prepare and append the bundle data
                $artefacts[] = $bundle;
            }

            // append the bundles to the subject
            $this->addArtefacts($artefacts);
        }
    }
1014601
protected function processResults()
    {
        try {
            $this->log("Processing new result set.", Project::MSG_VERBOSE);

            $formatters = $this->getConfiguredFormatters();

            while ($row = $this->statement->fetch($this->fetchMode)) {
                foreach ($formatters as $formatter) {
                    $formatter->processRow($row);
                }
            }
        } catch (Exception $x) {
            $this->log("Error processing reults: " . $x->getMessage(), Project::MSG_ERR);
            foreach ($formatters as $formatter) {
                $formatter->close();
            }
            throw $x;
        }
    }
1096679
protected function processCurrentTable()
	{
		$firstRow = $this->table['rows'][0];
		$lastRow  = end($this->table['rows']);
		$this->createTableTags($firstRow['pos'], $lastRow['pos'] + strlen($lastRow['line']));

		$this->addTableHead();
		$this->createSeparatorTag($this->table['rows'][1]);
		$this->addTableBody();
	}
731019
protected function process()
    {

        // query whether or not, we've found a new path => means we've found a new category
        if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {
            return;
        }

        // load the category by it's path
        $category = $this->loadCategory($this->mapPath($path));

        // FIRST delete the data related with the category with the passed category path
        $this->deleteUrlRewrite(array(ColumnKeys::PATH => $category[MemberNames::PATH]), SqlStatementKeys::DELETE_URL_REWRITE_BY_PATH);
        $this->deleteUrlRewrite(array(MemberNames::CATEGORY_ID => $category[$this->getPkMemberName()]), SqlStatementKeys::DELETE_URL_REWRITE_BY_CATEGORY_ID);

        // delete the category with the passed path
        $this->deleteCategory(array(ColumnKeys::PATH => $category[MemberNames::PATH]));

        // remove the path => entity ID mapping from the subject
        $this->removePathEntityIdMapping($path);

        // store the ID of the last deleted category
        $this->setLastEntityId($category[$this->getPkMemberName()]);
    }
1057493
protected function _processViewArray()
    {
        $smarty = $this->_getSmarty();
        $outputProcessor = oxNew(\OxidEsales\Eshop\Core\Output::class);

        // processing all view data
        foreach ($this->_aViewData as $key => $value) {
            $smarty->assign($key, $value);
        }

        // processing assigned smarty variables
        $newSmartyArray = $outputProcessor->processViewArray($smarty->get_template_vars(), "oxemail");

        foreach ($newSmartyArray as $key => $val) {
            $smarty->assign($key, $val);
        }
    }
664085
public function processIds()
    {
        $orders = [];
        foreach ($this->scheduledIds as $id) {
            $order = $this->getOrderManager()->findOrderEntityForItemWithId($id);
            if (!in_array($order->getId(), $orders)) {
                $orders[] = $order->getId();
                $order->updateTotalNetPrice();
            }
        }
        unset($this->scheduledIds);
        $this->scheduledIds = [];
        $this->getEntityManager()->flush();
    }
687176
protected function process()
    {

        // load email and website code
        $email = $this->getValue(ColumnKeys::EMAIL);
        $website = $this->getValue(ColumnKeys::WEBSITE);

        // query whether or not, we've found a customer identifier => means we've found a new customer
        if ($this->isLastIdentifier(array($email, $website))) {
            return;
        }

        // delete the customer with the passed identifier
        $this->deleteCustomer(
            array(
                MemberNames::EMAIL      => $email,
                MemberNames::WEBSITE_ID => $this->getStoreWebsiteIdByCode($this->getValue(ColumnKeys::WEBSITE))
            )
        );

        // flush the cache to remove the deleted customer (which has previously been cached)
        $this->getCustomerBunchProcessor()->cleanUp();
    }
180123
public function process()
	{
		$view = $this->getView();
		$context = $this->getContext();

		if( $view->param( 'c_step' ) !== 'process'
			|| $view->get( 'standardErrorList', [] ) !== []
			|| $view->get( 'standardStepActive' ) !== null
		) {
			return;
		}

		try
		{
			$orderCntl = \Aimeos\Controller\Frontend::create( $context, 'order' );
			$basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' );


			if ( $view->param( 'cs_order', null ) !== null )
			{
				parent::process();

				$basket = $basketCntl->store();
				$orderItem = $orderCntl->add( $basket->getId(), ['order.type' => 'web'] )->store();

				$context->getSession()->set( 'aimeos/orderid', $orderItem->getId() );
			}
			elseif ( $view->param( 'cp_payment', null ) !== null )
			{
				$parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL;
				$orderItem = $orderCntl->get( $context->getSession()->get( 'aimeos/orderid' ), false );
				$basket = $basketCntl->load( $orderItem->getBaseId(), $parts, false );
			}
			else
			{
				return;
			}

			$total = $basket->getPrice()->getValue() + $basket->getPrice()->getCosts();
			$services = $basket->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT );

			if( $services === [] || $total <= 0 && $this->isSubscription( $basket->getProducts() ) === false )
			{
				$orderCntl->save( $orderItem->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED ) );
			}
			elseif( ( $form = $this->processPayment( $basket, $orderItem ) ) !== null )
			{
				$view->standardUrlNext = $form->getUrl();
				$view->standardMethod = $form->getMethod();
				$view->standardProcessParams = $form->getValues();
				$view->standardUrlExternal = $form->getExternal();
				$view->standardHtml = $form->getHtml();

				return;
			}

			$view->standardUrlNext = $this->getUrlConfirm( $view, [], [] );
			$view->standardMethod = 'POST';
		}
		catch( \Aimeos\Client\Html\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', [] ) + $error;
		}
		catch( \Aimeos\Controller\Frontend\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', [] ) + $error;
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', [] ) + $error;
		}
		catch( \Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
			$view->standardErrorList = $view->get( 'standardErrorList', [] ) + $error;
			$this->logException( $e );
		}
	}
465188
function process(){
		LogMaster::log("DataProcessor object initialized",$_POST);
		
		$results=array();

		$ids=$this->get_ids();
		$rows_data=$this->get_post_values($ids);
		$failed=false;
		
		try{
			if ($this->connector->sql->is_global_transaction())
				$this->connector->sql->begin_transaction();
			
			for ($i=0; $i < sizeof($ids); $i++) { 
				$rid = $ids[$i];
				LogMaster::log("Row data [{$rid}]",$rows_data[$rid]);
				$status = $this->get_operation($rid);
				
				$action=new DataAction($status,$rid,$rows_data[$rid]);
				$results[]=$action;
				$this->inner_process($action);
			}
			
		} catch(Exception $e){
			LogMaster::log($e);
			$failed=true;
		}
		
		if ($this->connector->sql->is_global_transaction()){
			if (!$failed)
				for ($i=0; $i < sizeof($results); $i++)
					if ($results[$i]->get_status()=="error" || $results[$i]->get_status()=="invalid"){
						$failed=true; 
						break;
					}
			if ($failed){
				for ($i=0; $i < sizeof($results); $i++)
					$results[$i]->error();
				$this->connector->sql->rollback_transaction();
			}
			else
				$this->connector->sql->commit_transaction();
		}
		
		$this->output_as_xml($results);
	}
247600
protected function _process()
	{
		$this->_msg('Adding product selection performance data', 0);


		$this->_txBegin();

		$selProducts = $this->_getSelectionProductIds();

		$this->_txCommit();


		$productTypeItem = $this->_getTypeItem( 'product/type', 'product', 'default' );
		$listTypeItem = $this->_getTypeItem( 'product/list/type', 'product', 'default' );


		$productListManager = MShop_Factory::createManager( $this->_getContext(), 'product/list' );

		$listItem = $productListManager->createItem();
		$listItem->setTypeId( $listTypeItem->getId() );
		$listItem->setDomain( 'product' );


		$productManager = MShop_Factory::createManager( $this->_getContext(), 'product' );

		$search = $productManager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.typeid', $productTypeItem->getId() ) );
		$search->setSortations( array( $search->sort( '-', 'product.id' ) ) );


		$this->_txBegin();

		$selCount = count( $selProducts );
		$selPrices = array();
		$start = $num = 0;

		do
		{
			$result = $productManager->searchItems( $search, array( 'price' ) );

			foreach( $result as $id => $product )
			{
				$pos = (int) ( ($num / 9) % $selCount );
				$prices = $product->getRefItems( 'price', 'default', 'default' );
				$selPrices[$pos] = $this->_getLowestPrice( ( isset( $selPrices[$pos] ) ? $selPrices[$pos] : null ), $prices );

				$listItem->setId( null );
				$listItem->setParentId( $selProducts[$pos] );
				$listItem->setRefId( $id );
				$productListManager->saveItem( $listItem, false );


				$pos = (int) ( ($num / 9 + 1) % $selCount );
				$prices = $product->getRefItems( 'price', 'default', 'default' );
				$selPrices[$pos] = $this->_getLowestPrice( ( isset( $selPrices[$pos] ) ? $selPrices[$pos] : null ), $prices );

				$listItem->setId( null );
				$listItem->setParentId( $selProducts[$pos] );
				$listItem->setRefId( $id );
				$productListManager->saveItem( $listItem, false );


				$pos = (int) ( ($num / 9 + 2) % $selCount );
				$prices = $product->getRefItems( 'price', 'default', 'default' );
				$selPrices[$pos] = $this->_getLowestPrice( ( isset( $selPrices[$pos] ) ? $selPrices[$pos] : null ), $prices );

				$listItem->setId( null );
				$listItem->setParentId( $selProducts[$pos] );
				$listItem->setRefId( $id );
				$productListManager->saveItem( $listItem, false );

				$num++;
			}

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

		$this->_txCommit();


		$listTypeItem = $this->_getTypeItem( 'product/list/type', 'price', 'default' );

		$listItem->setTypeId( $listTypeItem->getId() );
		$listItem->setDomain( 'price' );

		$this->_txBegin();

		foreach( $selPrices as $pos => $priceItem )
		{
			$listItem->setId( null );
			$listItem->setRefId( $priceItem->getId() );
			$listItem->setParentId( $selProducts[$pos] );
			$productListManager->saveItem( $listItem, false );
		}

		$this->_txCommit();


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

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

        // load the store view code
        $storeViewCode = $this->getStoreViewCode(StoreViewCodes::ADMIN);

        // check if we're in default store
        if (!$this->isDefaultStore($storeViewCode)) {
            // prepare and initialize the bundle selection price
            $productBundleSelectionPrice = $this->initializeBundleSelectionPrice($this->prepareAttributes());

            // persist the bundle selection price
            $this->persistProductBundleSelectionPrice($productBundleSelectionPrice);
        }
    }
1252533
protected function process()
    {

        // prepare the product link entity
        if ($attr = $this->prepareAttributes()) {
            // initialize the product link entity
            $productLink = $this->initializeProductLink($attr);

            // persist the product link entity and store the link ID
            $this->setLastLinkId($this->persistProductLink($productLink));
        }
    }
680941
protected function process()
    {

        // query whether or not, we've found a new SKU => means we've found a new product
        if ($this->isLastSku($sku = $this->getValue(ColumnKeys::SKU))) {
            return;
        }

        // FIRST delete the data related with the product with the passed SKU
        $this->deleteStockItem(array(ColumnKeys::SKU => $sku), SqlStatementKeys::DELETE_STOCK_ITEM_BY_SKU);
        $this->deleteProductWebsite(array(ColumnKeys::SKU => $sku), SqlStatementKeys::DELETE_PRODUCT_WEBSITE_BY_SKU);
        $this->deleteCategoryProduct(array(ColumnKeys::SKU => $sku), SqlStatementKeys::DELETE_CATEGORY_PRODUCT_BY_SKU);

        // delete the product with the passed SKU
        $this->deleteProduct(array(ColumnKeys::SKU => $sku));

        // flush the cache to remove the deleted product (which has previously been cached)
        $this->getProductBunchProcessor()->cleanUp();
    }
1236272
public function process()
    {
        $form = $this->getForm();
        if ($form !== null && $form->isSubmitted()) {
            $data = $form->getFormData();
            if (isset($data[$this->id])) {
                $this->selected_value = $data[$this->id];

                $view = $this->getFirstAncestor('SwatView');
                if ($view !== null) {
                    $selection = new SwatViewSelection(array(
                        $this->selected_value
                    ));

                    $view->setSelection($selection, $this);
                }
            }
        }
    }