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

namespace Kufer\Web\KuferTools\Utils\FilterSearch\Method;

use Kufer\Web\Classes\Dbfilter\ISQLFilter;

class SQLSearchFilterMethod implements ISearchFilterMethod
{
  
  protected $fnApply;

  
  public function __construct($fnApply)
  {
    $this->fnApply = $fnApply;
  }

  public function fromRequest($value)
  {
    return $value;
  }

  public function fromSession($value)
  {
    return $value;
  }

  public function toSession($value)
  {
    return $value;
  }

  public function apply($filter, $value): ISQLFilter
  {
    return \call_user_func($this->fnApply, $filter, $value);
  }
}