You are here

function farm_asset_entity_presave in farmOS 7

Implements hook_entity_presave().

File

modules/farm/farm_asset/farm_asset.module, line 358
Farm asset - A farm asset entity type.

Code

function farm_asset_entity_presave($entity, $type) {

  // Only operate on farm_asset entities.
  if ($type != 'farm_asset') {
    return;
  }

  // Update "changed" value if there was a value mapped to that.
  if (isset($entity->feeds_item->asset_changed)) {
    $entity->changed = $entity->feeds_item->asset_changed;
  }
}