EscolaLMS/Core

View on GitHub
src/Dtos/CriteriaDto.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace EscolaLms\Core\Dtos;

use EscolaLms\Core\Dtos\Contracts\DtoContract;
use Illuminate\Support\Collection;

class CriteriaDto implements DtoContract
{
    private Collection $criteria;

    /**
     * CriteriaDto constructor.
     * @param Collection $criteria
     */
    public function __construct(Collection $criteria)
    {
        $this->criteria = $criteria;
    }

    public function toArray(): array
    {
        return $this->get()->toArray();
    }

    /**
     * @return Collection
     */
    public function get(): Collection
    {
        return $this->criteria;
    }
}