You are here

social_auth_linkedin.install in Social Auth LinkedIn 8.2

Same filename and directory in other branches
  1. 8 social_auth_linkedin.install
  2. 3.x social_auth_linkedin.install

Install, update, and uninstall functions for the Social Auth LinkedIn module.

File

social_auth_linkedin.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Social Auth LinkedIn module.
 */
use Drupal\social_auth\Controller\SocialAuthController;

/**
 * Implements hook_install().
 */
function social_auth_linkedin_install() {
  SocialAuthController::setLoginButtonSettings('social_auth_linkedin', 'social_auth_linkedin.redirect_to_linkedin', 'img/linkedin_logo.svg');
}

/**
 * Implements hook_uninstall().
 */
function social_auth_linkedin_uninstall() {
  SocialAuthController::deleteLoginButtonSettings('social_auth_linkedin');
}

/**
 * Implements hook_update_N().
 *
 * The key api_calls was changed to endpoints. This update copies the values
 * in 'api_calls' to 'endpoints'.
 */
function social_auth_linkedin_update_8201(&$sandbox) {
  $config = \Drupal::configFactory()
    ->getEditable('social_auth_linkedin.settings');
  $endpoints = $config
    ->get('api_calls');
  $config
    ->set('endpoints', $endpoints)
    ->save();
}