You are here

function _piwik_stats_field_update in Piwik Statistic Integration 7.2

Saves a piwik field without touching any other fields.

1 call to _piwik_stats_field_update()
piwik_stats_process_queue_item in ./piwik_stats.module
Processes a dataset for filling a field.

File

./piwik_stats.module, line 584
Integrates piwik statistics as entity fields.

Code

function _piwik_stats_field_update($entity_type, $entity, $field) {
  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);

  // Get the storage backend used by the field.
  $storage_info = field_info_storage_types($field['storage']['type']);

  // Invoke the proper storage backend.
  module_invoke($storage_info['module'], 'field_storage_write', $entity_type, $entity, FIELD_STORAGE_UPDATE, array(
    $field['id'] => $field['id'],
  ));
  $entity_info = entity_get_info($entity_type);
  if ($entity_info['field cache']) {
    cache_clear_all("field:{$entity_type}:{$id}", 'cache_field');
  }
}