Updates the cached MODSEQ value.

@param integer $modseq  MODSEQ value to store.

@return mixed  The MODSEQ of the old value if it was replaced (or false
if it didn't exist or is the same).
325304
protected function _updateModSeq($modseq)
    {
        if (!$this->_initCache(true)) {
            return false;
        }

        $mbox_ob = $this->_mailboxOb();
        $uidvalid = $mbox_ob->getStatus(Horde_Imap_Client::STATUS_UIDVALIDITY);
        $md = $this->_cache->getMetaData($this->_selected, $uidvalid, array(self::CACHE_MODSEQ));

        if (isset($md[self::CACHE_MODSEQ])) {
            if ($md[self::CACHE_MODSEQ] < $modseq) {
                $set = true;
                $sync = $md[self::CACHE_MODSEQ];
            } else {
                $set = false;
                $sync = 0;
            }
            $mbox_ob->setStatus(Horde_Imap_Client::STATUS_SYNCMODSEQ, $md[self::CACHE_MODSEQ]);
        } else {
            $set = true;
            $sync = 0;
        }

        /* $modseq can be 0 - NOMODSEQ - so don't store in that case. */
        if ($set && $modseq) {
            $this->_cache->setMetaData($this->_selected, $uidvalid, array(
                self::CACHE_MODSEQ => $modseq
            ));
        }

        return $sync;
    }
621666
public function update(FaqRequest $request, Faq $faq)
    {
        try {
            $attributes = $request->all();

            $faq->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('faq::faq.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('faq/faq/' . $faq->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('faq/faq/' . $faq->getRouteKey()))
                ->redirect();
        }

    }
1160594
public function updateOrderStatus()
    {
        $orderUpdated = false;
        $order = $this->getOrder();

        if (!is_null($order)) {
            $orderPayment = $this->getOrderPayment();
            $order = $this->recalculateAmounts($order);
            $newOrderStatus = $this->calculateOrderStatus($orderPayment, $order);
            $this->persistNewOrderStatus($order, $newOrderStatus);
            $orderUpdated = true;
        }

        return $orderUpdated;
    }
480157
public function update($file = null)
	{
		$file = ($file ?: $this->file);

		$contents = $this->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));
		$original = '0640';

		if (is_file($file))
		{
			// Track original permissions
			$original = '0' . decoct(fileperms($file) & 0777);

			// First try and make sure the file is writable
			@chmod($file, octdec('0640'));
		}

		$result = file_put_contents($file, $contents);

		if (is_file($file))
		{
			@chmod($file, octdec($original));
		}

		return $result;
	}
988323
public function alterSequence($sequence)
    {
        $commentElt = $this->document->createComment(' alterSequence is not supported (sequence: ' . $sequence->getName() . ')');
        $this->root->appendChild($commentElt);
    }
699575
public function keyUpdated($key)
    {
        if ($this->updated_items === null) {
            $this->assocAdminChoices();
        }

        return in_array($key, $this->updated_items);
    }
1267441
public function decrement($key, $offset = 1)
    {
        return $this->memcached ? $this->memcached->decrement($key, $offset) : false;
    }
95061
public function updateEavCache(EntityInterface $entity)
    {
        if (!$this->config('cacheMap')) {
            return false;
        }

        $attrsById = [];
        foreach ($this->_toolbox->attributes() as $attr) {
            $attrsById[$attr['id']] = $attr;
        }

        if (empty($attrsById)) {
            return true; // nothing to cache
        }

        $query = TableRegistry::get('Eav.EavValues')
            ->find('all')
            ->where([
                'EavValues.eav_attribute_id IN' => array_keys($attrsById),
                'EavValues.entity_id' => $this->_toolbox->getEntityId($entity),
            ])
            ->toArray();

        $values = [];
        foreach ($query as $v) {
            $type = $attrsById[$v->get('eav_attribute_id')]->get('type');
            $name = $attrsById[$v->get('eav_attribute_id')]->get('name');
            $values[$name] = $this->_toolbox->marshal($v->get("value_{$type}"), $type);
        }

        $toUpdate = [];
        foreach ((array)$this->config('cacheMap') as $column => $fields) {
            $cache = [];
            if (in_array('*', $fields)) {
                $cache = $values;
            } else {
                foreach ($fields as $field) {
                    if (isset($values[$field])) {
                        $cache[$field] = $values[$field];
                    }
                }
            }

            $toUpdate[$column] = (string)serialize(new CachedColumn($cache));
        }

        if (!empty($toUpdate)) {
            $conditions = []; // scope to entity's PK (composed PK supported)
            $keys = $this->_table->primaryKey();
            $keys = !is_array($keys) ? [$keys] : $keys;
            foreach ($keys as $key) {
                // TO-DO: check key exists in entity's visible properties list.
                // Throw an error otherwise as PK MUST be correctly calculated.
                $conditions[$key] = $entity->get($key);
            }

            if (empty($conditions)) {
                return false;
            }

            return (bool)$this->_table->updateAll($toUpdate, $conditions);
        }

        return true;
    }
530601
public function replace($key, $value, $expiration = 0)
    {
        return $this->memcached ? $this->memcached->replace($key, $value, $expiration) : false;
    }
1019183
protected function getSequence()
    {
        return $this->getRequest()->args('version') || $this->getRequest()->args('release')
            ? ($this->getRequest()->args('release') === null
                ? ''
                : $this->getRequest()->args('release'))
            : $this->modx->version['full_version'];
    }
1080104
public function updateFromRequest(Key $key, Request $request)
    {
        $key = parent::updateFromRequest($key, $request);

        return $this->saveFromRequest($key, $request);
    }
104034
protected function isValidModification($mod)
    {
        return is_array($mod) &&
            array_key_exists(BatchModification::KEY_MODTYPE, $mod) &&
            array_key_exists(BatchModification::KEY_ATTRIB, $mod);
    }
1266734
public static function fromASN1(Sequence $seq): self
    {
        $tbsCert = TBSCertificate::fromASN1($seq->at(0)->asSequence());
        $algo = AlgorithmIdentifier::fromASN1($seq->at(1)->asSequence());
        if (!$algo instanceof SignatureAlgorithmIdentifier) {
            throw new \UnexpectedValueException(
                "Unsupported signature algorithm " . $algo->oid() . ".");
        }
        $signature = Signature::fromSignatureData(
            $seq->at(2)
                ->asBitString()
                ->string(), $algo);
        return new self($tbsCert, $algo, $signature);
    }
360942
protected function _update_index($key)
	{
		// get the current index information
		list($identifier, $sections, $index) = $this->_get_index();
		$index = $index === null ? array() : $index = $this->_unserialize($index);

		// store the key in the index and write the index back
		$index[$identifier] = array($key, $this->created);

		static::$redis->set($this->config['cache_id'].':index:'.$sections, $this->_serialize($index));

		// get the directory index
		$index = static::$redis->get($this->config['cache_id'].':dir:');
		$index = $index === null ? array() : $index = $this->_unserialize($index);

		if (is_array($index))
		{
			if ( ! in_array($sections, $index))
			{
				$index[] = $sections;
			}
		}
		else
		{
			$index = array($sections);
		}

		// update the directory index
		static::$redis->set($this->config['cache_id'].':dir:', $this->_serialize($index));
	}
586654
public function setModname($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->modname !== $v) {
            $this->modname = $v;
            $this->modifiedColumns[MxmapTableMap::COL_MODNAME] = true;
        }

        return $this;
    }
1230866
public function updateCacheTimestamp($onlyValue = false)
    {
        $timestamp = [
            $this->cacheTimestamp => time()
        ];

        if ($onlyValue) {
            return $timestamp;
        }

        return $this->set($timestamp);
    }
793188
public static function fromASN1(Sequence $seq): self
    {
        $oid = $seq->at(0)
            ->asObjectIdentifier()
            ->oid();
        switch ($oid) {
            case self::OID_CPS:
                return CPSQualifier::fromQualifierASN1($seq->at(1));
            case self::OID_UNOTICE:
                return UserNoticeQualifier::fromQualifierASN1($seq->at(1));
        }
        throw new \UnexpectedValueException("Qualifier $oid not supported.");
    }