You are here

function lingotek_get_all_entities_by_profile in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.util.inc \lingotek_get_all_entities_by_profile()
  2. 7.5 lingotek.util.inc \lingotek_get_all_entities_by_profile()
2 calls to lingotek_get_all_entities_by_profile()
lingotek_admin_profile_form_submit in ./lingotek.admin.inc
lingotek_admin_profile_usage in ./lingotek.admin.inc

File

./lingotek.util.inc, line 1581
Utility functions.

Code

function lingotek_get_all_entities_by_profile($profile_id) {

  // gather all bundles for searching, as some entities may be one-offs
  // even though Lingotek is not enabled for the entire bundle.
  $all_profiles = lingotek_get_profiles();
  $all_profiles[LingotekSync::PROFILE_CUSTOM] = TRUE;
  $all_profiles[LingotekSync::PROFILE_DISABLED] = TRUE;
  $all_bundles = lingotek_get_bundles_by_profile_id(array_keys($all_profiles));
  $all_entities = array();

  // aggregate all entity-type-specific results into a single numbered array
  foreach (array_keys($all_bundles) as $entity_type) {
    $entities = lingotek_get_entities_by_profile_and_entity_type($profile_id, $entity_type);
    foreach ($entities as $e) {
      $all_entities[] = $e;
    }
  }
  return $all_entities;
}