You are here

function lingotek_get_bundles_by_profile_id in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lingotek.util.inc \lingotek_get_bundles_by_profile_id()
  2. 7.6 lingotek.util.inc \lingotek_get_bundles_by_profile_id()
2 calls to lingotek_get_bundles_by_profile_id()
LingotekProfile::getEntities in lib/Drupal/lingotek/LingotekProfile.php
LingotekProfile::getUsage in lib/Drupal/lingotek/LingotekProfile.php

File

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

Code

function lingotek_get_bundles_by_profile_id($profile_id) {
  $bundles = array();
  if (is_array($profile_id)) {

    // allow profile_ids to be an array of profiles to find bundles for
    $mapped_results = array_map('lingotek_get_bundles_by_profile_id', $profile_id);
    foreach ($mapped_results as $result) {
      $bundles = array_merge_recursive($result, $bundles);
    }
    return $bundles;
  }
  $profile = LingotekProfile::loadById($profile_id);
  return $profile
    ->getBundles();
}