SilverStripe Search

CoreServiceTrait

Trait CoreServiceTrait to have simple methods that don't really need to be in core.

Trait to support basic settings for the Solr Core Service

Table of Contents

Properties

$admin  : Query
$client  : Client
$debug  : bool
Add debugging information

Methods

getAdmin()  : Query
Get the admin query
getClient()  : Client
Get the client
getValidClasses()  : array<string|int, mixed>
Get all classes from all indexes and return them.
getValidIndexes()  : mixed
Ensure the getValidIndexes() method exists on all classes using this trait.
isDebug()  : bool
Check if we are in debug mode
isValidClass()  : bool
Is the given class a valid class to index Does not discriminate against the indexes. All indexes are worth the same
setAdmin()  : void
Set a (custom) admin query object
setClient()  : self
Set the client
setDebug()  : self
Set the debug mode
getClassesInHierarchy()  : array<string|int, mixed>
Get the classes in hierarchy to see if it's valid

Properties

Methods

getAdmin()

Get the admin query

public getAdmin() : Query
Return values
Query

getClient()

Get the client

public getClient() : Client
Return values
Client

getValidClasses()

Get all classes from all indexes and return them.

public getValidClasses() : array<string|int, mixed>

Used to get all classes that are to be indexed on change Note, only base classes are in this object. A publish recursive is required when any change from a relation is published.

Tags
throws
ReflectionException
throws
InvalidArgumentException
Return values
array<string|int, mixed>

getValidIndexes()

Ensure the getValidIndexes() method exists on all classes using this trait.

public abstract getValidIndexes() : mixed

isDebug()

Check if we are in debug mode

public isDebug() : bool
Return values
bool

isValidClass()

Is the given class a valid class to index Does not discriminate against the indexes. All indexes are worth the same

public isValidClass(string $class) : bool
Parameters
$class : string
Tags
throws
ReflectionException
throws
InvalidArgumentException
Return values
bool

setAdmin()

Set a (custom) admin query object

public setAdmin(Query $admin) : void
Parameters
$admin : Query

setClient()

Set the client

public setClient(Client $client) : self
Parameters
$client : Client
Return values
self

setDebug()

Set the debug mode

public setDebug(bool $debug) : self
Parameters
$debug : bool
Return values
self

getClassesInHierarchy()

Get the classes in hierarchy to see if it's valid

protected getClassesInHierarchy(string $index, array<string|int, mixed> $classes) : array<string|int, mixed>
Parameters
$index : string

Index to check classes for

$classes : array<string|int, mixed>

Classes to get hierarchy for

Tags
throws
ReflectionException
Return values
array<string|int, mixed>

        
On this page

Search results