<?php

namespace Openguru\OpenCartFramework\QueryBuilder;

class JoinClause extends Builder
{
    public $table;
    public $type;
    public $first;
    public $second;
    public $operator;

    public $bindings = [
        'where' => [],
    ];

    public function __construct(Builder $parent, string $type, string $table)
    {
        $this->type = $type;
        $this->table = $table;

        parent::__construct($parent->getConnection(), $parent->getGrammar());
    }

    public function on($first, $operator, $second): JoinClause
    {
        $this->first = $first;
        $this->operator = $operator;
        $this->second = $second;

        return $this;
    }
}
