<?php namespace App\DAO\Order;
use App\Utils\Entity;

class QueryOrder extends Entity
{

    private $name_param;
    private $table;
    private $desc;

    public static function builder() : QueryOrderBuilder
    {
        $query_filter_builder = new QueryOrderBuilder();
        return $query_filter_builder;
    }

    public function getNameParam() : string
    {
        return $this->name_param;
    }

    public function getTable() : string
    {
        return $this->table;
    }

    public function getDesc() : bool
    {
        return $this->desc;
    }

    public function setNameParam(string $name_param): void
    {
        $this->name_param = $name_param;
    }

    public function setTable(string $table): void
    {
        $this->table = $table;
    }

    public function setDesc(bool $desc)
    {
        $this->desc = $desc;
    }

    public function calculateOrderWay () : string {
        return $this->getDesc() ? 'DESC' : 'ASC';
    }
}