You are here

public function PrivateComputed::getValue in Private content 8.2

Gets the data value.

Return value

mixed The data value.

Overrides TypedData::getValue

File

src/PrivateComputed.php, line 20

Class

PrivateComputed
A computed property for processing private value based on node content type settings.

Namespace

Drupal\private_content

Code

public function getValue() {
  if ($this->computed === NULL) {
    $item = $this
      ->getParent();
    $stored = $item->stored;
    $list = $item
      ->getParent();
    if ($stored === NULL || $list
      ->isLocked()) {
      $this->computed = $list
        ->getDefault();
    }
    else {
      $this->computed = $stored;
    }
  }
  return $this->computed;
}