class AccessibilityTestController

  1. cis7 sites/all/modules/ulmus/accessibility/accessibility.module AccessibilityTestController
  2. cle7 sites/all/modules/ulmus/accessibility/accessibility.module AccessibilityTestController
  3. elmsmedia7 sites/all/modules/ulmus/accessibility/accessibility.module AccessibilityTestController
  4. icor7 sites/all/modules/ulmus/accessibility/accessibility.module AccessibilityTestController
  5. meedjum_blog7 sites/all/modules/ulmus/accessibility/accessibility.module AccessibilityTestController
  6. mooc7 sites/all/modules/ulmus/accessibility/accessibility.module AccessibilityTestController

Accessibility test entity controller.

Hierarchy

Expanded class hierarchy of AccessibilityTestController

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
AccessibilityTestController::create public function
AccessibilityTestController::save public function
DrupalDefaultEntityController::$cache protected property Whether this entity type should use the static cache.
DrupalDefaultEntityController::$entityCache protected property Static cache of entities.
DrupalDefaultEntityController::$entityInfo protected property Array of information about the entity.
DrupalDefaultEntityController::$entityType protected property Entity type for this controller instance.
DrupalDefaultEntityController::$hookLoadArguments protected property Additional arguments to pass to hook_TYPE_load().
DrupalDefaultEntityController::$idKey protected property Name of the entity's ID field in the entity database table.
DrupalDefaultEntityController::$revisionKey protected property Name of entity's revision database table field, if it supports revisions.
DrupalDefaultEntityController::$revisionTable protected property The table that stores revisions, if the entity supports revisions.
DrupalDefaultEntityController::attachLoad protected function Attaches data to entities upon loading.
DrupalDefaultEntityController::cacheGet protected function Gets entities from the static cache.
DrupalDefaultEntityController::cacheSet protected function Stores entities in the static entity cache.
EntityAPIController::$bundleKey protected property
EntityAPIController::$cacheComplete protected property
EntityAPIController::$defaultRevisionKey protected property
EntityAPIController::buildContent public function Implements EntityAPIControllerInterface. Overrides EntityAPIControllerInterface::buildContent
EntityAPIController::buildQuery protected function Overrides DrupalDefaultEntityController::buildQuery(). Overrides DrupalDefaultEntityController::buildQuery
EntityAPIController::delete public function Implements EntityAPIControllerInterface. Overrides EntityAPIControllerInterface::delete
EntityAPIController::deleteRevision public function Implements EntityAPIControllerRevisionableInterface::deleteRevision(). Overrides EntityAPIControllerRevisionableInterface::deleteRevision
EntityAPIController::export public function Implements EntityAPIControllerInterface. Overrides EntityAPIControllerInterface::export
EntityAPIController::import public function Implements EntityAPIControllerInterface. Overrides EntityAPIControllerInterface::import
EntityAPIController::invoke public function Implements EntityAPIControllerInterface. Overrides EntityAPIControllerInterface::invoke
EntityAPIController::load public function Overridden. Overrides DrupalDefaultEntityController::load
EntityAPIController::query public function Builds and executes the query for loading.
EntityAPIController::renderEntityProperty protected function Renders a single entity property.
EntityAPIController::resetCache public function Overrides DrupalDefaultEntityController::resetCache(). Overrides DrupalDefaultEntityController::resetCache
EntityAPIController::saveRevision protected function Saves an entity revision.
EntityAPIController::view public function Implements EntityAPIControllerInterface. Overrides EntityAPIControllerInterface::view
EntityAPIController::__construct public function Overridden. Overrides DrupalDefaultEntityController::__construct

File

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

View source
class AccessibilityTestController extends EntityAPIController {

  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');
  }

  public function create(array $values = array()) {
    // Add values that are specific to our Model
    $values += array(
      'test_id' => '',
      'is_new' => TRUE,
      'name' => '',
      'created' => time(),
      'changed' => time(),
      'quail_name' => '',
      'severity' => '',
      'status' => 1,
      'data' => array(),
    );

    $test = parent::create($values);
    return $test;
  }

}
1 string reference to 'AccessibilityTestController'
accessibility_entity_info in sites/all/modules/ulmus/accessibility/accessibility.module
Implements hook_entity_info().