code: public function compile()
  	{
  		if (empty($this->joins))
  		{
  			return "";
  		}
  
  		$joins = array();
  		foreach ($this->joins as $join)
  		{
  			if ($join[0] === "ON")
  			{
  				$joins[] = $this->compileOn($join);
  			}
  			else
  			{
  				$joins[] = $this->compileUsing($join);
  			}
  		}
  
  		return join(" ", $joins);
  	}
docs: Compiles the query into raw SQL
  
  @return  string