code: protected function buildJoinOn($input, $table)/*# : string */
      {
          // original table
          $tbl1 = $this->getTableName(true);
  
          if (is_array($input)) {
              $res = ['ON'];
  
              // first table
              if (false === strpos($input[0], '.')) {
                  $res[] = $this->quote($tbl1 . '.' . $input[0]);
              } else {
                  $res[] = $this->quote($input[0]);
              }
  
              // operator
              $res[] = $input[1];
  
              // second table
              if (false === strpos($input[2], '.')) {
                  $res[] = $this->quote($table . '.' . $input[2]);
              } else {
                  $res[] = $this->quote($input[2]);
              }
          } elseif (is_object($input)) {
              $res = [$input->getStatement([], false)];
  
          } elseif (is_string($input)) {
              $res = ['ON', $input];
          }
  
          return join(' ', $res);
      }
docs: Build ON
  
  @param  string|array|object|null $input
  @param  string $table joined table or table alias
  @return string
  @access protected