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