function EntityLazyLoadContext::getContextValue

Same name in other branches
  1. 8.x-3.x src/Context/EntityLazyLoadContext.php \Drupal\ctools\Context\EntityLazyLoadContext::getContextValue()

Overrides Context::getContextValue

1 call to EntityLazyLoadContext::getContextValue()
EntityLazyLoadContext::hasContextValue in src/Context/EntityLazyLoadContext.php
Returns whether the context has a value.

File

src/Context/EntityLazyLoadContext.php, line 47

Class

EntityLazyLoadContext
Defines context that loads entity on demand.

Namespace

Drupal\ctools\Context

Code

public function getContextValue() {
    if (!$this->contextData) {
        $entity_type_id = substr($this->contextDefinition
            ->getDataType(), 7);
        $this->setContextValue($this->entityRepository
            ->loadEntityByUuid($entity_type_id, $this->uuid));
    }
    return parent::getContextValue();
}