How to get the contents created by a User? How to get all contents from which the current user is author?
 $currentUser = \Drupal::currentUser();
 $user = User::load($currentUser-&gt;id());
//get the contents from which $user is author?
$currentUser = \Drupal::currentUser();
$query = \Drupal::entityQuery('node');
$query-&gt;condition('uid', $currentUser-&gt;id());
$author_nids=$query-&gt;execute();