Process the observer's business logic.

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

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

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

        // 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 websites the product is related with
            $websiteCodes = $this->getValue(ColumnKeys::PRODUCT_WEBSITES, array(), array($this, 'explode'));

            // load the store view codes of all websites
            foreach ($websiteCodes as $websiteCode) {
                $storeViewCodes = array_merge($storeViewCodes, $this->getStoreViewCodesByWebsiteCode($websiteCode));
            }
        } else {
            array_push($storeViewCodes, $storeViewCode);
        }

        // iterate over the available image fields
        foreach ($storeViewCodes as $storeViewCode) {
            // iterate over the store view codes and query if artefacts are already available
            if ($this->hasArtefactsByTypeAndEntityId(ProductUrlRewriteObserver::ARTEFACT_TYPE, $lastEntityId = $this->getSubject()->getLastEntityId())) {
                // if yes, load the artefacs
                $this->artefacts = $this->getArtefactsByTypeAndEntityId(ProductUrlRewriteObserver::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 key 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 key
                        $this->artefacts[$i][ColumnKeys::URL_KEY] = $this->getValue(ColumnKeys::URL_KEY);

                        // 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::SKU                => $sku,
                        ColumnKeys::STORE_VIEW_CODE    => $storeViewCode,
                        ColumnKeys::CATEGORIES         => $this->getValue(ColumnKeys::CATEGORIES),
                        ColumnKeys::PRODUCT_WEBSITES   => $this->getValue(ColumnKeys::PRODUCT_WEBSITES),
                        ColumnKeys::VISIBILITY         => $this->getValue(ColumnKeys::VISIBILITY),
                        ColumnKeys::URL_KEY            => $this->getValue(ColumnKeys::URL_KEY)
                    ),
                    array(
                        ColumnKeys::SKU                => ColumnKeys::SKU,
                        ColumnKeys::STORE_VIEW_CODE    => ColumnKeys::STORE_VIEW_CODE,
                        ColumnKeys::CATEGORIES         => ColumnKeys::CATEGORIES,
                        ColumnKeys::PRODUCT_WEBSITES   => ColumnKeys::PRODUCT_WEBSITES,
                        ColumnKeys::VISIBILITY         => ColumnKeys::VISIBILITY,
                        ColumnKeys::URL_KEY            => ColumnKeys::URL_KEY,
                    )
                );

                // 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);
    }
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));
        }
    }
1157825
public function process()
	{
		$view = $this->getView();
		$context = $this->_getContext();
		$ids = $view->param( 'watch-id', array() );

		if( $context->getUserId() != null && !empty( $ids ) )
		{
			$typeItem = $this->_getTypeItem();
			$manager = MShop_Factory::createManager( $context, 'customer/list' );

			$search = $manager->createSearch();
			$expr = array(
				$search->compare( '==', 'customer.list.parentid', $context->getUserId() ),
				$search->compare( '==', 'customer.list.refid', $ids ),
				$search->compare( '==', 'customer.list.domain', 'product' ),
				$search->compare( '==', 'customer.list.typeid', $typeItem->getId() ),
			);
			$search->setConditions( $search->combine( '&&', $expr ) );

			$items = array();
			foreach( $manager->searchItems( $search ) as $item ) {
				$items[ $item->getRefId() ] = $item;
			}


			switch( $view->param( 'watch-action' ) )
			{
				case 'add':

					$search = $manager->createSearch();
					$expr = array(
						$search->compare( '==', 'customer.list.parentid', $context->getUserId() ),
						$search->compare( '==', 'customer.list.typeid', $typeItem->getId() ),
						$search->compare( '==', 'customer.list.domain', 'product' ),
					);
					$search->setConditions( $search->combine( '&&', $expr ) );
					$search->setSlice( 0, 0 );

					$total = 0;
					$manager->searchItems( $search, array(), $total );

					/** client/html/account/watch/default/maxitems
					 * Maximum number of products that can be watched in parallel
					 *
					 * This option limits the number of products that can be watched
					 * after the users added the products to their watch list.
					 * It must be a positive integer value greater than 0.
					 *
					 * Note: It's recommended to set this value not too high as this
					 * leads to a high memory consumption when the e-mails are generated
					 * to notify the customers. The memory used will up to 100*maxitems
					 * of the footprint of one product item including the associated
					 * texts, prices and media.
					 *
					 * @param integer Number of products
					 * @since 2014.09
					 * @category User
					 * @category Developer
					 */
					$max = $context->getConfig()->get( 'client/html/account/watch/default/maxitems', 100 );

					$item = $manager->createItem();
					$item->setParentId( $context->getUserId() );
					$item->setTypeId( $typeItem->getId() );
					$item->setDomain( 'product' );
					$item->setStatus( 1 );

					foreach( (array) $view->param( 'watch-id', array() ) as $id )
					{
						if( $total >= $max )
						{
							$error = array( sprintf( $context->getI18n()->dt( 'client/html', 'You can only watch up to %1$s products' ), $max ) );
							$view->watchErrorList = $view->get( 'watchErrorList', array() ) + $error;
							break;
						}

						if( !isset( $items[$id] ) )
						{
							$item->setId( null );
							$item->setRefId( $id );

							$manager->saveItem( $item );
							$manager->moveItem( $item->getId() );

							$total++;
						}
					}

					break;

				case 'edit':

					foreach( (array) $view->param( 'watch-id', array() ) as $id )
					{
						if( isset( $items[$id] ) )
						{
							$item = $items[$id];

							$config = array(
								'timeframe' => $view->param( 'watch-timeframe', 7 ),
								'price-value' => $view->param( 'watch-price-value', '0.00' ),
								'price' => $view->param( 'watch-price', 0 ),
								'stock' => $view->param( 'watch-stock', 0 ),
							);
							$time = time() + ( $config['timeframe'] + 1 ) * 86400;

							$item->setDateEnd( date( 'Y-m-d 00:00:00', $time ) );
							$item->setConfig( $config );

							$manager->saveItem( $item );
						}
					}

					break;

				case 'delete':

					$listIds = array();

					foreach( (array) $view->param( 'watch-id', array() ) as $id )
					{
						if( isset( $items[$id] ) ) {
							$listIds[] = $items[$id]->getId();
						}
					}

					$manager->deleteItems( $listIds );
					break;
			}
		}

		parent::process();
	}
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;
            }
        }
    }
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);
                }
            }
        }
    }
691912
public function process()
    {
        $value = $this->value();
        if (!is_scalar($value) || $value === '') {
            return false;
        }

        $bool = (bool)$value;

        $nullValue = $this->getConfig('nullValue');
        $comparison = ' !=';
        if (!$bool) {
            $comparison = '';
        }
        if ($nullValue === null) {
            $comparison = ' IS NOT';
            if (!$bool) {
                $comparison = ' IS';
            }
        }

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

            return true;
        }

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

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

        return true;
    }
898026
public function process()
    {
        $entityDefs = $this->getEntityDefs(true);

        $ormMetadata = array();
        foreach($entityDefs as $entityName => $entityMetadata) {

            if (empty($entityMetadata)) {
                $GLOBALS['log']->critical('Orm\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format');
                continue;
            }

            $ormMetadata = Util::merge($ormMetadata, $this->convertEntity($entityName, $entityMetadata));
        }

        $ormMetadata = $this->afterProcess($ormMetadata);

        return $ormMetadata;
    }
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();
        }
    }
1160683
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, initialize and persist the stock status/item
        $this->persistStockItem($this->initializeStockItem($this->prepareStockItemAttributes()));
    }
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);
    }
824874
public function process()
    {
        $remainingChildren = $this->remainingChildren;

        // if there's no more, we're done!
        if (!count($remainingChildren)) {
            $this->isComplete = true;
            $this->handleCompletion();
            return;
        }

        $class = $this->dataClass;
        $ID = array_shift($remainingChildren);

        $record = null;

        if (class_exists('Subsite')) {
            $records = Subsite::get_from_all_subsites($class, ['ID' => $ID]);
            if ($records && $records->exists()) {
                $record = $records->First();
            }
        } else {
            $record = $class::get()->byID($ID);
        }

        if (!$record || !$record->exists()) {
            $message = sprintf('%s ID %s not found!', $class, $ID);
            $this->addMessage($message, 'WARNING');
            Injector::inst()->get(LoggerInterface::class)->warning($message);
        } else {
            $created = $record->dbObject('Created')->Nice();
            $record->delete();
            $this->addMessage(sprintf('Deleted %s ID %s (%s)', $class, $ID, $created), 'WARNING');
        }

        // Update counter
        $this->currentStep++;
        $this->remainingChildren = $remainingChildren;
    }
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();
    }
903612
protected function process()
    {

        // extract the child SKU and attribute code from the row
        $parentSku = $this->getValue(ColumnKeys::VARIANT_PARENT_SKU);
        $attributeCode = $this->getValue(ColumnKeys::VARIANT_ATTRIBUTE_CODE);

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

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

        // preserve the parent ID
        $this->setParentId($this->mapParentSku($parentSku));

        // load the store and set the store ID
        $store = $this->getStoreByStoreCode($this->getStoreViewCode(StoreViewCodes::ADMIN));
        $this->storeId = $store[MemberNames::STORE_ID];

        try {
            // load the EAV attribute with the found attribute code
            $this->eavAttribute = $this->getEavAttributeByAttributeCode($attributeCode);
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::VARIANT_ATTRIBUTE_CODE), $e);
        }

        try {
            // initialize and save the super attribute
            $productSuperAttribute = $this->initializeProductSuperAttribute($this->prepareProducSuperAttributeAttributes());
            $this->productSuperAttributeId = $this->persistProductSuperAttribute($productSuperAttribute);

            // initialize and save the super attribute label
            $productSuperAttributeLabel = $this->initializeProductSuperAttributeLabel($this->prepareProductSuperAttributeLabelAttributes());
            $this->persistProductSuperAttributeLabel($productSuperAttributeLabel);

            // mark the super attribute as processed
            $this->addProcessedRelation($parentSku, $attributeCode, RelationTypes::VARIANT_SUPER_ATTRIBUTE);
        } catch (\Exception $e) {
            // prepare a more detailed error message
            $message = $this->appendExceptionSuffix(
                sprintf(
                    'Super attribute for SKU %s and attribute %s can\'t be created',
                    $parentSku,
                    $attributeCode
                )
            );

            // if we're NOT in debug mode, re-throw a more detailed exception
            $wrappedException = $this->wrapException(
                array(ColumnKeys::VARIANT_PARENT_SKU, ColumnKeys::VARIANT_ATTRIBUTE_CODE),
                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;
        }
    }
1166875
public function process ()
    {
        if ($this->isProcessed)
            return;
        $this->isProcessed = true;
        foreach ($this->getFields() as $field)
            /* @var $field Field */
            $field->preprocess();
        $this->isUserSubmitted = $this->getValue($this->getSubmitConfirmFieldName(), 'false') == 'true' || $this->forceSubmit;
        if ($this->isUserSubmitted) {
            foreach ($this->getFields() as $field)
                $field->restoreValue($this->method);

            $this->activateHandlers();

            if ($this->isValid()) {
                $this->submit();
            }
        }
    }
618224
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();

		// Finally, return the Response.
		return $this->respond();
	}
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();
    }
1320454
public function process() {
		$result = [
			'success' => false,
			'error' => [],
			'count' => 0,
			'legend' => [],
		];
		if (empty($this->data)) {
			Throw new \Exception('You must specify "data" parameter.');
		}
		// if we have fixes to the data
		if (method_exists($this, 'overrides')) {
			$this->overrides();
		}
		// enable gc
		gc_enable();
		// processing one by one
		foreach (array_keys($this->data) as $k) {
			// we continue if we have no rows
			if (count($this->data[$k]['data']) == 0) continue;
			// object
			$model = $this->data[$k]['options']['model'];
			// we exit if primary model does not exists
			$object = new $model();
			$db_object = null;
			$collection_object = null;
			$flag_collection = false;
			// regular model
			$primary_model_name = null;
			$primary_model_object = null;
			if (is_a($object, '\Object\Table')) {
				if (!$object->dbPresent()) continue;
				$db_object = $object->db_object;
				// collection options
				$collection_options = [];
				if (!empty($this->data[$k]['options']['pk'])) {
					$collection_options['pk'] = $this->data[$k]['options']['pk'];
				}
				$collection_options['skip_acl'] = true;
				$collection_object = $model::collectionStatic($collection_options);
			} else if (is_a($object, '\Object\Collection')) { // collections
				if (!$object->primary_model->dbPresent()) continue;
				$collection_object = new $model(['skip_acl' => true]);
				$db_object = $collection_object->primary_model->db_object;
				$flag_collection = true;
			}
			unset($object);
			// start transaction
			if (!empty($db_object)) {
				$db_object->begin();
			}
			// counter & buffer
			$counter = 0;
			$buffer = [];
			do {
				// grab first element from the array
				$v2 = array_shift($this->data[$k]['data']);
				// we need to process overrides
				foreach ($v2 as $k3 => $v3) {
					// if we have a detail
					if (is_array($v3)) {
						foreach ($v3 as $k4 => $v4) {
							foreach ($v4 as $k5 => $v5) {
								if (is_array($v5)) {
									foreach ($v5 as $k6 => $v6) {
										foreach ($v6 as $k7 => $v7) {
											if (strpos($v7, '::id::') === 0) {
												$temp = $this->findAliasedValue($k7, $v7);
												if ($temp !== false) $v2[$k3][$k4][$k5][$k6][$k7] = $temp;
											}
										}
									}
								} else {
									if (!is_string($v5)) continue;
									if (is_numeric($k5)) continue;
									// if we need id
									if (strpos($v5, '::id::') === 0) {
										$temp = $this->findAliasedValue($k5, $v5);
										if ($temp !== false) $v2[$k3][$k4][$k5] = $temp;
									}
								}
							}
						}
					} else if (is_string($v3)) {
						// primary model
						if (strpos($v3, '::primary_model::') === 0) {
							$primary_model_name = str_replace('::primary_model::', '', $v3);
							$primary_model_object = new $primary_model_name();
							$v3 = '::id::' . $primary_model_name;
						}
						// if we need id
						if (strpos($v3, '::id::') === 0) {
							$temp = $this->findAliasedValue($k3, $v3);
							if ($temp !== false) $v2[$k3] = $temp;
							continue;
						}
						// from columns
						if (strpos($v3, '::from::') === 0) {
							$v3 = explode('::', str_replace('::from::', '', $v3));
							$first_type = trim(array_shift($v3));
							$temp = $primary_model_object->{$first_type};
							end($v3);
							$last_type = $v3[key($v3)];
							$v3 = array_key_get($temp, $v3);
							// some overrides
							if ($first_type == 'columns') {
								if ($last_type == 'domain') {
									$v3 = \Object\Data\Domains::getNonSequenceDomain($v3);
								}
								if ($last_type == 'type') {
									$v3 = \Object\Data\Types::getNonSequenceType($v3);
								}
							}
							$v2[$k3] = $v3;
							continue;
						}
					}
				}
				// we need to fix primary keys for details
				if ($flag_collection && !empty($collection_object->data['details'])) {
					foreach ($collection_object->data['details'] as $k25 => $v25) {
						if (empty($v2[$k25])) continue;
						if ($v25['type'] != '1M') continue;
						$temp_key = [];
						foreach ($v25['map'] as $k26 => $v26) {
							$temp_key[$v26] = $v2[$k26];
						}
						foreach ($v2[$k25] as $k27 => $v27) {
							$temp_key2 = [];
							foreach ($v25['pk'] as $v26) {
								$temp_key2[] = $temp_key[$v26] ?? $v27[$v26] ?? null;
							}
							$temp_key2 = implode('::', $temp_key2);
							unset($v2[$k25][$k27]);
							$v2[$k25][$temp_key2] = $v27;
						}
					}
				}
				// add value to buffer
				$buffer[] = $v2;
				// if buffer has 250 rows or we have no data
				if (count($buffer) > 249 || (count($buffer) > 0 && count($this->data[$k]['data']) == 0)) {
					// merge
					$result_insert = $collection_object->mergeMultiple($buffer, [
						'skip_optimistic_lock' => true
					]);
					if (!$result_insert['success']) {
						$result['error'] = $result_insert['error'];
						return $result;
					}
					// # of records and number of changes
					$counter+= $result_insert['count'];
					$buffer = [];
					// free up memory
					gc_collect_cycles();
				}
			} while (count($this->data[$k]['data']) > 0);
			// commit transaction
			if (!empty($db_object)) {
				$db_object->commit();
			}
			// legend
			$result['legend'][] = '         * Process ' . $k . ' changes ' . $counter;
			$result['count']+= $counter;
		}
		if (!empty($result['count'])) {
			array_unshift($result['legend'], '       * import');
		}
		$result['success'] = true;
		return $result;
	}