silverstripe-fulltextsearch/src/Search/Queries/SearchQuery_Range.php

62 lines
1.3 KiB
PHP
Raw Normal View History

<?php
namespace SilverStripe\FullTextSearch\Search\Queries;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Dev\Deprecation;
/**
* Create one of these and pass as one of the values in filter or exclude to filter or exclude by a (possibly
* open ended) range
*/
class SearchQuery_Range
{
use Injectable;
public $start = null;
public $end = null;
public function __construct($start = null, $end = null)
{
$this->start = $start;
$this->end = $end;
}
public function setStart($start)
{
$this->start = $start;
return $this;
}
public function setEnd($end)
{
$this->end = $end;
return $this;
}
public function isFiltered()
{
return $this->start !== null || $this->end !== null;
}
/**
2022-11-15 23:36:25 +01:00
* @deprecated 4.0.0 Use setStart() instead
* @codeCoverageIgnore
*/
public function start($start)
{
2022-11-15 23:36:25 +01:00
Deprecation::notice('4.0.0', 'Use setStart() instead');
return $this->setStart($start);
}
/**
2022-11-15 23:36:25 +01:00
* @deprecated 4.0.0 Use setEnd() instead
* @codeCoverageIgnore
*/
public function end($end)
{
2022-11-15 23:36:25 +01:00
Deprecation::notice('4.0.0', 'Use setEnd() instead');
return $this->setEnd($end);
}
}