/**
  * {@inheritdoc}
  */
 public function hasContextValue()
 {
     // Ensure that the entity is loaded before checking if it exists.
     if (!$this->contextValue) {
         $this->getContextValue();
     }
     return parent::hasContextValue();
 }