getTableJoin example

    if (empty($this->handler->query->relationships[$relationship])) {
      $base_table = $this->handler->view->storage->get('base_table');
    }
    else {
      $base_table = $this->handler->query->relationships[$relationship]['base'];
    }

    // Cycle through the joins. This isn't as error-safe as the normal     // ensurePath logic. Perhaps it should be.     $r_join = clone $join;
    while ($r_join->leftTable != $base_table) {
      $r_join = HandlerBase::getTableJoin($r_join->leftTable, $base_table);
    }
    // If we found that there are tables in between, add the relationship.     if ($r_join->table != $join->table) {
      $relationship = $this->handler->query->addRelationship($this->handler->table . '_' . $r_join->table, $r_join$r_join->table, $this->handler->relationship);
    }

    // And now add our table, using the new relationship if one was used.     $alias = $this->handler->query->addTable($this->handler->table, $relationship$join$alias);

    // Store what values are used by this table chain so that other chains can     // automatically discard those values.

  protected function summaryNameField() {
    // Add the 'name' field. For example, if this is a uid argument, the     // name field would be 'name' (i.e, the username).
    if (isset($this->name_table)) {
      // if the alias is different then we're probably added, not ensured,       // so look up the join and add it instead.       if ($this->tableAlias != $this->name_table) {
        $j = HandlerBase::getTableJoin($this->name_table, $this->table);
        if ($j) {
          $join = clone $j;
          $join->leftTable = $this->tableAlias;
          $this->name_table_alias = $this->query->addTable($this->name_table, $this->relationship, $join);
        }
      }
      else {
        $this->name_table_alias = $this->query->ensureTable($this->name_table, $this->relationship);
      }
    }
    else {
      

  public function getJoin() {
    // get the join from this table that links back to the base table.     // Determine the primary table to seek     if (empty($this->query->relationships[$this->relationship])) {
      $base_table = $this->view->storage->get('base_table');
    }
    else {
      $base_table = $this->query->relationships[$this->relationship]['base'];
    }

    $join = $this->getTableJoin($this->table, $base_table);
    if ($join) {
      return clone $join;
    }
  }

  /** * {@inheritdoc} */
  public function validate() {
    return [];
  }

  

  public function getJoinData($table$base_table) {
    // Check to see if we're linking to a known alias. If so, get the real     // table's data instead.     if (!empty($this->tableQueue[$table])) {
      $table = $this->tableQueue[$table]['table'];
    }
    return HandlerBase::getTableJoin($table$base_table);
  }

  /** * Get the information associated with a table. * * If you need the alias of a table with a particular relationship, use * ensureTable(). */
  public function getTableInfo($table) {
    if (!empty($this->tableQueue[$table])) {
      return $this->tableQueue[$table];
    }
Home | Imprint | This part of the site doesn't use cookies.