You are here

class OgViewsController in Organic groups 7

"Group" entity Views definition.

Hierarchy

Expanded class hierarchy of OgViewsController

1 string reference to 'OgViewsController'
og_entity_info in ./og.module
Implements hook_entity_info().

File

includes/og.views.inc, line 12
Provides support for the Views module.

View source
class OgViewsController extends EntityDefaultViewsController {

  /**
   * Override views_data().
   */
  public function views_data() {
    $data = parent::views_data();
    $data['og']['gid']['argument'] = array(
      'handler' => 'og_handler_argument_group_audience_gid',
    );
    $data['og']['etid'] = array(
      'title' => t('Entity id'),
      'help' => t('The numeric id of the entity.'),
      'field' => array(
        'handler' => 'views_handler_field_numeric',
        'click sortable' => TRUE,
      ),
      'sort' => array(
        'handler' => 'views_handler_sort',
      ),
      'filter' => array(
        'handler' => 'views_handler_filter_numeric',
      ),
      'argument' => array(
        'handler' => 'views_handler_argument_numeric',
      ),
    );
    $data['field_data_group_audience']['og_permissions'] = array(
      'group' => t('Group'),
      'title' => t('Group permissions'),
      'help' => t('Filter by group permissions.'),
      // This is a dummy field, so point it to a real field that we need - the
      // group ID
      'real field' => 'group_audience_gid',
      'field' => array(
        'handler' => 'og_handler_field_group_permissions',
      ),
    );
    $data['og_users_roles'] = array(
      'table' => array(
        'group' => t('OG user roles'),
        'join' => array(
          'og_membership' => array(
            'left_field' => 'gid',
            'field' => 'gid',
          ),
        ),
      ),
    );
    $data['og_users_roles']['rid'] = array(
      'title' => t('Role ID'),
      'help' => t('The OG role ID.'),
      // We provide a dummy field to show the roles a user is part of. See
      // 'og_membership - og_roles'.
      // @todo: Add sort and filter.
      'filter' => array(
        'handler' => 'og_handler_filter_group_roles',
      ),
    );
    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
OgViewsController::views_data public function Override views_data(). Overrides EntityDefaultViewsController::views_data