You are here

function _commerce_file_field_aggregate_field_items in Commerce File 7

Aggregate one or more field items' settings into the first field item

  • assumes all settings have been resolved for all items
2 string references to '_commerce_file_field_aggregate_field_items'
CommerceFileLicenseEntity::get_limits in includes/commerce_file_license.entity.inc
Aggregated Limits
_commerce_file_field_aggregate_files in includes/commerce_file.field.inc
Return all commerce_file fields for a given entity, indexed by fid

File

includes/commerce_file.field.inc, line 739
Implement an commerce_file field, based on the file module's file field.

Code

function _commerce_file_field_aggregate_field_items($field_item1) {
  $args = func_get_args();
  $trunk = array_shift($args);
  if (empty($args)) {
    return $trunk;
  }
  foreach ($args as $field_item) {
    if (!isset($field_item['data'])) {
      continue;
    }
    if (!isset($trunk['data'])) {
      $trunk['data'] = $field_item['data'];
    }
    else {
      $trunk['data'] = _commerce_file_license_property_merge($trunk['data'], $field_item['data']);
    }
  }
  return $trunk;
}