Why is the 'values' array not set on an unsaved entity? Is there a way to make it get populated? When I load an entity, its protected 'values' property contains all of its field values.

But when I create a new entity with MyEntityClass::create($array_of_values), its 'values' property is not set until I have saved it.

Is there a way to get that set, for the purposes of debug output?
The code comments in ContentEntityBase say that $values always hold the original, unchanged values of the entity:

/**
 * The plain data values of the contained fields.
 *
 * This always holds the original, unchanged values of the entity. The values
 * are keyed by language code, whereas LanguageInterface::LANGCODE_DEFAULT
 * is used for values in default language.
 *
 * @todo: Add methods for getting original fields and for determining
 * changes.
 * @todo: Provide a better way for defining default values.
 *
 * @var array
 */
protected $values = [];


Quick glance through the code suggests that the public method updateOriginalValues() would do the trick:

/**
 * Updates the original values with the interim changes.
 */
public function updateOriginalValues() {
  if (!$this-&gt;fields) {
    return;
  }
  foreach ($this-&gt;getFieldDefinitions() as $name =&gt; $definition) {
    if (!$definition-&gt;isComputed() &amp;&amp; !empty($this-&gt;fields[$name])) {
      foreach ($this-&gt;fields[$name] as $langcode =&gt; $item) {
        $item-&gt;filterEmptyItems();
        $this-&gt;values[$name][$langcode] = $item-&gt;getValue();
      }
    }
  }
}