You are here

public function ComputingRecordController::create in Drupal Computing 7.2

Important: caller of the function should handle encode Input/Output, which are saved to DB as blob.

Overrides EntityAPIController::create

File

./computing.entity.inc, line 151
Code for the entity. This does not allow UI to create Computing Record entities or Computing Application entities. It has to be done in program.

Class

ComputingRecordController
The Controller for computing record entities

Code

public function create(array $values = array()) {
  $timestamp = time();
  $values += array(
    'id' => '',
    'is_new' => TRUE,
    'created' => $timestamp,
    'changed' => $timestamp,
  );

  // input/output should not be handled here. Caller functions should be aware of how to pass input/output data as blob.
  //    if (isset($values['input'])) {
  //      $values['input'] = drupal_json_encode($values['input']);
  //    }
  //    if (isset($values['output'])) {
  //      $values['output'] = drupal_json_encode($values['output']);
  //    }
  $computing_record = parent::create($values);
  return $computing_record;
}