mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
ENHANCEMENT Add extension point to appliesTo for SearchVariantSubsites
This commit is contained in:
parent
2323b7f2cd
commit
9c9b2a3e20
@ -4,6 +4,7 @@ namespace SilverStripe\FullTextSearch\Search\Variants;
|
||||
|
||||
use ReflectionClass;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Core\Extensible;
|
||||
use SilverStripe\Core\Config\Configurable;
|
||||
use SilverStripe\FullTextSearch\Search\Indexes\SearchIndex;
|
||||
use SilverStripe\FullTextSearch\Search\Queries\SearchQuery;
|
||||
@ -16,6 +17,7 @@ use SilverStripe\FullTextSearch\Utils\CombinationsArrayIterator;
|
||||
abstract class SearchVariant
|
||||
{
|
||||
use Configurable;
|
||||
use Extensible;
|
||||
|
||||
/**
|
||||
* Whether this variant is enabled
|
||||
|
@ -36,10 +36,14 @@ class SearchVariantSubsites extends SearchVariant
|
||||
|
||||
// Include all DataExtensions that contain a SubsiteID.
|
||||
// TODO: refactor subsites to inherit a common interface, so we can run introspection once only.
|
||||
return SearchIntrospection::has_extension($class, SiteTreeSubsites::class, $includeSubclasses)
|
||||
$appliesTo = SearchIntrospection::has_extension($class, SiteTreeSubsites::class, $includeSubclasses)
|
||||
|| SearchIntrospection::has_extension($class, GroupSubsites::class, $includeSubclasses)
|
||||
|| SearchIntrospection::has_extension($class, FileSubsites::class, $includeSubclasses)
|
||||
|| SearchIntrospection::has_extension($class, SiteConfigSubsites::class, $includeSubclasses);
|
||||
|
||||
$this->extend('updateAppliesTo', $appliesTo, $class, $includeSubclasses);
|
||||
|
||||
return $appliesTo;
|
||||
}
|
||||
|
||||
public function currentState()
|
||||
|
Loading…
Reference in New Issue
Block a user