<?php

namespace App\Modules\Shared\Domain\QueryBuilder;

use App\Modules\Shared\Domain\QueryBuilder\Operator\Operator;

class SingleQueryBuilder
{

    private Operator $operator;

    private $columns = [];
    private $groupBy = '';

    public function columns()
    {
        return $this->columns;
    }

    public function addColumns(array $value)
    {
        $this->columns = array_merge($this->columns, $value);
    }

    public function setGroupBy(string $value)
    {
        $this->groupBy = $value;
    }

    public function groupBy()
    {
        return 'GROUP BY ' . $this->groupBy;
    }

    public function setWhere(Operator $operator)
    {
        $this->operator = $operator;
    }

    public function operator(): Operator
    {
        return $this->operator;
    }
}
