function globallink_beans_save_field_collections in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.7 globallink_beans/globallink_beans.inc \globallink_beans_save_field_collections()
1 call to globallink_beans_save_field_collections()
- globallink_beans_get_translated in globallink_beans/
globallink_beans.inc - Gets number of translated beans.
File
- globallink_beans/
globallink_beans.inc, line 1094
Code
function globallink_beans_save_field_collections($entity, $translated_arr, $target_locale) {
$field_arr = field_info_instances('bean', $entity->type);
$keys = array_keys($field_arr);
foreach ($keys as $field) {
$language = field_language('bean', $entity, $field, NULL);
$field_values = field_get_items('bean', $entity, $field, $language);
if (isset($translated_arr['field_collection'][$field])) {
foreach ($field_values as $entity_id_arr) {
if (isset($entity_id_arr['value'])) {
$fc_entity_id = $entity_id_arr['value'];
globallink_beans_save_field_collections_recursively('bean', $entity, $fc_entity_id, $translated_arr['field_collection'][$field], $target_locale);
}
}
}
}
}