function photos_user_insert in Album Photos 8.5
Same name and namespace in other branches
- 8.4 photos.module \photos_user_insert()
- 7.3 photos.module \photos_user_insert()
- 6.0.x photos.module \photos_user_insert()
Implements hook_user_insert().
File
- ./
photos.module, line 644 - Implementation of photos.module.
Code
function photos_user_insert(UserInterface $account) {
$db = \Drupal::database();
$values = [
[
'cid' => $account
->id(),
'changed' => 0,
'type' => 'user_album',
'value' => 0,
],
[
'cid' => $account
->id(),
'changed' => 0,
'type' => 'user_image',
'value' => 0,
],
];
$query = $db
->insert('photos_count')
->fields([
'cid',
'changed',
'type',
'value',
]);
foreach ($values as $record) {
$query
->values($record);
}
$query
->execute();
}