G
G
gitdev2020-12-30 11:36:38
PHP
gitdev, 2020-12-30 11:36:38

Is it possible to specify isName, isLimit methods in DTO?

For example, is it possible to add methods isLimit, isPage to such a DTO? or is it already a valueObject?

class PaginationDTO
{
    /**
     * @var int
     */
    private $limit;

    /**
     * @var int
     */
    private $page;

    public function __construct(int $limit, int $page)
    {
        $this->limit = $limit;
        $this->page = $page;
    }

    public function getLimit(): int
    {
        return $this->limit;
    }

    public function getPage(): int
    {
        return $this->page;
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmitriy, 2020-12-30
@gitdev

no longer a DTO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question