<?php

namespace system\entity\filter;

use system\entity\filter\where\where;
use system\entity\filter\where\andWhere;

class BaseFilter
{
    /**
     * @var Where
     */
    private $where;

    /**
     * @var AndWhere
     */
    private $andWhere;

    /**
     * @return null
     */
    public function getWhere()
    {
        return $this->where;
    }

    /**
     * @param $leftExpr
     * @param $operator
     * @param $rightExpr
     */
    public function setWhere($leftExpr, $operator, $rightExpr): void
    {
        $this->where = new Where($leftExpr, $operator, $rightExpr);
    }

    /**
     * @return null
     */
    public function getAndWhere()
    {
        return $this->andWhere;
    }

    /**
     * @param array $andWhere
     */
    public function setAndWhere(array $andWhere): void
    {
        $this->andWhere = new AndWhere($andWhere);
    }

}