You are here

class RegistrationStateController in Entity Registration 8

Same name and namespace in other branches
  1. 8.2 src/RegistrationStateController.php \Drupal\registration\RegistrationStateController

@file The controller class used for registration state entities

Hierarchy

Expanded class hierarchy of RegistrationStateController

1 string reference to 'RegistrationStateController'
registration_entity_info in ./registration.module
Implements hook_entity_info().

File

src/RegistrationStateController.php, line 8
The controller class used for registration state entities

Namespace

Drupal\registration
View source
class RegistrationStateController extends EntityAPIControllerExportable {
  public function save($entity, DatabaseTransaction $transaction = NULL) {
    parent::save($entity, $transaction);
    if ($entity->default_state == 1) {
      $query = db_update('registration_state')
        ->fields(array(
        'default_state' => 0,
      ))
        ->condition('registration_state_id', $entity->registration_state_id, '<>');
      $query
        ->execute();
    }
  }

}

Members