@param LoopResult $loopResult

@return LoopResult
540784
public function parseResults(LoopResult $loopResult)
    {
        $moduleCode = $this->getModule();

        if (null === $module = ModuleQuery::create()->filterByCode($moduleCode, Criteria::LIKE)->findOne()) {
            throw new \InvalidArgumentException("Module with code '$moduleCode' does not exists.");
        }

        $configValue = ModuleConfigQuery::create()->getConfigValue(
            $module->getId(),
            $this->getVariable(),
            $this->getDefaultValue(),
            $this->getLocale()
        );

        $loopResultRow = new LoopResultRow();

        $loopResultRow
            ->set("VARIABLE", $this->getVariable())
            ->set("VALUE", $configValue)
        ;

        $loopResult->addRow($loopResultRow);

        return $loopResult;
    }
590774
protected function getLoopResults($loopParams)
    {
        $loop = $this->getLoop();
        $loop->initializeArgs(
            array_merge($this->defaultLoopArgs, $loopParams)
        );

        return $loop->exec($pagination);
    }
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);
            }
        }
    }
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;
    }
898304
public function selectOne( $query, $bindings = [] )
	{
		$query = $this->bind_params( $query, $bindings );

		$result = $this->db->get_row( $query );

		if ( $result === false || $this->db->last_error ) {
			throw new QueryException( $query, $bindings, new \Exception( $this->db->last_error ) );
		}

		return $result;
	}
681229
protected function extendsParseResults(LoopResult $loopResult)
    {
        $eventName = $this->getDispatchEventName(TheliaEvents::LOOP_EXTENDS_PARSE_RESULTS);
        if (null !== $eventName) {
            $this->dispatcher->dispatch(
                $eventName,
                new LoopExtendsParseResultsEvent($this, $loopResult)
            );
        }

        return $loopResult;
    }
1024880
private function batchesFinished($batchesResult)
    {
        $allfinished = true;
        foreach ($batchesResult as $key => $batch) {
            if ($batch['Status'] != 'Completed') {
                $allfinished = false;
            }
        }
        return $allfinished;
    }
604459
private function parseQueryResult($result = [])
    {
        $rdsDeliveryExecution = new RdsDeliveryExecution($this);

        if (array_key_exists(self::COLUMN_ID, $result)) {
            $rdsDeliveryExecution->setIdentifier($result[self::COLUMN_ID]);
        }

        if (array_key_exists(self::COLUMN_LABEL, $result)) {
            $rdsDeliveryExecution->setLabel($result[self::COLUMN_LABEL]);
        }

        if (array_key_exists(self::COLUMN_DELIVERY_ID, $result)) {
            $rdsDeliveryExecution->setDelivery($result[self::COLUMN_DELIVERY_ID]);
        }

        if (array_key_exists(self::COLUMN_STATUS, $result)) {
            $rdsDeliveryExecution->setState($result[self::COLUMN_STATUS]);
        }

        if (array_key_exists(self::COLUMN_USER_ID, $result)) {
            $rdsDeliveryExecution->setUserIdentifier($result[self::COLUMN_USER_ID]);
        }

        if (array_key_exists(self::COLUMN_STARTED_AT, $result)) {
            $rdsDeliveryExecution->setStartTime(new \DateTime($result[self::COLUMN_STARTED_AT]));
        }

        if (array_key_exists(self::COLUMN_FINISHED_AT, $result)) {
            $rdsDeliveryExecution->setFinishTime(new \DateTime($result[self::COLUMN_FINISHED_AT]));
        }

        return $this->propagate(new DeliveryExecution($rdsDeliveryExecution));
    }
1035789
protected static function loopDecode($data)
    {
        if (is_array($data)) {
            foreach ($data as &$value) {
                $value = self::loopDecode($value);
            }
        } elseif (is_object($data)) {
            return self::loopDecode((array) $data);
        }
        return $data;
    }
1094285
public static function mergeMethodFailures(self $firstMatchResult, self $secondMatchResult)
    {
        if (!$firstMatchResult->isMethodFailure() || !$secondMatchResult->isMethodFailure()) {
            throw new DomainException('Both match results must be method failures');
        }

        return self::fromMethodFailure(array_unique(
            array_merge($firstMatchResult->getAllowedMethods(), $secondMatchResult->getAllowedMethods())
        ));
    }
541313
private function refreshBatchesResult($batchesResult)
    {
        $refreshedBatchsResults = [];
        $mailchimp = $this->getContainer()->get('welp_mailchimp.mailchimp_master');
        foreach ($batchesResult as $key => $batch) {
            $batch = $mailchimp->get("batches/".$batch['id']);
            array_push($refreshedBatchsResults, $batch);
        }
        return $refreshedBatchsResults;
    }
510832
public function createResultResponse($result, JsonRpcRequest $fromRequest = null) : JsonRpcResponse
    {
        return $this->createEmptyResponse($fromRequest)
            ->setResult($result);
    }
1364957
public function setCustomResult(CustomResult $customResult)
    {
        $this->checksForCustomObject();
        if (\count($this->responseBody->getMembers()) > 0) {
            throw new \Exception(self::ERROR_CANNOT_USE_CUSTOM_AND_OTHER_RESOURCES);
        }
        $this->responseBody->addMember($customResult->getSerializer());

        $this->isCustom = true;
    }
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;
    }
401391
public function processResult(array $result) {
        list($result, $isRaw) = array_values($result);

        if(!$isRaw && is_string($result)) {
            return $this->createClone($result);
        }

        return $result;
    }
1081357
private function appendListRowsFromEvents($paginationResult, string $postType)
    {
        $customListRows = Event::fire('post:table_list_rows', [$paginationResult, $postType]);

        foreach($customListRows as $customList){
            if(is_array($customList)) {
                foreach ($customList as $rowID => $rows) {
                    if (isset($paginationResult->items()[$rowID])) {
                        foreach ($rows as $key => $value) {
                            $paginationResult->items()[$rowID]->$key = $value;
                        }
                    }
                }
            }
        }

        return $paginationResult;
    }
448490
function loopTask(arrayResults) {
      arrayResults = Array.prototype.map.call(arrayResults, wrap);
      return series(arrayResults).call(this);
    }