function LinkResolvableUriComputed::getValue

Same name and namespace in other branches
  1. 11.x core/modules/link/src/Plugin/DataType/LinkResolvableUriComputed.php \Drupal\link\Plugin\DataType\LinkResolvableUriComputed::getValue()

Overrides PrimitiveBase::getValue

3 calls to LinkResolvableUriComputed::getValue()
LinkResolvableUriComputed::getCacheContexts in core/modules/link/src/Plugin/DataType/LinkResolvableUriComputed.php
The cache contexts associated with this object.
LinkResolvableUriComputed::getCacheMaxAge in core/modules/link/src/Plugin/DataType/LinkResolvableUriComputed.php
The maximum age for which this object may be cached.
LinkResolvableUriComputed::getCacheTags in core/modules/link/src/Plugin/DataType/LinkResolvableUriComputed.php
The cache tags associated with this object.

File

core/modules/link/src/Plugin/DataType/LinkResolvableUriComputed.php, line 31

Class

LinkResolvableUriComputed
Defines a data type for a Link Resolvable URI.

Namespace

Drupal\link\Plugin\DataType

Code

public function getValue() {
  if ($this->processed !== NULL) {
    return $this->processed
      ->getGeneratedUrl();
  }
  /** @var \Drupal\link\Plugin\Field\FieldType\LinkItem $item */
  $item = $this->getParent();
  $this->processed = $item->getUrl()
    ->toString(TRUE);
  return $this->processed
    ->getGeneratedUrl();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.