You are here

class OgMembershipViewsController in Organic groups 7

Same name and namespace in other branches
  1. 7.2 includes/views/og.views.inc \OgMembershipViewsController

"OG membership" entity Views definitions.

Hierarchy

Expanded class hierarchy of OgMembershipViewsController

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

File

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

View source
class OgMembershipViewsController extends EntityDefaultViewsController {

  /**
   * Override views_data().
   */
  public function views_data() {
    $data = parent::views_data();
    $data['og_membership']['state']['filter'] = array(
      'handler' => 'og_handler_filter_group_state',
      'numeric' => TRUE,
      'allow empty' => FALSE,
      'help' => t('Select the state of the group.'),
    );
    $data['og_membership']['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',
      ),
    );

    // Improve relationship text.
    $data['og']['og_membership']['title'] = t('OG membership from OG group');
    $data['og']['og_membership']['help'] = t('The OG membership associated with OG group via the group ID.');
    $data['og']['og_membership']['relationship']['label'] = t('OG membership from OG group');
    $data['og_membership']['og_roles'] = array(
      'title' => t('OG user roles in group'),
      'help' => t('Show all the roles a user belongs to in a group. Requires a relationship to users to be present.'),
      // This is a dummy field, so point it to a real field that we need - the
      // group ID
      'real field' => 'gid',
      'field' => array(
        'handler' => 'og_handler_field_user_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
OgMembershipViewsController::views_data public function Override views_data(). Overrides EntityDefaultViewsController::views_data