Updating the paging operation based on the result resource returned from a query.

@param resource $result
@throws LdapConnectionException
327226
public function update($result)
    {
        if (!$this->isEnabled) {
            return;
        }
        $this->resultNumber += $this->pageSize;
        if (!@ldap_control_paged_result_response($this->connection->getResource(), $result, $this->cookie)) {
            throw new LdapConnectionException(
                sprintf('Unable to set paged results response: %s', $this->connection->getLastError())
            );
        }
    }
735545
protected function doSave($result, $cache = null)
    {
        if ($cache === null) {
            $cache = $this->doGet();
        }

        $this->cache->save(
            $cache->expiresAfter($this->lifetime)->set($result)
        );
    }
774556
public void addResult(CmsResourceTypeStatResult result) {

        if (!m_results.contains(result)) {
            m_results.add(result);
            m_updated = false;
        } else {
            m_results.remove(result);
            m_results.add(result);
            m_updated = true;
        }
    }
1368619
public function setResult($requestId, $result)
    {
        $this->requestId = $requestId;
        $this->result    = $result;
        $this->setState(self::RESULT_AVAILABLE);
    }
1110305
private function handleResult($result): void
    {
        if ($result instanceof ActionResultInterface) {
            $result->updateResponse($this->getApplication(), $this->getRequest(), $this->getResponse());

            return;
        }

        if ($result === null) {
            return;
        }

        $this->getResponse()->setContent(json_encode($result));
        $this->getResponse()->setHeader('Content-Type', 'application/json');
    }
855406
public function addResult($result, $value)
    {
        if (! $this->open) {
            return;
        }
        
        if ($value !== null) {
            $this->results[$result] = $value;
        }
    }
64529
private function outputResult($result)
    {
        $this->io->writeln(sprintf('<comment>%s</comment>', $this->app['extend.action.io']->getOutput()), OutputInterface::OUTPUT_PLAIN);

        if ($result === 0) {
            $this->io->success('Autoloaders updated');
            $this->auditLog(__CLASS__, 'Autoloaders updated');
        } else {
            $this->io->error('Autoloaders failed update');
        }

        return $result;
    }
489005
public static function _getRow($result = NULL, $useExceptions = _DbConfig::USE_EXCEPTIONS) {
        if (!self::_isConnected()) {
            self::_createConnection();
        }
        return self::$_db->getRow($result, $useExceptions);
    }
1217201
protected function storeCachedInfo($result)
    {
        $cacheItem = $result;
        $cacheItem['mtime'] = $this->object->mtime;

        $cached = $this->getCachedInfo() ?: [];
        $cached[$this->filePath] = $cacheItem;

        Cache::put($this->dataCacheKey, base64_encode(serialize($cached)), 1440);

        self::$cache[$this->filePath] = $result;
    }
334130
protected function marshalZendResult(Result $result): AuthenticationResult
    {
        $code = Utils::$authResultCodeMap[$result->getCode()];
        //we'll give the user only general error info, to prevent user enumeration attacks
        $message = Utils::$authCodeToMessage[$code];

        $identity = null;
        if ($result->isValid()) {
            $identity = $result->getIdentity();
            //try to convert to array if not already...
            $identity = (array)$identity;
            if (empty($identity)) {
                throw new RuntimeException("Missing identity object or cannot be converted to array");
            }

            $identity = $this->hydrateIdentity($identity);
        }

        return new AuthenticationResult($code, $message, $identity);
    }
1112981
protected function after_update($result) {
        global $DB;

        if (!$result) {
            $this->beforeupdate = null;
            return;
        }

        // The parent ID has changed, we need to fix all the paths of the children.
        if ($this->beforeupdate->get('parentid') != $this->get('parentid')) {
            $beforepath = $this->beforeupdate->get('path') . $this->get('id') . '/';

            $like = $DB->sql_like('path', '?');
            $likesearch = $DB->sql_like_escape($beforepath) . '%';

            $table = '{' . self::TABLE . '}';
            $sql = "UPDATE $table SET path = REPLACE(path, ?, ?) WHERE " . $like;
            $DB->execute($sql, array(
                $beforepath,
                $this->get('path') . $this->get('id') . '/',
                $likesearch
            ));

            // Resolving sortorder holes left after changing parent.
            $table = '{' . self::TABLE . '}';
            $sql = "UPDATE $table SET sortorder = sortorder -1 "
                    . " WHERE  competencyframeworkid = ? AND parentid = ? AND sortorder > ?";
            $DB->execute($sql, array($this->get('competencyframeworkid'),
                                        $this->beforeupdate->get('parentid'),
                                        $this->beforeupdate->get('sortorder')
                                    ));
        }

        $this->beforeupdate = null;
    }
1323437
public function setConnectionResource($resource): void
    {
        if ($this->subtypeConverter instanceof ConnectionAware) {
            $this->subtypeConverter->setConnectionResource($resource);
        }
    }
742641
public function selectFromWriteConnection( $query, $bindings = [ ], $resultClass = null )
	{
		return $this->select( $query, $bindings, false, $resultClass );
	}
1254557
public function setConnectionResource($resource): void
    {
        if ($this->itemConverter instanceof ConnectionAware) {
            $this->itemConverter->setConnectionResource($resource);
        }
    }
412046
protected function cacheResultIfNeeded(LdapOperationInterface $operation, $result, $usedCache, $cacheKey)
    {
        if (!is_null($cacheKey) && !$usedCache) {
            /** @var CacheableOperationInterface $operation */
            $this->cache->set(new CacheItem($cacheKey, $result, $operation->getExpireCacheAt()));
        }

        return $result;
    }
122357
protected function processDetails(Buffer &$buffer, Result &$result)
    {

        // We go until we hit an empty key
        while ($buffer->getLength()) {
            $key = $buffer->readString();
            if (strlen($key) == 0) {
                break;
            }
            $result->add($key, utf8_encode($buffer->readString()));
        }
    }
488244
public function mapResult(ResultIterator $result, $resultType = ArrayType::BOTH) {
		//check numer of rows returned
		if ($result->countRows() == 0)
			return null;

		//get result column types
		$this->columnTypes = $result->getColumnTypes($resultType);
		
		//validate result map (if any)
		if (isset($this->resultMap))
			$this->buildTypeHandlerList();

		//map row
		return $this->map($result->fetchArray($resultType));
	}