You are here

function _minisite_site_load_entity in Mini site 7

Return entity object.

1 call to _minisite_site_load_entity()
minisite_site_paths_info in includes/minisite.site.inc
Return minisite paths information.

File

includes/minisite.site.inc, line 315
minisite.site.inc

Code

function _minisite_site_load_entity($entity_type, $entity_ids = []) {
  if (empty($entity_type) || empty($entity_ids)) {
    return [];
  }
  $entity_object = entity_load($entity_type, $entity_ids);
  if (empty($entity_object)) {
    return [];
  }
  $entity_ids = array_keys($entity_object);
  $entity_id = $entity_ids[0];
  return $entity_object[$entity_id];
}