Guest User

Untitled

a guest
May 24th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. /*
  2. * Implements hook_ENTITY_TYPE_create()
  3. */
  4. function MYMODULE_node_create(DrupalnodeNodeInterface $node) {
  5.  
  6. if($node->bundle() == 'article') { //check for a content type, ex: article
  7. $user = DrupaluserEntityUser::load($uid); // load the user
  8. $user->set('field_name', $some_value); // set a value for a particular field
  9. $user->save();
  10. }
  11.  
  12. }
Add Comment
Please, Sign In to add comment