You are here

public function Context::__construct in Price 2.0.x

Constructs a new Context object.

Parameters

\Drupal\Core\Session\AccountInterface $user: The user.

int|null $time: The unix timestamp, or NULL to use the current time.

array $data: The data.

File

src/Context.php, line 48

Class

Context
Contains known global information (user, time).

Namespace

Drupal\price

Code

public function __construct(AccountInterface $user, int $time = NULL, array $data = []) {
  $this->user = $user;
  $this->time = $time ?: time();
  $this->data = $data;
}