public function AccessibilityTestController::save

cis7 accessibility.module public AccessibilityTestController::save($test)
cle7 accessibility.module public AccessibilityTestController::save($test)
elmsmedia7 accessibility.module public AccessibilityTestController::save($test)
icor7 accessibility.module public AccessibilityTestController::save($test)
meedjum_blog7 accessibility.module public AccessibilityTestController::save($test)
mooc7 accessibility.module public AccessibilityTestController::save($test)

File

sites/all/modules/ulmus/accessibility/accessibility.module, line 99

Class

AccessibilityTestController
Accessibility test entity controller.

Code

public function save($test) {
  if ((property_exists($test, 'is_new') && $test->is_new) || !isset($test->test_id)) {
    $test->changed = $test->created = time();
  }
  else {
    $test->changed = time();
  }
  parent::save($test);
  if (property_exists($test, 'is_new') && $test->is_new) {
    drupal_write_record('accessibility_test', $test);
  }
  else {
    db_update('accessibility_test')->fields(array(
      'name' => $test->name,
      'severity' => $test->severity,
      'created' => $test->created,
      'changed' => $test->changed,
      'quail_name' => $test->quail_name,
      'data' => serialize($test->data),
    ))->condition('test_id', $test->test_id)->execute();
  }
  cache_clear_all('accessibility_tests_json', 'cache');
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.