<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\Classes\Dbfilter;


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

    $this->registerDb('ObjectId', 'nr', static::TYPE_STRING);
    $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::filterEqualsString(':table:', 'nr', $id)
    );

    return $this;
  }
}