You are here

class RegistrationViewsController in Entity Registration 7

Same name and namespace in other branches
  1. 8.2 modules/registration_views/registration_views.module \RegistrationViewsController
  2. 8 modules/registration_views/registration_views.module \RegistrationViewsController
  3. 7.2 modules/registration_views/registration_views.module \RegistrationViewsController

Hierarchy

Expanded class hierarchy of RegistrationViewsController

1 string reference to 'RegistrationViewsController'
registration_views_entity_info_alter in modules/registration_views/registration_views.module
Implements hook_entity_info_alter().

File

modules/registration_views/registration_views.module, line 136
Entity Registration Views integration

View source
class RegistrationViewsController extends EntityDefaultViewsController {
  public function views_data() {
    $data = parent::views_data();
    $data['registration']['view_registration'] = array(
      'field' => array(
        'title' => t('View link'),
        'help' => t('Provide a link to view a registration.'),
        'handler' => 'registration_handler_field_registration_link',
      ),
    );
    $data['registration']['edit_registration'] = array(
      'field' => array(
        'title' => t('Edit link'),
        'help' => t('Provide a link to edit a registration.'),
        'handler' => 'registration_handler_field_registration_link_edit',
      ),
    );
    $data['registration']['delete_registration'] = array(
      'field' => array(
        'title' => t('Delete link'),
        'help' => t('Provide a link to delete a registration.'),
        'handler' => 'registration_handler_field_registration_link_delete',
      ),
    );
    $data['registration']['state']['relationship']['base field'] = 'name';

    // Entity Metadata does not handle registration schema well.
    $data['registration']['user_uid']['title'] = t('User');
    $data['registration']['user_uid']['help'] = t('The user registered for this event.');
    $data['registration']['user_uid']['relationship'] = array(
      'handler' => 'views_handler_relationship',
      'base' => 'users',
      'base field' => 'uid',
      'label' => t('User'),
    );
    $data['registration']['type']['relationship'] = array(
      'handler' => 'views_handler_relationship',
      'base' => 'registration_type',
      'base field' => 'name',
      'label' => t('Registration type'),
    );
    return $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityDefaultViewsController::$type protected property
EntityDefaultViewsController::getRelationshipHandlerClass public function Determines the handler to use for a relationship to an entity type.
EntityDefaultViewsController::map_from_schema_info protected function Comes up with views information based on the given schema and property info.
EntityDefaultViewsController::optionsListCallback public static function A callback returning property options, suitable to be used as views options callback.
EntityDefaultViewsController::schema_fields protected function Try to come up with some views fields with the help of the schema and the entity property information.
EntityDefaultViewsController::schema_revision_fields protected function Try to come up with some views fields with the help of the revision schema and the entity property information.
EntityDefaultViewsController::__construct public function
RegistrationViewsController::views_data public function Defines the result for hook_views_data(). Overrides EntityDefaultViewsController::views_data