<?php

namespace App\Repositories\Eloquent\Criteria;

use App\Models\Informacia\Enums\StavInformacieEnum;
use Illuminate\Database\Eloquent\Builder;
use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;

/**
 * Class ZverejneneCriteria
 *
 * @package App\Repositories\Eloquent\Criteria
 */
final class ZverejneneCriteria implements CriteriaInterface
{
    /**
     * @param Builder $model
     * @param RepositoryInterface $repository
     *
     * @return Builder
     */
    public function apply($model, RepositoryInterface $repository): Builder
    {
        return $model->where('stav', StavInformacieEnum::ZVEREJNENA());
    }
}