Update user when node is created I'm new in Drupal 8 and I need to update the user when a node of a specific content type is created or updated.
I did some searching and I find hook_entity_create but this hook Act when creating a new entity
/*
 * Implements hook_ENTITY_TYPE_insert()
 */
function MYMODULE_node_insert(Drupal\node\NodeInterface $node) {

  if($node-&gt;bundle() == 'article') { //check for a content type, ex: article
    $user = \Drupal\user\Entity\User::load($uid); // load the user
    $user-&gt;set('field_name', $some_value); // set a value for a particular field
    $user-&gt;save();
  }

}


Originally I wrote:

MYMODULE_node_create(Drupal\node\NodeInterface $node) { 

Changed it as per the comment below.