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

declare(strict_types = 1);

namespace Kufer\Web\Classes\Repository;

use Kufer\Web\Classes\Dbfilter\ISQLFilter;
use Kufer\Web\Classes\Dbfilter\ToolsSQLFilter;

class WebToolsRepository extends AbstractRepository
{
  
  protected $dbw;

  
  protected $filter;

  
  public function createFilter(): ISQLFilter
  {
    return ToolsSQLFilter::create();
  }

  public function createDBWork(int $dbnr, bool $newInst): \DBWork
  {
    return new \DBWorkTools($dbnr, $newInst);
  }

  
  public function filterNotAllgemeineTools(ToolsSQLFilter $filter): ToolsSQLFilter
  {
    $filter->notAny(static function(ToolsSQLFilter $filter) {
      $filter->equalsId(0);
      $filter->equalsId(4);
      $filter->equalsId(-1);
    });

    return $filter;
  }
}