You are here

public function Test7Config::getElement in Rocket.Chat 8

Same name and namespace in other branches
  1. 8.2 modules/rocket_chat_api/src/RocketChat/TestConfig.class.inc \Drupal\rocket_chat_api\RocketChat\Test7Config::getElement()

Get a RocketChatConfigInterface Element.

Parameters

string $elementName: Key value to retrieve from the RocketChatConfigInterface Backend.

string $default: A possible Default to use when no config is found in the backend.

Return value

mixed The retrieved config value.

Overrides Drupal8Config::getElement

File

modules/rocket_chat_api/src/RocketChat/TestConfig.class.inc, line 46

Class

Test7Config
Class Test7Config For Testing.

Namespace

Drupal\rocket_chat_api\RocketChat

Code

public function getElement($elementName, $default = NULL) {
  switch ($elementName) {
    case "rocket_chat_uid":
      return $this->userId;
    case "rocket_chat_uit":
      return $this->userToken;
    case "rocket_chat_url":
      return $this->server;
    default:
      return $default;
  }
}