You are here

function computing_update_record in Drupal Computing 7

Update the record with id; only updates the fields in $fields. Callers are responsible to make sure 'input' and 'output' are bytes.

Parameters

$id:

$fields:

Return value

bool

2 calls to computing_update_record()
ComputingTestCase::testCreateUpdateCommand in ./computing.test
computing_update_record_field in ./computing.module

File

./computing.module, line 248

Code

function computing_update_record($id, $fields) {
  $fields = computing_validate_fields($fields);
  $fields['updated'] = time();

  // regardless of whether $fields['updated'] is set already, we update it.
  unset($fields['id']);
  $updated = FALSE;
  if (!empty($fields)) {
    $updated = db_update('computing_record')
      ->fields($fields)
      ->condition('id', $id)
      ->execute();
  }
  return $updated;
}