'Viewing user', self::VIEWED => 'Viewed user' ); // User viewer types. const VIEWER = 0; const VIEWED = 1; final public function __construct(HeartbeatStreamConfig $streamConfig, $page = FALSE, $account = NULL) { $this->_page = $page; $this->setConfig($streamConfig); $this->setAjax(); if (empty($this->_offset_time)) { $this->setOffsetTime(); } $this->setViewer(\Drupal::currentUser()); $this->setViewed($account); $this->setAvailableTemplates(); $this->construct(); $this->setContextualArguments(); } /** * Fake Constructor Method */ public function construct() { } /** * */ protected function setContextualArguments() { $contextualArguments = \Drupal::request()->query->get('contextualArguments'); if (!empty($contextualArguments) && isset($contextualArguments['uid_target'])) { $this->contextual_arguments = $contextualArguments['uid_target']; } elseif ($this->viewed->uid != $this->viewer->uid) { $this->contextual_arguments['uid_target'] = $this->viewed->uid; } //TODO Figure out a way to attach $this->contextual_arguments to the drupalSettings object with an id of "heartbeatContextualArguments" //see below for implementation in a page callback or form alter // $variables['#attached']['drupalSettings']['heartbeatContextualArguments'] = $this->contextual_arguments; } }