Set Record Key

@param int|string $myKeyValue

@return boolean
513816
public function setMyKey($myKeyValue)
    {
        if (substr($myKeyValue, 0, 4) == 'ext:') {
            if ($this->evidenceInfo['extIdSupported'] == 'false') {
                $this->addStatusMessage(sprintf(_('Evidence %s does not support extIDs'),
                        $this->getEvidence()), 'warning');
                $res = false;
            } else {
                $extIds = $this->getDataValue('external-ids');
                if (!empty($extIds) && count($extIds)) {
                    $extIds = array_combine($extIds, $extIds);
                }

                $extIds[$myKeyValue] = $myKeyValue;
                $res                 = $this->setDataValue('external-ids',
                    $extIds);
            }
        } else {
            $res = parent::setMyKey($myKeyValue);
        }
        $this->updateApiURL();
        return $res;
    }
1262954
public static function set(string $key, $value)
    {
        if (!in_array($key, self::$allowedKeys)) {
            throw new \InvalidArgumentException('Invalid key given');
        }

        self::$storedValues[$key] = $value;
    }
649059
public static function setPropertyValues($object,$keyValueArray=[])
    {
        foreach ($keyValueArray as $name => $value){
            Convert::setPropertyValue($object, $name, $value);
        }
    }
852057
public function set($key, $value) {

        $value = $this->connection->quote(json_encode($value, JSON_NUMERIC_CHECK));

        if($this->exists($key)) {
            $sql = "UPDATE ".$this->table." SET `keyval`={$value} WHERE `key`='{$key}'";
        } else {
            $sql = "INSERT INTO ".$this->table." (`key`,`keyval`) VALUES ('{$key}',{$value})";
        }

        $this->connection->exec($sql);
    }
989400
public function set($key, $value = null)
    {
        return self::setValue($this->data, $key, $value);
    }
318614
public function set($key, $value)
    {
        if (!$this->db->isInitialized() || empty($key) || !isset($value)) {
            return false;
        }

        $this->reset($key);

        $serialized = 0;

        if (is_array($value)) {
            $value = serialize($value);
            $serialized = 1;
        }

        $values = array(
            'id' => $key,
            'value' => $value,
            'created' => GC_TIME,
            'serialized' => $serialized
        );

        $this->db->insert('settings', $values);
        return true;
    }
356970
public function set($keys, $value) {
    if (is_string($keys)) $keys = explode('.',$keys);
    if (is_integer($keys)) $keys = array($keys);
    
    return $this->setDataWithKeys($keys, $value);
  }
671698
protected function updateRecord($key, $value)
    {
        $record = $this->getByKey($key);

        $record->value = $this->valueToJson($value);

        $record->save();

        return $record;
    }
522192
public function update($primaryKeyValue, $fieldsValues)
    {
        $this->connectToDB();
        $this->queryBuilder->table($this->table());
        $this->primaryKeyWhere($primaryKeyValue);
        $this->queryBuilder->update($fieldsValues);
        return $primaryKeyValue;
    }
392449
public function setKey($collection, $key, $value) {

        $entry = $this->driver->findOne($collection, ['key' => $key]);

        if ($entry) {
            $entry['val'] = $value;
        } else {
            $entry = [
                'key' => $key,
                'val' => $value
            ];
        }

        return $this->driver->save($collection, $entry);
    }
502861
public function set(KeyInterface $key, $value, $ttlInMillis)
    {
        return $this->connection->set(
            $key->getKeyName(),
            $value,
            null,
            time() + floor($ttlInMillis / 1000)
        );
    }
436765
public static function keyValue($list, $keyProperty=null, $valueProperty=null)
    {
        $index = array();
        foreach ($list as $i) {
            if ($keyProperty) {
                if (!$valueProperty) { 
                    throw new \InvalidArgumentException("Must set value property if setting key property");
                }
                $index[$i->$keyProperty] = $i->$valueProperty;
            }
            else {
                $key = current($i);
                next($i);
                $value = current($i);
                $index[$key] = $value;
            }
        }
        return $index;
    }
810111
public static function getKey($enumValue = '')
    {
        foreach (self::all() as $key => $value) {
            if (strtolower($value) == strtolower($enumValue)) {
                return $key;
            }
        }

        return null;
    }
1239585
public function setPrimaryKey( $key )
	{
		if( in_array( $key, $this->fields ) )
		{
			$this->primaryKey = $key;
			return TRUE;
		}
		return FALSE;
	}
621782
public function set($key, $value, $ttl = null)
    {
        $this->values[$key] = [];

        $this->values[$key][static::VALUE] = $value;
        $this->values[$key][static::TTL] = $ttl;
        $this->values[$key][static::CREATE_TIME] = time();

        return true;
    }
375030
public function set_data($datavalue, $datakey = null) {
        $this->datavalue = $datavalue;

        // We must clear the datakey when changing the datavalue.
        $this->set_data_key($datakey);
    }
271834
public function setItem($obj, $key = null)
    {
        if (!$key) {
            throw new KeyInvalidException("A key is required.");
        } elseif (!is_string($key)) {
            throw new KeyInvalidException("The key should be a string.");
        } else {
            if (!array_key_exists($key, $this->getItems())) {
                throw new KeyInvalidException("Invalid key $key.");
            }
            $this->items[$key] = $obj;
        }

        return $this;
    }