You are here

public static function LearningPathContent::getGroupMembershipTimestamp in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x src/LearningPathContent.php \Drupal\opigno_learning_path\LearningPathContent::getGroupMembershipTimestamp()

Returns Group membership created timestamp.

Parameters

int $gid: Group ID.

int $uid: User ID.

Return value

mixed Group membership created timestamp.

1 call to LearningPathContent::getGroupMembershipTimestamp()
opigno_learning_path_entity_delete in ./opigno_learning_path.module
Implements hook_entity_delete().

File

src/LearningPathContent.php, line 246

Class

LearningPathContent
Class LearningPathContent.

Namespace

Drupal\opigno_learning_path

Code

public static function getGroupMembershipTimestamp($gid, $uid) {
  $db_connection = \Drupal::service('database');
  $timestamp = $db_connection
    ->select('group_content_field_data', 'g_c_f_d')
    ->fields('g_c_f_d', [
    'created',
  ])
    ->condition('gid', $gid)
    ->condition('entity_id', $uid)
    ->execute()
    ->fetchField();
  return $timestamp;
}