You are here

class og_users_roles_join in Organic groups 7.2

Views join handler for the join from {og_membership} to {og_users_roles}.

Hierarchy

Expanded class hierarchy of og_users_roles_join

1 string reference to 'og_users_roles_join'
og_handler_relationship_membership_roles::query in includes/views/handlers/og_handler_relationship_membership_roles.inc
Called to implement a relationship in a query.

File

includes/views/handlers/og_handler_relationship_membership_roles.inc, line 27

View source
class og_users_roles_join extends views_join {
  function build_join($select_query, $table, $view_query) {

    // We can't use the $this->extra array to add on our conditions, as they
    // relate two fields rather than a field to a value, and the parent method
    // doesn't allow this. Rather than completely rewrite it, we can call the
    // parent and then add our conditions to the SelectQuery directly.
    parent::build_join($select_query, $table, $view_query);
    $tables =& $select_query
      ->getTables();
    $left_table = $view_query
      ->get_table_info($this->left_table);

    // The left table is {og_membership}, the right table {og_users_roles}.
    $og_membership_alias = $left_table['alias'];
    $og_users_roles_alias = $table['alias'];

    // Add the condition that the group_type and gid fields match in the join
    // from the {og_membership} table to the {og_users_roles} table.
    $tables[$og_users_roles_alias]['condition'] .= " AND {$og_membership_alias}.group_type = {$og_users_roles_alias}.group_type" . " AND {$og_membership_alias}.gid = {$og_users_roles_alias}.gid";
  }

}

Members

Namesort descending Modifiers Type Description Overrides
og_users_roles_join::build_join function Build the SQL for the join this object represents. Overrides views_join::build_join
views_join::$definition public property
views_join::$extra public property
views_join::$field public property
views_join::$left_field public property
views_join::$left_table public property
views_join::$table public property
views_join::$type public property
views_join::construct public function Construct the views_join object. 1