public static function LearningPathContent::getClassGroups in Opigno Learning path 8
Same name and namespace in other branches
- 3.x src/LearningPathContent.php \Drupal\opigno_learning_path\LearningPathContent::getClassGroups()
Returns Class parent groups ids.
Parameters
int $id: Group id.
Return value
mixed Groups ids.
2 calls to LearningPathContent::getClassGroups()
- opigno_learning_path_entity_delete in ./
opigno_learning_path.module - Implements hook_entity_delete().
- opigno_learning_path_entity_insert in ./
opigno_learning_path.module - Implements hook_entity_insert().
File
- src/
LearningPathContent.php, line 223
Class
- LearningPathContent
- Class LearningPathContent.
Namespace
Drupal\opigno_learning_pathCode
public static function getClassGroups($id) {
$db_connection = \Drupal::service('database');
$parents = $db_connection
->select('group_content_field_data', 'g_c_f_d')
->fields('g_c_f_d', [
'gid',
])
->condition('entity_id', $id)
->condition('type', 'group_content_type_27efa0097d858')
->execute()
->fetchAll();
return $parents;
}