You are here

public function Domain::contextToEvaluate in GoogleTagManager 8

Returns the entity ID of the context value.

Return value

string The entity ID of the context value.

Overrides ConditionBase::contextToEvaluate

File

src/Plugin/Condition/Domain.php, line 101

Class

Domain
Provides a 'Domain' condition.

Namespace

Drupal\google_tag\Plugin\Condition

Code

public function contextToEvaluate() {
  $domain = $this
    ->getContextValue('entity:domain');

  // @todo Is this checking necessary? Does it reflect brittleness by domain?
  if (!$domain) {

    // The context did not load; try to derive it from the request.
    $domain = $this->domainNegotiator
      ->getActiveDomain();
  }
  if (empty($domain)) {
    return FALSE;
  }
  return $domain
    ->id();
}