You are here

function opigno_moxtra_user_update in Opigno Moxtra 3.x

Same name and namespace in other branches
  1. 8 opigno_moxtra.module \opigno_moxtra_user_update()

Implements hook_ENTITY_TYPE_update().

Updates user info in the Moxtra.

File

./opigno_moxtra.module, line 675
Contains opigno_moxtra.module.

Code

function opigno_moxtra_user_update(EntityInterface $entity) {

  /** @var \Drupal\user\Entity\User $entity */
  $user_active = $entity
    ->isActive();
  $connector = \Drupal::service('opigno_moxtra.connector');
  if ($user_active && $connector
    ->checkSettings()) {
    $moxtra = \Drupal::service('opigno_moxtra.moxtra_api');
    $moxtra
      ->setUser($entity);
  }
}