You are here

public static function RealisticDummyContentEnvironment::get in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::get()
  2. 3.x api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::get()

Get the current environment.

See the comment on the private variable $env.

default to a live environment if none is set. (During testing, a mock environment will be set here so we can better control it.)

Return value

object An object of type RealisticDummyContentEnvironment

1 call to RealisticDummyContentEnvironment::get()
RealisticDummyContentBase::env in api/src/includes/RealisticDummyContentBase.php
Retrieves the current environment class.

File

api/src/includes/RealisticDummyContentEnvironment.php, line 37

Class

RealisticDummyContentEnvironment
The abstract base environment.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public static function get() {
  if (!self::$env) {
    self::$env = new RealisticDummyContentLiveEnvironment();
  }
  return self::$env;
}