<?php

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

namespace Kufer\Web\Classes\Api\SearchRestriction;


class SearchRestrictionKatKennzAndFilter extends SearchRestrictionKatKennzOrFilter
{
  public function __construct()
  {
    $this->sessionName = $this->requestName = 'katkennzandfilter';
  }

  protected function setKrit($pFromObject, $pKrit)
  {
    $pFromObject->suche_kennzeichenAnd = $pKrit;

    return $pFromObject;
  }
}

class SearchRestrictionKatKennzAndRendererCheckbox extends SearchRestrictionRendererCheckboxBase
{
  protected static $mySeparator = '|';

  public function __construct($pFilter = null)
  {
    parent::__construct(new SearchRestrictionKatKennzAndFilter());
  }

  protected function getCleanOptionValFromItem($pItem)
  {
    return \CleanOperations::cleanInt($pItem->kennz);
  }

  protected function getCleanOptionTextFromItem($pItem)
  {
    return \CleanOperations::cleanStringForHtml($pItem->text);
  }
}

class SearchRestrictionKatKennzAndRendererCheckboxAsList extends \Kufer\Web\Classes\Api\SearchRestriction\SearchRestrictionKatKennzAndRendererCheckbox
{
  public function __construct($pFilter = null)
  {
    parent::__construct($pFilter);
    $this->itemDecorator = new ItemDecoratorList();
    $this->decorator = new DecoratorList('kw-katkennzandlist');
  }
}

class SearchRestrictionKatKennzAndRendererCheckboxAsBootstrapRow extends \Kufer\Web\Classes\Api\SearchRestriction\SearchRestrictionKatKennzAndRendererCheckbox
{
  public function __construct($pFilter = null)
  {
    parent::__construct($pFilter);
    $this->itemDecorator = new ItemDecoratorBootstrap();
    $this->decorator = new DecoratorBootstrap();
  }
}