Process the observer's business logic.

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

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

        // load the PK
        $pk = $this->getValue($this->getPrimaryKeyColumnName());

        // load the store view - if no store view has been set, we assume the admin
        // store view, which will contain the default (fallback) attribute values
        $storeViewCode = $this->getSubject()->getStoreViewCode(StoreViewCodes::ADMIN);

        // query whether or not the row has already been processed
        if ($this->storeViewHasBeenProcessed($pk, $storeViewCode)) {
            // log a message
            $this->getSystemLogger()->warning(
                $this->getSubject()->appendExceptionSuffix(
                    sprintf(
                        'Attributes for %s "%s" + store view code "%s" has already been processed',
                        $this->getPrimaryKeyColumnName(),
                        $pk,
                        $storeViewCode
                    )
                )
            );

            // return immediately
            return;
        }

        // load the store ID, use the admin store if NO store view code has been set
        $storeId = $this->getSubject()->getRowStoreId(StoreViewCodes::ADMIN);

        // load the image attribute
        $attribute = $this->getEavAttributeByAttributeCode('image');

        // remove the image if one exists
        if ($value = $this->loadVarcharAttribute($pk, $attribute[MemberNames::ATTRIBUTE_ID], $storeId)) {
            $this->deleteVarcharAttribute(array(MemberNames::VALUE_ID => $value[MemberNames::VALUE_ID]));
        }
    }
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);
    }
1010835
protected function process()
    {

        // clean-up the repositories etc. to free memory
        $this->getCustomerAddressBunchProcessor()->cleanUp();

        // temporary persist the last customer address entity ID
        $this->setLastEntityId($this->getValue(ColumnKeys::ENTITY_ID));
    }
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()]);
    }
1025905
public function process()
    {
        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        parent::process();

        foreach ($this->values as $option_value) {
            $this->getEntryWidget($option_value)->process();
        }
    }
778085
protected function _process()
    {
        $name = $this->config('field');
        $this->value = $this->_registry->data($name);
        $this->_processed = true;
    }
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);
	}
841215
protected function process()
    {

        // prepare the static entity values
        $customerAddress = $this->initializeCustomerAddress($this->prepareAttributes());

        // insert the entity and set the entity ID
        $this->setLastEntityId($this->persistCustomerAddress($customerAddress));
    }
1208849
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;
        }

        // query whether or not, product => website relations has been specified
        if (!$this->hasValue(ColumnKeys::PRODUCT_WEBSITES)) {
            return;
        }

        // append the product => website relations found
        $codes = $this->getValue(ColumnKeys::PRODUCT_WEBSITES, array(), array($this, 'explode'));
        foreach ($codes as $code) {
            // set the code of the website that has to be processed
            $this->setCode($code);
            // prepare the product website relation attributes
            $attr = $this->prepareAttributes();

            try {
                // create the product website relation
                $productWebsite = $this->initializeProductWebsite($attr);
                $this->persistProductWebsite($productWebsite);
            } catch (\RuntimeException $re) {
                $this->getSystemLogger()->debug($re->getMessage());
            }
        }
    }
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']);
        }
    }
1122465
public function process()
    {
        $this->form->handleRequest($this->request);
        $this->model = $this->form->getData();

        return $this->form->isSubmitted() && $this->form->isValid() && $this->processForm($this->model);
    }
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();
        }
    }
875785
public function process()
    {
        list($action, $ids) = $this->Process->getRequestVars($this->name);
        return $this->Process->make($this->Groups, $action, $ids);
    }
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);
    }
1338600
protected function process()
    {

        // load the parent/child SKUs
        $parentSku = $parentSku = $this->getValue($parentSkuColumnName = $this->getParentSkuColumnName());
        $childSku = $childSku = $this->getValue($childSkuColumnName = $this->getChildSkuColumnName());

        // query whether or not the product relation has already been processed
        if ($this->hasBeenProcessedRelation($parentSku, $childSku)) {
            return;
        }

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

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

        try {
            // prepare and persist the product relation
            if ($productRelation = $this->initializeProductRelation($this->prepareProductRelationAttributes())) {
                $this->persistProductRelation($productRelation);
            }

            // mark the product relation as processed
            $this->addProcessedRelation($parentSku, $childSku);
        } catch (\Exception $e) {
            // prepare a more detailed error message
            $message = $this->appendExceptionSuffix(
                sprintf(
                    'Product relation 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($parentSkuColumnName, $childSkuColumnName),
                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;
        }
    }
650445
public function process()
    {
        $value = $this->value();
        if (!is_scalar($value)) {
            return false;
        }

        if (is_string($value)) {
            $value = strtolower($value);
        }

        $bool = null;
        if (in_array($value, $this->getConfig('truthy'), true)) {
            $bool = true;
        } elseif (in_array($value, $this->getConfig('falsy'), true)) {
            $bool = false;
        }

        if ($bool !== null) {
            if (!$this->manager()->getRepository() instanceof Table) {
                foreach ($this->fields() as $field) {
                    $this->getQuery()->where([
                        $field => $bool,
                    ]);
                }

                return true;
            }

            $conditions = [];
            foreach ($this->fields() as $field) {
                $conditions[] = [$field => $bool];
            }

            $this->getQuery()->andWhere([$this->getConfig('mode') => $conditions]);
        }

        return false;
    }
922593
protected function process()
    {
        $result = parent::process();
        switch ($this->action) {
            case "update":

                if ($this->on("error")) {
                    $this->status = "modify";
                }
                if ($this->on("success")) {
                    $this->status = "modify";
                    if (in_array('update',$this->back_on)) {
                        $this->redirect = $this->back_url;
                    } else {
                        $this->redirect = $this->url->replace('update' . $this->cid, 'show' . $this->cid)->get();
                    }

                }

                break;
            case "insert":

                if ($this->on("error")) {
                    $this->status = "create";
                }
                if ($this->on("success")) {
                    $this->status = "show";
                    if (in_array('insert',$this->back_on)) {
                        $this->redirect = $this->back_url;
                    } else {
                        $this->redirect = $this->url->remove('insert' . $this->cid)->append('show' . $this->cid, $this->model->getKey())->get();
                    }

                }
                break;
            case "delete":
                if ($this->on("error")) {
                    $this->message(trans('rapyd::rapyd.err'));
                }
                if ($this->on("success")) {
                    if (in_array('do_delete',$this->back_on)) {
                        $this->redirect = $this->back_url;
                    } else {
                        $this->message(trans('rapyd::rapyd.deleted'));
                    }

                }
                break;
        }

        switch ($this->status) {
            case "delete":
                $this->message(trans('rapyd::rapyd.conf_delete'));
                break;
            case "unknow_record":
                $this->message(trans('rapyd::rapyd.err_unknown'));
                break;
        }
    }