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

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

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

class RestrictFilterSettings implements IFilterSettings
{
  
  public $loginId;
  
  public $admin;

  public function __construct(int $loginId, int $admin)
  {
    $this->loginId = $loginId;
    $this->admin = $admin;
  }

  
  public function applySettings($filter): ISQLFilter
  {
    $filter->isNotRestricted($this->loginId, $this->admin);

    return $filter;
  }

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