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

declare(strict_types = 1);

namespace Kufer\Web\Classes\Dbfilter;


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

    $this->registerDb('Optin', 'optin', static::TYPE_STRING);
    $this->registerDb('Bearbeitungsdatum', 'bearbdatum', static::TYPE_DATETIME);
    $this->registerDb('EMailHash', 'emailhash', static::TYPE_STRING);
    $this->registerDb('Feature', 'feature', static::TYPE_INTEGER);
  }

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

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

    return $this;
  }
}