You are here

function subscriptions_install in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 5.2 subscriptions.install \subscriptions_install()
  2. 5 subscriptions.install \subscriptions_install()
  3. 6 subscriptions.install \subscriptions_install()
  4. 7 subscriptions.install \subscriptions_install()

Implements hook_install().

File

./subscriptions.install, line 278
Subscriptions module installation.

Code

function subscriptions_install() {
  \Drupal::database()
    ->insert('subscriptions_user')
    ->fields([
    'uid',
  ], [
    0,
  ])
    ->execute();
  $select = \Drupal::database()
    ->select('users', 'u')
    ->fields('u', [
    'uid',
  ])
    ->condition('u.uid', 0, '>');
  \Drupal::database()
    ->insert('subscriptions_user')
    ->from($select)
    ->execute();
}