Add next page.

@param Result $result

@return string|null
357344
public function addNextPage(Result $result): ? string
    {
        $query = $result->getQuery();
        $urlParameters = $this->generateQueryUrlParameters($result);
        $page = $query->getPage();
        $nextPage = $page + 1;

        if ((($nextPage - 1) * $query->getSize()) > $result->getTotalHits()) {
            return null;
        }

        $urlParameters['page'] = $nextPage;

        return $this->createUrlByUrlParameters(
            $result,
            $urlParameters
        )['route'];
    }
671581
public function setControllerResult($result)
    {
        $event = $this->getSymfonyEvent();
        if ($event instanceof GetResponseForControllerResultEvent) {
            $event->setControllerResult($result);
        }

        return $this;
    }
85063
function setResult( $result )
    {
        $this->Parameters['result'] = $result;
        $http = eZHTTPTool::instance();
        $http->setSessionVariable( 'ContentUploadParameters', $this->Parameters );
    }
155786
public function create(Result $result)
    {
        $this->om->persist($result);
        $this->om->flush();

        return $result;
    }
1175329
protected function succeed($result = null)
    {
        $this->isFinished = true;
        $this->isSuccess = true;
        $this->result = $result;
    }
1315659
public function setResult($result, $data = null)
    {
        if (null === $result) {
            return $this;
        }

        if (is_numeric($result)) {
            if ($result > 1000) {
                $result = ResultException::factory($result, $data);
            } else {
                $result = new static::$resultClass((int) $result, $data);
            }
        } elseif ($result instanceof ResultException) {
            // continue
        } elseif (is_array($result) && isset($result[self::RESULT_P_GLOBAL_CODE])) {
            $result = ResultException::factory($result[self::RESULT_P_GLOBAL_CODE], $result[self::RESULT_P_DATA]);
        } else {
            $result = new ResultException(ResultException::E_INTERNAL, $result);
        }

        if (!empty($data)) {
            $result->addData($data);
        }

        $this->result = $result;
        $this->setData(self::P_RESULT, [
            self::RESULT_P_GLOBAL_CODE => $result->getGlobalCode(),
            self::RESULT_P_DATA        => $result->getData(),
        ]);

        return $this;
    }
620932
protected function append_result($result)
    {
        $this->meta['count'] += $result->count();

        // append UIDs to global index
        $folder = $result->get_parameters('MAILBOX');
        $index  = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $result->get());

        $this->index = array_merge($this->index, $index);
    }
644265
private static function treatment($result)
    {
        if (is_string($result)) {
            echo $result;
        } elseif ($result instanceof Views) {
            View::show($result);
        }
    }
637729
private function resultToResponse($result) : Response
	{
		switch (true) {
			// Response object
			case $result instanceof Response:
				return $result;
			// String -> transform to response
			case is_string($result) || is_numeric($result):
				return new Response($result);
			// Array -> transform to json response
			case is_array($result) || is_object($result):
				return new JsonResponse($result);
			default:
				throw new Exception('Invalid route handler return value');
		}
	}
1157730
public function addSortBy(
        Result $result,
        string $field,
        string $mode
    ): ? string {
        $urlParameters = $this->generateQueryUrlParameters($result);

        if (
            isset($urlParameters['sort_by'][$field]) &&
            $urlParameters['sort_by'][$field] == $mode
        ) {
            return null;
        }

        if (
            !isset($urlParameters['sort_by']) &&
            SortBy::SCORE === [$field => $mode]
        ) {
            return null;
        }

        unset($urlParameters['sort_by']);

        if (SortBy::SCORE !== [$field => $mode]) {
            $urlParameters['sort_by'][$field] = $mode;
        }

        return $this->createUrlByUrlParameters(
            $result,
            $urlParameters
        )['route'];
    }
739659
protected function getResponse( $result )
    {
        $this->response
             ->setContent( xmlrpc_encode_request(
                    null, $result,
                    array( 'encoding' => 'utf-8' )
                ) );

        return $this->response;
    }
182804
public function prepareResponse($result)
    {
        $response = ['header' => null, 'content' => null];
        $d = "\r\n\r\n"; // Headers and content delimiter

        if (is_string($result) && strpos($result, $d) !== false) {
            list($header, $content) = explode($d, $result, 2);
            if (stripos($header, '100 Continue') !== false && strpos($content, $d) !== false) {
                list($header, $content) = explode($d, $content, 2);
            }
            $response['header'] = $header;
            $response['content'] = htmlentities($content);
        }

        return $response;
    }
826212
public function getNextPage()
    {
        return ($this->record)
            ? $this->getManifest()->getNextPage(
                $this->record->getPath(),
                $this->getEntity()->getPath()
            )
            : null;
    }
339789
public function createResponse($result)
	{
		return Response::make($result, 200, [
			'Content-Type'        => $this->getContentType(),
			'Content-Disposition' => sprintf('attachment; filename="%s"', $this->getFilename()),
		]);
	}
916616
protected function printFooter(\PHPUnit\Framework\TestResult $result): void
    {
        parent::printFooter($result);

        $this->writeNewLine();
        $this->write("Randomized with seed: {$this->seed}");
        $this->writeNewLine();
    }
261513
public function loadMessagesFrom($result)
    {
        // Set message on either a field or the parent form
        foreach ($result->getMessages() as $message) {
            $fieldName = $message['fieldName'];

            if ($fieldName) {
                $owner = $this->fields->dataFieldByName($fieldName) ?: $this;
            } else {
                $owner = $this;
            }

            $owner->setMessage($message['message'], $message['messageType'], $message['messageCast']);
        }
        return $this;
    }
530496
public function convertArticleLayout($result) {
        if (isset($result->chapters)) {
            $result->chapters = array_map(
                array($this, '_convertChapterLayout'),
                $result->chapters->toArray()
            );
        }
    }