public function join($type, $table, array $relations = array())
    {
        $this->append(sprintf(' %s JOIN %s ', $type, $table));

        // Append relations if provided
        if (!empty($relations)) {
            // First on
            $this->on();

            $i = 0; // Iteration counter
            $count = count($relations);

            foreach ($relations as $column => $value) {
                // Increment iteration count
                $i++;

                $this->equals($column, $value);

                // If last iteration
                if ($i != $count) {
                    $this->rawAnd();
                }
            }
        }

        return $this;
    }
public function join($type, $table, array $relations = array())
    {
        $this->append(sprintf(' %s JOIN %s ', $type, $table));

        // Append relations if provided
        if (!empty($relations)) {
            // First on
            $this->on();

            $i = 0; // Iteration counter
            $count = count($relations);

            foreach ($relations as $column => $value) {
                // Increment iteration count
                $i++;

                $this->equals($column, $value);

                // If last iteration
                if ($i != $count) {
                    $this->rawAnd();
                }
            }
        }

        return $this;
    }
public function join ( $ type , $ table , array $ relations = array ( ) ) { $ this -> append ( sprintf ( ' %s JOIN %s ' , $ type , $ table ) ) ; // Append relations if provided if ( ! empty ( $ relations ) ) { // First on $ this -> on ( ) ; $ i = 0 ; // Iteration counter $ count = count ( $ relations ) ; foreach ( $ relations as $ column => $ value ) { // Increment iteration count $ i ++ ; $ this -> equals ( $ column , $ value ) ; // If last iteration if ( $ i != $ count ) { $ this -> rawAnd ( ) ; } } } return $ this ; }
Appends JOIN statement

@param string $type JOIN type
@param string $table Right table (second)
@param array $relations
@return \Krystal\Db\Sql\QueryBuilder
Appends JOIN statement