<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Utils\FilterSettings\Dozenten;

use Kufer\Web\Classes\Dbfilter\DozentenSQLFilter;
use Kufer\Web\KuferTools\Utils\FilterSettings\IFilterSettings;
use Kufer\Web\Classes\Dbfilter\ISQLFilter;

class KennzeichenFilterSettings implements IFilterSettings
{
  private $kennz;

  public function __construct(string $kennz)
  {
    $this->kennz = $kennz;
  }

  
  public function applySettings($filter): ISQLFilter
  {
    $kennzFilter = \Kufer\Web\Classes\Dbfilter\KennzeichenSQLFilter::create();
    $kennzFilter->equalsKennzeichen((int)$this->kennz);

    return $filter->applyKennzeichenFilter($kennzFilter);
  }

  public function assertFilterClass($filter): void
  {
    assert($filter instanceof DozentenSQLFilter);
  }
}