system/classes/Db_MySQL.php
protected function joinStringFromArray($dataMember, $sep = ' AND ')
    {
        if (empty($this->$dataMember)) {
            return 0;
        }
        $count = count($this->$dataMember);
        //var_dump($this->$dataMember);
        for($i=0; $i<$count; $i++) {
            $statement = $this->{$dataMember}[$i];
            $this->query .= ' '.$statement[2].' JOIN '.$statement[0].' ON ';
            $sCount = count($statement[1]);
            for($j=0; $j<$sCount; $j++) {
                $this->query .= $this->getArrayJoin($dataMember, $i, $j);
                if ($sCount-1 != $j) {
                    $this->query .= $sep;
                }
            }
        }
    }
protected function joinStringFromArray($dataMember, $sep = ' AND ')
    {
        if (empty($this->$dataMember)) {
            return 0;
        }
        $count = count($this->$dataMember);
        //var_dump($this->$dataMember);
        for($i=0; $i<$count; $i++) {
            $statement = $this->{$dataMember}[$i];
            $this->query .= ' '.$statement[2].' JOIN '.$statement[0].' ON ';
            $sCount = count($statement[1]);
            for($j=0; $j<$sCount; $j++) {
                $this->query .= $this->getArrayJoin($dataMember, $i, $j);
                if ($sCount-1 != $j) {
                    $this->query .= $sep;
                }
            }
        }
    }
For creating a JOIN string expression from the database class arrays holding JOIN
data.