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

namespace Kufer\Web\Classes\Dbfilter;


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

    $this->registerDb('Id', 'id', static::TYPE_INTEGER);
    $this->registerDb('Typ', 'typ', static::TYPE_STRING);
    $this->registerDb('Kennz', 'kennz', static::TYPE_INTEGER);
    $this->registerDb('Text', 'text', static::TYPE_STRING);
    $this->registerDb('Bearbeiter', 'bearbeiter', static::TYPE_STRING);
    $this->registerDb('Bearbeitungsdatum', 'bearbdatum', static::TYPE_DATETIME);
  }

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

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

    return $this;
  }
}