src/Server/Asyn/Mysql/Miner.php
private function getJoinCriteriaUsingPreviousTable($joinIndex, $table, $column)
    {
        $joinCriteria = "";
        $previousJoinIndex = $joinIndex - 1;

        // If the previous table is from a JOIN, use that. Otherwise, use the
        // FROM table.
        if (array_key_exists($previousJoinIndex, $this->join)) {
            $previousTable = $this->join[$previousJoinIndex]['alias'] ?? $this->join[$previousJoinIndex]['table'];
        } elseif ($this->isSelect()) {
            $previousTable = $this->getFromAlias() ?? $this->getFrom();
        } elseif ($this->isUpdate()) {
            $previousTable = $this->getUpdate();
        } else {
            $previousTable = false;
        }

        // In the off chance there is no previous table.
        if ($previousTable) {
            $joinCriteria .= $previousTable . ".";
        }

        $joinCriteria .= $column . " " . self::EQUALS . " " . $table . "." . $column;
        return $joinCriteria;
    }
private function getJoinCriteriaUsingPreviousTable($joinIndex, $table, $column)
    {
        $joinCriteria = "";
        $previousJoinIndex = $joinIndex - 1;

        // If the previous table is from a JOIN, use that. Otherwise, use the
        // FROM table.
        if (array_key_exists($previousJoinIndex, $this->join)) {
            $previousTable = $this->join[$previousJoinIndex]['alias'] ?? $this->join[$previousJoinIndex]['table'];
        } elseif ($this->isSelect()) {
            $previousTable = $this->getFromAlias() ?? $this->getFrom();
        } elseif ($this->isUpdate()) {
            $previousTable = $this->getUpdate();
        } else {
            $previousTable = false;
        }

        // In the off chance there is no previous table.
        if ($previousTable) {
            $joinCriteria .= $previousTable . ".";
        }

        $joinCriteria .= $column . " " . self::EQUALS . " " . $table . "." . $column;
        return $joinCriteria;
    }
private function getJoinCriteriaUsingPreviousTable ( $ joinIndex , $ table , $ column ) { $ joinCriteria = "" ; $ previousJoinIndex = $ joinIndex - 1 ; // If the previous table is from a JOIN, use that. Otherwise, use the // FROM table. if ( array_key_exists ( $ previousJoinIndex , $ this -> join ) ) { $ previousTable = $ this -> join [ $ previousJoinIndex ] [ 'alias' ] ?? $ this -> join [ $ previousJoinIndex ] [ 'table' ] ; } elseif ( $ this -> isSelect ( ) ) { $ previousTable = $ this -> getFromAlias ( ) ?? $ this -> getFrom ( ) ; } elseif ( $ this -> isUpdate ( ) ) { $ previousTable = $ this -> getUpdate ( ) ; } else { $ previousTable = false ; } // In the off chance there is no previous table. if ( $ previousTable ) { $ joinCriteria .= $ previousTable . "." ; } $ joinCriteria .= $ column . " " . self :: EQUALS . " " . $ table . "." . $ column ; return $ joinCriteria ; }
Get an ON criteria string joining the specified table and column to the
same column of the previous JOIN or FROM table.

@param  int $joinIndex index of current join
@param  string $table current table name
@param  string $column current column name
@return string ON join criteria
Get an ON criteria string joining the specified table and column to the same column of the previous JOIN or FROM table .