function skinr_context_entity_load in Skinr 8.2
Implements hook_entity_load().
File
- skinr_context/
skinr_context.module, line 643 - Provides Skinr integration with Context.
Code
function skinr_context_entity_load(array $entities, $entity_type_id) {
if ($entity_type_id !== 'skin') {
return;
}
foreach ($entities as $skin) {
$query = db_select('skinr_group_skins', 'gs');
$query
->fields('gs', array(
'gid',
));
$query
->condition('sid', $skin->sid);
$skin->gid = $query
->execute()
->fetchField();
}
}