Process the observer's business logic.

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

        // initialize the array for the artefacts and the store view codes
        $this->artefacts = array();
        $storeViewCodes = array();

        // load the category path from the row
        $path = $this->getValue(ColumnKeys::PATH);

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

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

        // query whether or not we've a store view code
        if ($storeViewCode === StoreViewCodes::ADMIN) {
            // if not, load the available store view codes for the root category of the given path
            $storeViewCodes = $this->getRootCategoryStoreViewCodes($this->getValue(ColumnKeys::PATH));
        } else {
            array_push($storeViewCodes, $storeViewCode);
        }

        // iterate over the available store view codes
        foreach ($storeViewCodes as $storeViewCode) {
            // do not export URL rewrites for the admin store
            if ($storeViewCode === StoreViewCodes::ADMIN) {
                continue;
            }

            // iterate over the store view codes and query if artefacts are already available
            if ($this->hasArtefactsByTypeAndEntityId(CategoryUrlRewriteObserver::ARTEFACT_TYPE, $lastEntityId = $this->getSubject()->getLastEntityId())) {
                // if yes, load the artefacs
                $this->artefacts = $this->getArtefactsByTypeAndEntityId(CategoryUrlRewriteObserver::ARTEFACT_TYPE, $lastEntityId);

                // override the existing data with the store view specific one
                for ($i = 0; $i < sizeof($this->artefacts); $i++) {
                    // query whether or not a URL path has be specfied and the store view codes are equal
                    if ($this->hasValue(ColumnKeys::URL_KEY) && $this->artefacts[$i][ColumnKeys::STORE_VIEW_CODE] === $storeViewCode) {
                        // update the URL path
                        $this->artefacts[$i][ColumnKeys::URL_PATH] = $this->getValue(ColumnKeys::URL_PATH);

                        // also update filename and line number
                        $this->artefacts[$i][ColumnKeys::ORIGINAL_DATA][ColumnKeys::ORIGINAL_FILENAME] = $this->getSubject()->getFilename();
                        $this->artefacts[$i][ColumnKeys::ORIGINAL_DATA][ColumnKeys::ORIGINAL_LINE_NUMBER] = $this->getSubject()->getLineNumber();
                    }
                }
            } else {
                // if no arefacts are available, append new data
                $artefact = $this->newArtefact(
                    array(
                        ColumnKeys::PATH               => $path,
                        ColumnKeys::STORE_VIEW_CODE    => $storeViewCode,
                        ColumnKeys::URL_PATH           => $this->getValue(ColumnKeys::URL_PATH)
                    ),
                    array(
                        ColumnKeys::PATH               => ColumnKeys::PATH,
                        ColumnKeys::STORE_VIEW_CODE    => ColumnKeys::STORE_VIEW_CODE,
                        ColumnKeys::URL_PATH           => ColumnKeys::URL_PATH
                    )
                );

                // append the base image to the artefacts
                $this->artefacts[] = $artefact;
            }
        }

        // append the artefacts that has to be exported to the subject
        $this->addArtefacts($this->artefacts);
    }
1119962
public function process()
    {
        $this->processFields();

        $this->editableFields()->each(function (Field $field) {
            $field->placeholder($field->description());
            $field->setNewValue($this->getInput($field->elementName()));

            if ($field->hasValidNewValue()) {
                $field->applyFilter($this->query);
            }
        });

        if ($this->paginatorEnabled) {
            $this->paginator();
        }
    }
412407
public function process()
    {
        parent::process();

        $form = $this->getForm();
        $data = &$form->getFormData();
        $this->values = array();
        if ($data[$this->id] !== '') {
            $values = explode(',', $data[$this->id]);
            foreach ($values as $value) {
                $value = SwatString::signedUnserialize(
                    $value,
                    $form->getSalt()
                );

                $this->values[] = $value;
            }
        }
    }
1152911
public function process()
    {
        /*
         | Check for argument database name if not given we will use default
         |  database connection
         */
        $this->database = (!is_null($this->argument('database'))) ?
            $this->argument('database') :
            $this->table()->getDefaultDatabaseConnection();

        $this->tableName = (!is_null($this->argument('name'))) ?
            $this->argument('name') :
            'Form';

        $this->columns = $this->getColumns();
        $this->applicationDir = realpath(CYGNITE_BASE.DS.APPPATH);
        $this->generateForm();

        $this->info('Form '.APPPATH.'/Form/'.Inflector::classify($this->tableName).'Form'.EXT.' Generated Successfully!.');
    }
839926
public function process()
	{
		$view = $this->getView();
		$context = $this->_getContext();

		try
		{
			parent::process();
		}
		catch( Client_Html_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'client/html', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( Controller_Frontend_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( MShop_Plugin_Provider_Exception $e )
		{
			$errors = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$errors = array_merge( $errors, $this->_translatePluginErrorCodes( $e->getErrorCodes() ) );

			$view->summaryErrorCodes = $e->getErrorCodes();
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $errors;
		}
		catch( MShop_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( Exception $e )
		{
			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );

			$error = array( $context->getI18n()->dt( 'client/html', 'A non-recoverable error occured' ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
	}
150908
public function process()
	{
		$view = $this->getView();

		try
		{
			parent::process();

			$basketCntl = Controller_Frontend_Factory::createController( $this->_getContext(), 'basket' );

			// Test if addresses are available
			$addresses = $basketCntl->get()->getAddresses();
			if( !isset( $view->standardStepActive ) && count( $addresses ) === 0 )
			{
				$view->standardStepActive = 'address';
				return false;
			}
		}
		catch( Exception $e )
		{
			$this->getView()->standardStepActive = 'address';
			throw $e;
		}

	}
1369368
public function process()
    {

        // load all available categories
        $categories = $this->getImportProcessor()->getCategories();

        // update the categories children count
        foreach ($categories as $category) {
            // load the category itself
            $this->category = $this->loadCategory($pk = $this->getPrimaryKey($category));

            // update the category's children count
            $this->persistCategory($this->initializeCategory($this->prepareAttributes()));

            // write a log message
            $this->getSystemLogger()->debug(
                sprintf('Successfully updated category with primary key %d', $pk)
            );
        }
    }
649646
protected function process()
    {

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

        // load the email with the column keys of the customer-address CSV file
        $email = $this->getValue(\TechDivision\Import\Customer\Utils\ColumnKeys::EMAIL);

        $artefacts[] = $this->newArtefact(
            array(
                ColumnKeys::ENTITY_ID                => null,
                ColumnKeys::EMAIL                    => $email,
                ColumnKeys::WEBSITE                  => $this->getValue(ColumnKeys::WEBSITE),
                ColumnKeys::CITY                     => $this->getValue(ColumnKeys::ADDRESS_CITY),
                ColumnKeys::COMPANY                  => $this->getValue(ColumnKeys::ADDRESS_COMPANY),
                ColumnKeys::COUNTRY_ID               => $this->getValue(ColumnKeys::ADDRESS_COUNTRY_ID),
                ColumnKeys::FAX                      => $this->getValue(ColumnKeys::ADDRESS_FAX),
                ColumnKeys::FIRSTNAME                => $this->getValue(ColumnKeys::ADDRESS_FIRSTNAME),
                ColumnKeys::LASTNAME                 => $this->getValue(ColumnKeys::ADDRESS_LASTNAME),
                ColumnKeys::MIDDLENAME               => $this->getValue(ColumnKeys::ADDRESS_MIDDLENAME),
                ColumnKeys::POSTCODE                 => $this->getValue(ColumnKeys::ADDRESS_POSTCODE),
                ColumnKeys::PREFIX                   => $this->getValue(ColumnKeys::ADDRESS_PREFIX),
                ColumnKeys::REGION                   => $this->getValue(ColumnKeys::ADDRESS_REGION),
                ColumnKeys::STREET                   => $this->getValue(ColumnKeys::ADDRESS_STREET),
                ColumnKeys::SUFFIX                   => $this->getValue(ColumnKeys::ADDRESS_SUFFIX),
                ColumnKeys::TELEPHONE                => $this->getValue(ColumnKeys::ADDRESS_TELEPHONE),
                ColumnKeys::VAT_ID                   => $this->getValue(ColumnKeys::ADDRESS_VAT_ID),
                ColumnKeys::ADDRESS_DEFAULT_BILLING  => $this->getValue(ColumnKeys::ADDRESS_DEFAULT_BILLING),
                ColumnKeys::ADDRESS_DEFAULT_SHIPPING => $this->getValue(ColumnKeys::ADDRESS_DEFAULT_SHIPPING)
            ),
            array(
                ColumnKeys::ENTITY_ID                => null,
                ColumnKeys::WEBSITE                  => ColumnKeys::WEBSITE,
                ColumnKeys::EMAIL                    => ColumnKeys::EMAIL,
                ColumnKeys::CITY                     => ColumnKeys::ADDRESS_CITY,
                ColumnKeys::COMPANY                  => ColumnKeys::ADDRESS_COMPANY,
                ColumnKeys::COUNTRY_ID               => ColumnKeys::ADDRESS_COUNTRY_ID,
                ColumnKeys::FAX                      => ColumnKeys::ADDRESS_FAX,
                ColumnKeys::FIRSTNAME                => ColumnKeys::ADDRESS_FIRSTNAME,
                ColumnKeys::LASTNAME                 => ColumnKeys::ADDRESS_LASTNAME,
                ColumnKeys::MIDDLENAME               => ColumnKeys::ADDRESS_MIDDLENAME,
                ColumnKeys::POSTCODE                 => ColumnKeys::ADDRESS_POSTCODE,
                ColumnKeys::PREFIX                   => ColumnKeys::ADDRESS_PREFIX,
                ColumnKeys::REGION                   => ColumnKeys::ADDRESS_REGION,
                ColumnKeys::STREET                   => ColumnKeys::ADDRESS_STREET,
                ColumnKeys::SUFFIX                   => ColumnKeys::ADDRESS_SUFFIX,
                ColumnKeys::TELEPHONE                => ColumnKeys::ADDRESS_TELEPHONE,
                ColumnKeys::VAT_ID                   => ColumnKeys::ADDRESS_VAT_ID,
                ColumnKeys::ADDRESS_DEFAULT_BILLING  => ColumnKeys::ADDRESS_DEFAULT_BILLING,
                ColumnKeys::ADDRESS_DEFAULT_SHIPPING => ColumnKeys::ADDRESS_DEFAULT_SHIPPING
            )
        );

        // append the links to the subject
        $this->addArtefacts($artefacts);
    }
1098574
public function process()
    {

        // Initialize the query library we are using
        $class = new \ReflectionClass($this->queryLibrary);

        // Set the query pointer to the new instance of the library
        $this->query = $class->newInstance();

        unset($class);

        // Define the return
        $results = [];

        // @todo: Add break up into loop to split large arrays into smaller chunks

        // Do server challenge(s) first, if any
        $this->doChallenges();

        // Do packets for server(s) and get query responses
        $this->doQueries();

        // Now we should have some information to process for each server
        foreach ($this->servers as $server) {
            /* @var $server \GameQ\Server */

            // Parse the responses for this server
            $result = $this->doParseResponse($server);

            // Apply the filters
            $result = array_merge($result, $this->doApplyFilters($result, $server));

            // Sort the keys so they are alphabetical and nicer to look at
            ksort($result);

            // Add the result to the results array
            $results[$server->id()] = $result;
        }

        return $results;
    }
186789
public function process()
    {
        if ($this->cache !== null) {
            return $this->cache;
        } else {
            return ($this->cache = UriTemplate::expand($this->template, $this->data));
        }
    }
1173974
public function process()
    {
        $gridField = $this->getGridField();

        if ($this->Columns) {
            $columns = $this->Columns;
        } elseif ($dataCols = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class)) {
            $columns = $dataCols->getDisplayFields($gridField);
        } else {
            $columns = singleton($gridField->getModelClass())->summaryFields();
        }

        if ($this->IncludeHeader && !$this->HeadersOutput) {
            $this->outputHeader($gridField, $columns);
            $this->HeadersOutput = true;
        }

        $chunkSize = $this->config()->get('chunk_size');

        $this->outputRows($gridField, $columns, $this->currentStep, $chunkSize);

        $this->currentStep += $chunkSize;

        if ($this->currentStep >= $this->totalSteps) {
            // Check to see if we need to wait for some time for asset synchronisation to complete
            $sleepTime = (int) $this->config()->get('sync_sleep_seconds');
            if ($sleepTime > 0) {
                sleep($sleepTime);
            }

            $this->isComplete = true;
        }
    }
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 );
		}
	}
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();
    }
103454
protected function process()
    {

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

        // prepare the static entity values
        $product = $this->initializeProduct($this->prepareAttributes());

        // insert the entity and set the entity ID, SKU and attribute set
        $this->setLastRowId($this->persistProduct($product));
        $this->setLastEntityId($product[MemberNames::ENTITY_ID]);
    }
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);
        }
    }
1319994
public function process()
	{
		$view = $this->getView();
		$context = $this->getContext();
		$ids = (array) $view->param( 'wat_id', [] );

		try
		{
			if( $context->getUserId() != null && !empty( $ids ) )
			{
				switch( $view->param( 'wat_action' ) )
				{
					case 'add':
						$this->addItems( $view, $ids ); break;
					case 'edit':
						$this->editItems( $view, $ids ); break;
					case 'delete':
						$this->deleteItems( $view, $ids ); break;
				}
			}

			parent::process();
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->watchErrorList = $view->get( 'watchErrorList', [] ) + $error;
		}
		catch( \Aimeos\Controller\Frontend\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->watchErrorList = $view->get( 'watchErrorList', [] ) + $error;
		}
		catch( \Aimeos\Client\Html\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
			$view->watchErrorList = $view->get( 'watchErrorList', [] ) + $error;
		}
		catch( \Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
			$view->watchErrorList = $view->get( 'watchErrorList', [] ) + $error;
			$this->logException( $e );
		}
	}
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);
    }