You are here

protected function MigrateCommerceFileFieldHandler::buildFieldArray in Commerce File 7

Implementation of MigrateFileFieldBaseHandler::buildFieldArray().

Overrides MigrateFileFieldBaseHandler::buildFieldArray

File

migrate/destinations/fields.inc, line 67
Support for processing commerce file fields

Class

MigrateCommerceFileFieldHandler
Handle for commerce_file fields;

Code

protected function buildFieldArray($field_array, $arguments, $delta) {
  $field_instance = !empty($this->_field_instance) ? $this->_field_instance : array();
  $data_defaults = $this
    ->_field_data_defaults($field_instance);
  foreach ($data_defaults as $data_key => $data_default) {
    if (isset($arguments[$data_key])) {
      if (is_array($arguments[$data_key])) {
        $field_array['data'][$data_key] = $arguments[$data_key][$delta];
      }
      else {
        $field_array['data'][$data_key] = $arguments[$data_key];
      }
    }
    if (!isset($field_array['data'][$data_key])) {
      $field_array['data'][$data_key] = $data_default;
    }
  }
  return $field_array;
}