You are here

public function LingotekProfile::getBundles in Lingotek Translation 7.7

1 call to LingotekProfile::getBundles()
LingotekProfile::getEntities in lib/Drupal/lingotek/LingotekProfile.php

File

lib/Drupal/lingotek/LingotekProfile.php, line 228
Defines LingotekProfile

Class

LingotekProfile
A class wrapper for Lingotek Profiles

Code

public function getBundles() {
  $entities = entity_get_info();
  $lentities = variable_get('lingotek_entity_profiles');
  $bundles = array();
  foreach ($entities as $entity_name => $entity) {
    if (!isset($lentities[$entity_name])) {
      unset($entities[$entity_name]);
    }
    foreach ($entity['bundles'] as $bundle_name => $bundle) {
      if (isset($lentities[$entity_name][$bundle_name]) && $lentities[$entity_name][$bundle_name] === (string) $this
        ->getId()) {
        if (!isset($bundles[$entity_name])) {
          $bundles[$entity_name] = array();
        }
        $bundles[$entity_name][$bundle_name] = TRUE;
      }
    }
  }
  return $bundles;
}