You are here

public function InMemoryConfig::setElement in Rocket.Chat 8

Same name and namespace in other branches
  1. 8.2 modules/rocket_chat_api/src/RocketChat/InMemoryConfig.php \Drupal\rocket_chat_api\RocketChat\InMemoryConfig::setElement()

Set an Element in the RocketChatConfigInterface.

Parameters

string $elementName: Key value to set in the RocketChatConfigInterface Backend.

string $newValue: the new Value to store.

Overrides RocketChatConfigInterface::setElement

File

modules/rocket_chat_api/src/RocketChat/InMemoryConfig.php, line 118

Class

InMemoryConfig
Class InMemoryConfig keeps the config in memory.

Namespace

Drupal\rocket_chat_api\RocketChat

Code

public function setElement($elementName, $newValue) {
  switch ($elementName) {
    case 'rocket_chat_url':
    case 'server':
      return $this->url = $newValue;
    case 'rocket_chat_uid':
      return $this->uid = $newValue;
    case 'rocket_chat_uit':
      return $this->utk = $newValue;
    default:
      throw new \InvalidArgumentException("[{$elementName}] not found", 144);
  }
}