Getting latest entity data from the database The problem: I open a drush php:cli shell and run the following:
&gt;&gt;&gt; \Drupal::entityTypeManager()-&gt;getStorage('paragraph')-&gt;load(477)-&gt;get('field_end_time')-&gt;getValue()[0]['value'];
=&gt; &quot;05:01&quot;

I then change the value in the database to 05:02 via the admin panel (content section).
But if I run the same command again in the shell, I still get 05:01.
If I close the shell and open a new one I get 05:02. How do I demand the latest data without terminating the process and starting over? This seems like it must be a basic thing but I've searched far and wide and tried clearing caches and etc. but no dice.
This is affecting me because I have a PHP process that is started by cron that handles a Websocket connections and the same thing is happening there—it's getting stale data from the database.
Thanks for the help.
You can clear the cached entity in memory to get the latest field values:
\Drupal::entityTypeManager()-&gt;getStorage('paragraph')-&gt;resetCache([477]);

See Referenced entities show old value when changing properties