@param LoopResult $loopResult

@return LoopResult
180657
public function parseResults(LoopResult $loopResult)
    {
        /** @var FeatureType $entry */
        foreach ($loopResult->getResultDataCollection() as $entry) {
            $row = new LoopResultRow($entry);
            $row
                ->set("ID", $entry->getId())
                ->set("SLUG", $entry->getSlug())
                ->set("TITLE", $entry->getVirtualColumn('i18n_TITLE'))
                ->set("DESCRIPTION", $entry->getVirtualColumn('i18n_DESCRIPTION'))
                ->set("CSS_CLASS", $entry->getCssClass())
                ->set("PATTERN", $entry->getPattern())
                ->set("INPUT_TYPE", $entry->getInputType())
                ->set("MIN", $entry->getMin())
                ->set("MAX", $entry->getMax())
                ->set("STEP", $entry->getStep())
                ->set("IMAGE_MAX_WIDTH", $entry->getImageMaxWidth())
                ->set("IMAGE_MAX_HEIGHT", $entry->getImageMaxHeight())
                ->set("IMAGE_RATIO", $entry->getImageRatio())
                ->set("IS_MULTILINGUAL_FEATURE_AV_VALUE", $entry->getIsMultilingualFeatureAvValue())
                ->set("HAS_FEATURE_AV_VALUE", $entry->getHasFeatureAvValue())
            ;

            $this->addOutputFields($row, $entry);

            $loopResult->addRow($row);
        }

        return $loopResult;
    }
488424
public function parseResults(LoopResult $loopResult)
    {
        /** @var DealerContact $contact */
        foreach ($loopResult->getResultDataCollection() as $contact) {
            $loopResultRow = new LoopResultRow($contact);

            $loopResultRow
                ->set('ID', $contact->getId())
                ->set('DEALER_ID', $contact->getDealerId())
                ->set('IS_DEFAULT', $contact->getIsDefault());

            if ($contact->hasVirtualColumn('i18n_LABEL')) {
                $loopResultRow->set("LABEL", $contact->getVirtualColumn('i18n_LABEL'));
            }

            $loopResult->addRow($loopResultRow);
        }

        return $loopResult;
    }
377724
public static function fromSearchResult($searchResult)
    {
        $item            = [];
        $item['id']      = $searchResult['id']['videoId'];
        $item['etag']    = null;
        $item['snippet'] = $searchResult['snippet'];
        
        return new self($item);
    }
1261531
public function parseResults(LoopResult $loopResult)
    {
        /** @var Dealer $dealer */
        foreach ($loopResult->getResultDataCollection() as $dealer) {
            $loopResultRow = new LoopResultRow($dealer);

            $loopResultRow
                ->set('ID', $dealer->getId())
                ->set("ADDRESS1", $dealer->getAddress1())
                ->set("ADDRESS2", $dealer->getAddress2())
                ->set("ADDRESS3", $dealer->getAddress3())
                ->set("ZIPCODE", $dealer->getZipcode())
                ->set("CITY", $dealer->getCity())
                ->set("COUNTRY_ID", $dealer->getCountryId())
                ->set("LAT", $dealer->getLatitude())
                ->set("LON", $dealer->getLongitude())
                ->set("CREATE_DATE", $dealer->getCreatedAt())
                ->set("UPDATE_DATE", $dealer->getUpdatedAt())
                ->set("VISIBLE", $dealer->getVisible())
            ;

            if ($dealer->hasVirtualColumn('i18n_TITLE')) {
                $loopResultRow->set("TITLE", $dealer->getVirtualColumn('i18n_TITLE'));
            }

            if ($dealer->hasVirtualColumn('i18n_ACCESS')) {
                $loopResultRow->set("ACCESS", $dealer->getVirtualColumn('i18n_ACCESS'));
            }

            if ($dealer->hasVirtualColumn('i18n_DESCRIPTION')) {
                $loopResultRow->set("DESCRIPTION", $dealer->getVirtualColumn('i18n_DESCRIPTION'));
            }

            if ($this->getWithPrevNextInfo()) {
                $previous = $this->getPrevious($dealer);
                $next = $this->getNext($dealer);
                $loopResultRow
                    ->set("HAS_PREVIOUS", $previous != null ? 1 : 0)
                    ->set("HAS_NEXT", $next != null ? 1 : 0)
                    ->set("PREVIOUS", $previous != null ? $previous->getId() : -1)
                    ->set("NEXT", $next != null ? $next->getId() : -1);
            }

            $loopResult->addRow($loopResultRow);
        }

        return $loopResult;
    }
856550
public static function create( LoopInterface $loop ) {

		// Check clients are installed
		if ( ! static::hasDependency() ) {
			exit(Codes::MOSQUITTO_CLIENTS_NOT_INSTALLED);
		}

		// Check config files presents
		if ( ! file_exists( $_SERVER['HOME'] . '/.config/mosquitto_pub' ) ) {
			exit(Codes::MOSQUITTO_PUB_CONFIG_MISSING);
		}

		if ( ! file_exists( $_SERVER['HOME'] . '/.config/mosquitto_sub' ) ) {
			exit(Codes::MOSQUITTO_SUB_CONFIG_MISSING);
		}

		return new static( $loop );
	}
1090888
public function setErrorResult($errorResult)
    {
        if ($errorResult !== DiagnosticResult::STATUS_WARNING && $errorResult !== DiagnosticResult::STATUS_ERROR) {
            throw new \InvalidArgumentException('Error result must be either DiagnosticResult::STATUS_WARNING or DiagnosticResult::STATUS_ERROR.');
        }
        
        $this->errorResult = $errorResult;
        
        return $this;
    }
1049785
private function refreshBatchesResult($listId, $batchesResult, &$batchesError)
    {
        $refreshedBatchsResults = [];
        foreach ($batchesResult as $key => $batch) {
            $jobId = $batch['JobID'];
            $batch = $this->synchronizer->getJob($listId, $jobId);
            // We need to array merge because Mailjet API doesn't send jobid in response.
            if ($batch[0]['Status'] == 'Error') {
                array_push($batchesError, array_merge(['JobID' => $jobId], $batch[0]));
            } else {
                array_push($refreshedBatchsResults, array_merge(['JobID' => $jobId], $batch[0]));
            }
        }
        return $refreshedBatchsResults;
    }
35759
protected function getNodeTranslation($matchResult)
    {
        // The route matches, now check if it actually exists (needed for proper chain router chaining!)
        $nodeTranslationRepo = $this->getNodeTranslationRepository();

        /* @var NodeTranslation $nodeTranslation */
        $nodeTranslation = $nodeTranslationRepo->getNodeTranslationForUrl(
            $matchResult['url'],
            $matchResult['_locale']
        );

        return $nodeTranslation;
    }
35422
public function parseResults(LoopResult $loopResult)
    {
        foreach ($loopResult->getResultDataCollection() as $filter) {
            $loopResultRow = new LoopResultRow($filter);


            $loopResultRow->set("ID", $filter->getId())
                ->set("IS_TRANSLATED", $filter->getVirtualColumn('IS_TRANSLATED'))
                ->set("LOCALE", $filter->locale)
                ->set("TITLE", $filter->getVirtualColumn('i18n_TITLE'))
                ->set("CODE", $filter->getCode())
                ->set("DESCRIPTION", $filter->getVirtualColumn('i18n_DESCRIPTION'))
                ->set("ACTIVATE", $filter->getActive())
                ->set("TYPE", $filter->getFiltertype());

            $loopResult->addRow($loopResultRow);
        }

        return $loopResult;
    }
1051825
public function merge(Result $otherResult)
    {
        if ($otherResult->errorsExist) {
            $this->mergeProperty($otherResult, 'getErrors', 'addError');
        }
        if ($otherResult->warningsExist) {
            $this->mergeProperty($otherResult, 'getWarnings', 'addWarning');
        }
        if ($otherResult->noticesExist) {
            $this->mergeProperty($otherResult, 'getNotices', 'addNotice');
        }

        /** @var $subResult Result */
        foreach ($otherResult->getSubResults() as $subPropertyName => $subResult) {
            if (array_key_exists($subPropertyName, $this->propertyResults) && $this->propertyResults[$subPropertyName]->hasMessages()) {
                $this->forProperty($subPropertyName)->merge($subResult);
            } else {
                $this->propertyResults[$subPropertyName] = $subResult;
                $subResult->setParent($this);
            }
        }
    }
1192417
function loopTask(arrayResults) {
      arrayResults = Array.prototype.map.call(arrayResults, wrap);
      return parallel(arrayResults).call(this);
    }
235054
public function parseResults(LoopResult $loopResult)
    {
        /** @var DealerShedules $schedules */
        foreach ($loopResult->getResultDataCollection() as $schedules) {
            $loopResultRow = new LoopResultRow($schedules);

            $loopResultRow
                ->set('ID', $schedules->getId())
                ->set('DEALER_ID', $schedules->getDealerId())
                ->set('DAY', $schedules->getDay())
                ->set('DAY_LABEL', $this->getDayLabel($schedules->getDay()))
                ->set('BEGIN', $schedules->getBegin())
                ->set('END', $schedules->getEnd())
                ->set('PERIOD_BEGIN', $schedules->getPeriodBegin())
                ->set('PERIOD_END', $schedules->getPeriodEnd());


            $loopResult->addRow($loopResultRow);
        }

        return $loopResult;
    }
1335011
public function fromArray($itemResultSet)
    {
        if ($itemResultSet instanceof \Closure) {
            $itemResultSet = $itemResultSet($this->table);
        }

        $initialBuild = false;
        if (!$this->entitiesGraph) {
            $initialBuild = true;
        }

        if (is_numeric($itemResultSet)) {
            return $itemResultSet;
        }

        if (!$itemResultSet) {
            return null;
        }

        if ($itemResultSet instanceof Collection) {
            if (0 == $itemResultSet->count()) {
                if ($this->fromArrayResultCallback) {
                    $method = $this->fromArrayResultCallback;
                    return $method([]);
                } else {
                    return [];
                }
            }

            $resultSet = [];
            foreach ($itemResultSet as $offset => $itemSpec) {
                $resultSet[$offset] = $this->fromArray($itemSpec);
            }

            if (isset($this->fromArrayResultCallback)) {
                $method = $this->fromArrayResultCallback;
                return $method($resultSet);
            }

            return $resultSet;
        }

        $initialObject = $itemResultSet;
        if (is_object($itemResultSet)) {
            if (!method_exists($itemResultSet, 'toArray')) {
                throw new \InvalidArgumentException(
                    'The item result set, if an object, must contain the method toArray which converts the result set to a flat array'
                );
            }
            $itemResultSet = $itemResultSet->toArray();
        }

        if ($this->toClassName instanceof \Closure) {
            $subMapper = call_user_func($this->toClassName, $itemResultSet);
        } else {
            $subMapper = $this->toClassName;
        }

        $refl   = new \ReflectionClass($subMapper);
        $entity = $refl->newInstanceWithoutConstructor();

        // Map simple column to properties types
        foreach ($this->columnsToProperties as $columnName => $propertyName) {
            if (array_key_exists($propertyName, $this->propertiesToMappers)) {
                continue;
            }
            $prop = $refl->getProperty($propertyName);
            $prop->setAccessible(true);

            try {
                $value = $this->getValueFromArrayByKey($columnName, $itemResultSet);

                if (array_key_exists($propertyName, $this->propertiesFromArrayCallbacks)) {
                    $value = call_user_func_array(
                        $this->propertiesFromArrayCallbacks[$propertyName],
                        [$value]
                    );
                }

            } catch (\Exception $e) {
                $value = new NotPopulatedPropertyValue($propertyName, get_class($this));
            }

            $prop->setValue($entity, $value);
        }

        // Map simple properties types (that do not have any columns)
        foreach ($this->properties as $propertyName) {
            if (in_array($propertyName, $this->columnsToProperties)) {
                continue;
            }
            $prop = $refl->getProperty($propertyName);
            $prop->setAccessible(true);

            if (array_key_exists($propertyName, $this->propertiesFromArrayCallbacks)) {
                $value = call_user_func_array(
                    $this->propertiesFromArrayCallbacks[$propertyName],
                    [$itemResultSet]
                );
                $prop->setValue($entity, $value);
            }
        }

        // Map Class Types
        foreach ($this->propertiesToClasses as $propertyName => $subMapper) {
            $prop = $refl->getProperty($propertyName);
            $prop->setAccessible(true);

            $value = $subMapper->fromArray(
                $itemResultSet
            );

            $prop->setValue($entity, $value);
        }

        $this->entitiesGraph[get_class($this)] = $entity;

        // Map via Mappers
        foreach ($this->propertiesToMappers as $propertyName => $mapperClassName) {
            $columnName = array_search($propertyName, $this->columnsToProperties);

            /** @var DoplioDataMapper $subMapper */
            $subMapper = $this->resolver->resolve($mapperClassName);
            $subMapper->setEntitiesGraph($this->entitiesGraph);
            $prop = $refl->getProperty($propertyName);
            $prop->setAccessible(true);

            $value = null;

            if (array_key_exists($mapperClassName, $this->entitiesGraph)) {
                $value = $this->entitiesGraph[$mapperClassName];
            } else {
                if (array_key_exists($columnName, $itemResultSet)) {
                    $value                                 = $subMapper->fromArray(
                        $initialObject->$columnName
                    );
                    $this->entitiesGraph[$mapperClassName] = $value;

                    $this->identityMap += $subMapper->identityMap;
                } else {
                    $value = new NotPopulatedPropertyValue($propertyName, get_class($this));
                }
            }

            $prop->setValue($entity, $value);
        }

        if (!is_array($initialObject)) {
            $this->identityMap[] = [
                $initialObject,
                $entity
            ];
        }

        if ($initialBuild) {
            $this->entitiesGraph = [];
        }
        return $entity;
    }
484244
public static function invoke(
        ValidationResultFields $validationResultFields,
        ValidationResultFields $validationResultFieldsMore
    ): ValidationResultFields {
        $code = '';

        if (!$validationResultFields->isValid()) {
            $code = $validationResultFields->getCode();
        }

        if (!$validationResultFieldsMore->isValid()) {
            $code = $validationResultFieldsMore->getCode();
        }

        $isValid = ($validationResultFields->isValid() && $validationResultFieldsMore->isValid());

        $details = array_merge(
            $validationResultFields->getDetails(),
            $validationResultFieldsMore->getDetails()
        );

        $mergedFieldResults = array_merge(
            $validationResultFields->getFieldResults(),
            $validationResultFieldsMore->getFieldResults()
        );

        return new ValidationResultFieldsBasic(
            $isValid,
            $code,
            $details,
            $mergedFieldResults
        );
    }
958197
protected function mapObject($databaseResult)
    {
        foreach ($databaseResult as $column => $value) {
            if (!empty($this->mapping[$column])) {
                list($variable, $modifier) = $this->splitVariableWithModifier($this->mapping[$column]);

                $this->$variable = $this->getMappedValue($databaseResult, $column, $this->mapping[$column]);
            } else {
                $this->$column = $value;
            }
        }
    }
1296257
public function find($defaultResult = null)
    {
        foreach ($this->target as $value) {
            if ($value) {
                return $value;
            }
        }

        return $defaultResult;
    }
1249786
public function setFirstResult($firstResult)
    {
        $this->firstResult = $firstResult;
        $this->state       = self::STATE_DIRTY;

        return $this;
    }