Process the observer's business logic.

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

        // query whether or not we've to upload the image files
        if ($this->getSubject()->hasCopyImages()) {
            // initialize the image path
            if ($imagePath = $this->getValue(ColumnKeys::IMAGE_PATH)) {
                // upload the file and set the new image path
                $imagePath = $this->getSubject()->uploadFile($imagePath);

                // log a message that the image has been copied
                $this->getSubject()->getSystemLogger()->debug(
                    sprintf('Successfully copied image %s => %s', $imagePath, $imagePath)
                );

                // write the new image path to the target column
                $this->setValue(ColumnKeys::IMAGE_PATH, $imagePath);
            }
        }
    }
1241163
protected function process()
    {

        // initialize the URL key and array for the categories
        $urlKey = null;
        $categories = array();

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

        // explode the path into the category names
        if ($categories = $this->explode($this->getValue(ColumnKeys::PATH), '/')) {
            // initialize the category with the actual category's URL key
            $categoryPaths = array($urlKey);
            // prepare the store view code
            $this->prepareStoreViewCode();
            // load ID of the actual store view
            $storeId = $this->getRowStoreId(StoreViewCodes::ADMIN);

            // iterate over the category names and try to load the category therefore
            for ($i = sizeof($categories) - 1; $i > 1; $i--) {
                try {
                    // prepare the expected category name
                    $categoryPath = implode('/', array_slice($categories, 0, $i));
                    // load the existing category and prepend the URL key the array with the category URL keys
                    $existingCategory = $this->getCategoryByPkAndStoreId($this->mapPath($categoryPath), $storeId);
                    // query whether or not an URL key is available or not
                    if (isset($existingCategory[MemberNames::URL_KEY])) {
                        array_unshift($categoryPaths, $existingCategory[MemberNames::URL_KEY]);
                    } else {
                        $this->getSystemLogger()->debug(sprintf('Can\'t find URL key for category %s', $categoryPath));
                    }
                } catch (\Exception $e) {
                    $this->getSystemLogger()->debug(sprintf('Can\'t load parent category %s', $categoryPath));
                }
            }

            // create the header for the URL path
            if (!$this->hasHeader(ColumnKeys::URL_PATH)) {
                $this->addHeader(ColumnKeys::URL_PATH);
            }

            // set the URL path
            $this->setValue(ColumnKeys::URL_PATH, implode('/', $categoryPaths));
        }
    }
1245982
public function processAbandonedCarts()
    {
        $result = [];
        $stores = $this->helper->getStores();
        $this->acPendingContactUpdater->update();

        foreach ($stores as $store) {
            $storeId = $store->getId();
            $websiteId = $store->getWebsiteId();

            $result = $this->processAbandonedCartsForCustomers($storeId, $websiteId, $result);
            $result = $this->processAbandonedCartsForGuests($storeId, $websiteId, $result);
        }

        return $result;
    }
366726
protected function process()
    {

        // explode the path into the category names
        if ($categories = $this->explode($this->getValue(ColumnKeys::PATH), '/')) {
            // initialize the artefacts and reset the category IDs
            $artefacts = array();
            $this->categoryIds = array(1);

            // iterate over the category names and try to load the category therefore
            for ($i = 0; $i < sizeof($categories); $i++) {
                try {
                    // prepare the expected category name
                    $categoryPath = implode('/', array_slice($categories, 0, $i + 1));
                    // load the existing category
                    $category = $this->loadCategory($this->mapPath($categoryPath));
                    // prepend the ID the array with the category IDs
                    array_push($this->categoryIds, (integer) $category[MemberNames::ENTITY_ID]);
                } catch (\Exception $e) {
                    // log a message that requested category is NOT available
                    $this->getSystemLogger()->debug(sprintf('Can\'t load category %s, create a new one', $categoryPath));

                    // prepare the static entity values, insert the entity and set the entity ID
                    $category = $this->initializeCategory($this->prepareAttributes());

                    // update the persisted category with the entity ID
                    $category[$this->getPkMemberName()] = $this->persistCategory($category);
                    $category[MemberNames::URL_KEY] = $this->getValue(ColumnKeys::URL_KEY);

                    // append the ID of the new category to array with the IDs
                    array_push($this->categoryIds, $category[MemberNames::ENTITY_ID]);
                }
            }

            // temporary persist primary keys
            $this->updatePrimaryKeys($category);

            // prepare the artefact
            $artefact = array(
                $this->getPkMemberName() => $category[$this->getPkMemberName()],
                MemberNames::PATH        => implode('/', $this->categoryIds)
            );

            // put the artefact on the stack
            $artefacts[] = $artefact;

            // add the artefacts
            $this->addArtefacts($artefacts);
        }
    }
370517
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;
        }

        // process the parent instance
        parent::process();

        // remove the path => row ID mapping from the subject
        $this->removePathRowIdMapping($path);
    }
1180497
protected function process()
    {

        // load the path of the category we want to create the URL rewrites for
        $path = $this->getValue(ColumnKeys::PATH);

        // try to load the entity ID for the product with the passed SKU
        if ($category = $this->loadCategory($this->mapPath($path))) {
            $this->setLastEntityId($category[MemberNames::ENTITY_ID]);
        } else {
            // prepare a log message
            $message = sprintf('Category with path "%s" can\'t be loaded to create URL rewrites', $path);
            // query whether or not we're in debug mode
            if ($this->getSubject()->isDebugMode()) {
                $this->getSubject()->getSystemLogger()->warning($message);
                return;
            } else {
                throw new \Exception($message);
            }
        }

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

        // prepare the URL rewrites
        $this->prepareUrlRewrites();

        // initialize and persist the URL rewrite
        if ($urlRewrite = $this->initializeUrlRewrite($this->prepareAttributes())) {
            $this->persistUrlRewrite($urlRewrite);
        }
    }
859798
protected function processTableSeeds()
    {
        foreach ($this->getSeedQueries() as $index => $query) {
            
            if (isset($query['iterate'])) {
                for ($x = 1; $x <= $query['iterate']; $x++) {
                    $this->db->insert($query['table'], $query['record']);
                }
                continue;
            }

            $this->db->insert($query['table'], $query['record']);
        }
    }
95681
protected function doProcessing()
    {
        $this->prepareProcessContext();


        // initialization process pipeline

        $initSteps = $this->initProcessSteps();

        if ( ! empty($initSteps)) {

            $this->context = app(Pipeline::class)
                 ->send($this->context)
                 ->through($initSteps)
                 ->then(function (ProcessContextInterface $context) {

                    return $context;
                 });

            $this->afterInitSteps();
        }


        // main pipeline (actual processing)

        $steps = $this->processSteps();

        if ($this->databaseTransaction) DB::beginTransaction();

        try {

            $this->context = app(Pipeline::class)
                 ->send($this->context)
                 ->through($steps)
                 ->then(function(ProcessContextInterface $context) {

                    if ($this->databaseTransaction) DB::commit();

                    return $context;
                 });

        } catch (Exception $e) {

            if ($this->databaseTransaction) DB::rollBack();

            $this->onExceptionInPipeline($e);

            throw $e;
        }

        $this->afterPipeline();


        $this->populateResult();
    }
922170
public function get(): array
    {
        try {
            $rows = $this->baseQuery->get();
            return array_map([$this, 'processFetchedRow'], $rows);
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
586315
protected function process()
    {
        $this->result = $this[self::RESPONSE_PROCESSING] != self::TYPE_RAW
            ? DefaultResponseParser::getInstance()->parse($this)
            : $this->request->getResponse();
    }
36637
protected function processColumns () {
        // Get a schema manager and get the list of columns
        $sm = $this->conn->getSchemaManager();
        $columns = $sm->listTableColumns($this->tableName);

        $type_lookup = array();

        /**
         * @var $col Column
         */
        foreach($columns as $col) {
            $type_lookup[$col->getName()] = $col;
        }

        foreach($this->colDefs as $item) {
            $id = $item['id'];
            $category = $item['category'];
            $opts = $item['options'];

            /**
             * @var $target SQLColumn
             */
            $target = null;

            switch($category) {
                case SQLColumn::CATEGORY_VALUE:
                    $target = new ValueColumn($id, $category, $opts);
                    break;
                // case "foreign":
                //     $target = new ForeignColumn($id, $category, $opts);
                //     break;
                case SQLColumn::CATEGORY_PRIMARY:
                    $target = new PrimaryColumn($id, $category, $opts);
                    break;
                case SQLColumn::CATEGORY_EXTERNAL:
                    $target = new ExternalColumn ($id, $category, $opts);
                    break;
                default:
                    //TODO: Throw library-specific exceptions
                    throw new \Exception("Unknown category for column $category");
            }

            $target->doctrineColumnLookup($type_lookup);
            $target->init ();

            $this->columns[$id] = $target;
        }
    }
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));
        }
    }
140111
public function process()
	{
		// Get this request's data.
		$this->parseRequest();

		// Perform logic.
		$this->execute();

		// Parse the result of our business logic.
		$this->parseResult();

		// Build the Response utilizing status, type, body, etc.
		$this->buildResponse();

		// Build the broadcasted value.
		$this->buildBroadcast();

		// Broadcast the result to listeners.
		$this->push();

		// Finally, return the Response.
		return $this->respond();
	}
454228
protected function process()
    {

        // load the parent/child SKUs
        $parentSku = $this->getValue(ColumnKeys::VARIANT_PARENT_SKU);
        $childSku = $this->getValue(ColumnKeys::VARIANT_CHILD_SKU);

        // query whether or not the super link has already been processed
        if ($this->hasBeenProcessedRelation($parentSku, $childSku, RelationTypes::VARIANT_SUPER_LINK)) {
            return;
        }

        try {
            // try to load and map the parent ID
            $this->parentId = $this->mapSku($parentSku);
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::VARIANT_PARENT_SKU), $e);
        }

        try {
            // try to load and map the child ID
            $this->childId = $this->mapChildSku($childSku);
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::VARIANT_CHILD_SKU), $e);
        }

        try {
            // prepare and persist the product super link
            if ($productSuperLink = $this->initializeProductSuperLink($this->prepareProductSuperLinkAttributes())) {
                $this->persistProductSuperLink($productSuperLink);
            }

            // mark the super link as processed
            $this->addProcessedRelation($parentSku, $childSku, RelationTypes::VARIANT_SUPER_LINK);
        } catch (\Exception $e) {
            // prepare a more detailed error message
            $message = $this->appendExceptionSuffix(
                sprintf(
                    'Super link with SKUs %s => %s can\'t be created',
                    $parentSku,
                    $childSku
                )
            );

            // if we're NOT in debug mode, re-throw a more detailed exception
            $wrappedException = $this->wrapException(
                array(ColumnKeys::VARIANT_PARENT_SKU, ColumnKeys::VARIANT_CHILD_SKU),
                new \Exception($message, null, $e)
            );

            // query whether or not, debug mode is enabled
            if ($this->isDebugMode()) {
                // log a warning and return immediately
                $this->getSystemLogger()->warning($wrappedException->getMessage());
                return;
            }

            // else, throw the exception
            throw $wrappedException;
        }
    }
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 );
		}
	}
18916
protected function processRowsHeads() {
        $cols = $this->getCols();
        $this->data = $this->rows;
        if (!empty($cols)) {
            array_unshift($this->data, $cols);
        }
        return $this->data;
    }
306074
protected function process()
    {

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

        // initialize the artefacts
        $artefact = array();
        foreach (array_keys($this->getSubject()->getHeaders()) as $columnName) {
            $artefact[$columnName] = $this->getValue($columnName);
        }

        // add the artefacts to the subject
        array_push($artefacts, $artefact);
        $this->addArtefacts($artefacts);
    }