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

declare(strict_types = 1);

namespace Kufer\Web\Classes\Dbfilter;


class TNListe3gKostenTraegerSQLFilter extends BasicSQLFilter
{
  protected function __construct()
  {
    parent::__construct();

    $this->registerDb('Id', 'id', static::TYPE_INTEGER);
    $this->registerDb('Kostentraeger', 'ksttraeger', static::TYPE_STRING);
    $this->registerDb('ErfasstAm', 'erfasstam', static::TYPE_DATETIME);
    $this->registerDb('ErfasstVon', 'erfasstvon', static::TYPE_STRING);
    $this->registerDb('BearbeiterAm', 'bearbdatum', static::TYPE_DATETIME);
    $this->registerDb('Bearbeiter', 'bearbeiter', static::TYPE_STRING);
    $this->registerDb('MitAbfrage', 'abfrage_typ', static::TYPE_BOOLEAN_NOT_1_0); 
  }

  public function getTablePraeffix(): string
  {
    return 'tn3gkt';
  }

  public function equalsId($id): IFilter
  {
    $this->applyFilterCurrent(
      static::FILTER_OPTION_ID,
      SQLFilterUtils::filterEqualsIdInt('id', $id)
    );

    return $this;
  }

  public function inId(iterable $ids): IFilter
  {
    $this->applyFilterCurrent(
      static::FILTER_OPTION_ID,
      SQLFilterUtils::filterInIdInt('id', $ids)
    );

    return $this;
  }
}