code: protected function buildJoin()/*# : array */
      {
          $result = [];
          foreach ($this->clause_join as $join) {
  
              // join type, INNER JOIN etc.
              $res = [$join[1]];
  
              // raw mode
              if ($join[0]) {
                  $res[] = $join[2];
  
              } else {
                  // join table
                  $tbl = $join[2];
                  if (is_object($tbl) && $tbl instanceof SelectStatementInterface) {
                      $res[] = '(' . $tbl->getStatement([], false) . ')';
                  } else {
                      $res[] = $this->quote($tbl);
                  }
  
                  // table alias if any
                  if ($join[4]) {
                      $tbl = $join[4];
                      $res[] = 'AS ' . $this->quote($tbl);
                  }
  
                  // on clause
                  $res[] = $this->buildJoinOn($join[3], $tbl);
              }
  
              $result[] = join(' ', $res);
          }
          return $result;
      }
docs: Build JOIN
  
  @return array
  @access protected