protected function buildJointure($type, $table, $conditions, $alias=null) {
		$params = [];
		$jointure = '';
		switch($type) {
			case 'leftjoin':
				$jointure = "\n".'LEFT JOIN ';
				break;
			case 'rightjoin':
				$jointure = "\n".'RIGHT JOIN ';
				break;
			case 'innerjoin':
				$jointure = "\n".'INNER JOIN ';
				break;
		}

		if($table instanceof static) {
			$_table = '('.$table->buildSQL().') '.$this->quote.$alias.$this->quote;
			$params = array_merge($params, $table->getParameters());
			$table = $_table;
		}
		elseif($table instanceof Raw) {
			$_table = '('.$table->getSQL().') '.$this->quote.$alias.$this->quote;
			$params = array_merge($params, $table->getParameters());
			$table = $_table;
		}
		else {
			if($alias !== null)
				$table = $table.' '.$alias;
			$table = preg_replace_callback('/(^[a-z_][a-zA-Z0-9._]*)| ([a-z_][a-zA-Z0-9._]*$)/', function($matches) {
					return $this->identifierQuotes($matches[0]);
			}, $table);
		}

		$jointure .= $table;
		if($conditions) {
			$r = $this->processConditions($conditions);
			$jointure .= ' ON '.$r[0];
			$params = array_merge($params, $r[1]);
		}
		return [$jointure, $params];
	}
protected function buildJointure($type, $table, $conditions, $alias=null) {
		$params = [];
		$jointure = '';
		switch($type) {
			case 'leftjoin':
				$jointure = "\n".'LEFT JOIN ';
				break;
			case 'rightjoin':
				$jointure = "\n".'RIGHT JOIN ';
				break;
			case 'innerjoin':
				$jointure = "\n".'INNER JOIN ';
				break;
		}

		if($table instanceof static) {
			$_table = '('.$table->buildSQL().') '.$this->quote.$alias.$this->quote;
			$params = array_merge($params, $table->getParameters());
			$table = $_table;
		}
		elseif($table instanceof Raw) {
			$_table = '('.$table->getSQL().') '.$this->quote.$alias.$this->quote;
			$params = array_merge($params, $table->getParameters());
			$table = $_table;
		}
		else {
			if($alias !== null)
				$table = $table.' '.$alias;
			$table = preg_replace_callback('/(^[a-z_][a-zA-Z0-9._]*)| ([a-z_][a-zA-Z0-9._]*$)/', function($matches) {
					return $this->identifierQuotes($matches[0]);
			}, $table);
		}

		$jointure .= $table;
		if($conditions) {
			$r = $this->processConditions($conditions);
			$jointure .= ' ON '.$r[0];
			$params = array_merge($params, $r[1]);
		}
		return [$jointure, $params];
	}
protected function buildJointure ( $ type , $ table , $ conditions , $ alias = null ) { $ params = [ ] ; $ jointure = '' ; switch ( $ type ) { case 'leftjoin' : $ jointure = "\n" . 'LEFT JOIN ' ; break ; case 'rightjoin' : $ jointure = "\n" . 'RIGHT JOIN ' ; break ; case 'innerjoin' : $ jointure = "\n" . 'INNER JOIN ' ; break ; } if ( $ table instanceof static ) { $ _table = '(' . $ table -> buildSQL ( ) . ') ' . $ this -> quote . $ alias . $ this -> quote ; $ params = array_merge ( $ params , $ table -> getParameters ( ) ) ; $ table = $ _table ; } elseif ( $ table instanceof Raw ) { $ _table = '(' . $ table -> getSQL ( ) . ') ' . $ this -> quote . $ alias . $ this -> quote ; $ params = array_merge ( $ params , $ table -> getParameters ( ) ) ; $ table = $ _table ; } else { if ( $ alias !== null ) $ table = $ table . ' ' . $ alias ; $ table = preg_replace_callback ( '/(^[a-z_][a-zA-Z0-9._]*)| ([a-z_][a-zA-Z0-9._]*$)/' , function ( $ matches ) { return $ this -> identifierQuotes ( $ matches [ 0 ] ) ; } , $ table ) ; } $ jointure .= $ table ; if ( $ conditions ) { $ r = $ this -> processConditions ( $ conditions ) ; $ jointure .= ' ON ' . $ r [ 0 ] ; $ params = array_merge ( $ params , $ r [ 1 ] ) ; } return [ $ jointure , $ params ] ; }
Build a jointure.
@param  string $type
@param  string $table
@param  array  $conditions
@param  string $alias
@return string
Build a jointure .