daily pastebin goal
82%
SHARE
TWEET

Untitled

a guest Jan 20th, 2017 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $user = User::create();
  2.     $userEmail = $form_state->getValue('user_email');
  3.  
  4.     // Generate Password
  5.     $password = user_password();
  6.  
  7.     // Save User
  8.     $user->setPassword($password);
  9.     $user->enforceIsNew();
  10.     $user->setEmail($userEmail);
  11.     $user->setUsername($userEmail);
  12.     $user->set("field_firstname", $form_state->getValue('user_firstname'));
  13.     $user->set("field_lastname", $form_state->getValue('user_lastname'));
  14.     $user->set("field_company", $pub_company . ' ' . $newCompanyNode->id());
  15.     $user->activate();
  16.     $user->save();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top