EscolaLMS/Core

View on GitHub
src/Repositories/Criteria/Criterion.php

Summary

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

namespace EscolaLms\Core\Repositories\Criteria;

use Illuminate\Database\Eloquent\Builder;

abstract class Criterion
{
    protected ?string $key;
    protected $value;
    protected $operator;

    public function __construct(?string $key = null, $value = null, $operator = null)
    {
        $this->key = $key;
        $this->value = $value;
        $this->operator = $operator;
    }

    abstract public function apply(Builder $query): Builder;
}