function legal_save_accept in Legal 8
Same name and namespace in other branches
- 5 legal.module \legal_save_accept()
- 6.8 legal.module \legal_save_accept()
- 6.7 legal.module \legal_save_accept()
- 7.2 legal.module \legal_save_accept()
- 7 legal.module \legal_save_accept()
- 2.0.x legal.module \legal_save_accept()
Save instance of a user accepting T&C.
Parameters
int $version: Version ID of T&C.
int $revision: Revision ID of T&C.
string $language: Language code of T&C.
int $uid: User ID of user.
Throws
\Drupal\Core\Entity\EntityStorageException
3 calls to legal_save_accept()
- LegalLogin::submitForm in src/
Form/ LegalLogin.php - Form submission handler.
- legal_user_insert in ./
legal.module - Implements hook_ENTITY_TYPE_insert().
- legal_user_update in ./
legal.module - Implements hook_ENTITY_TYPE_update().
File
- ./
legal.module, line 656 - Module file for Legal.
Code
function legal_save_accept($version, $revision, $language, $uid) {
Accepted::create([
'version' => $version,
'revision' => $revision,
'language' => $language,
'uid' => $uid,
'accepted' => time(),
])
->save();
}