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
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
$admin
protected
Query
$admin
A core admin object
$client
protected
Client
$client
The current client
$debug
Add debugging information
protected
bool
$debug
= false
Methods
getAdmin()
Get the admin query
public
getAdmin() : Query
Return values
QuerygetClient()
Get the client
public
getClient() : Client
Return values
ClientgetValidClasses()
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
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
boolisValidClass()
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
Return values
boolsetAdmin()
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
selfsetDebug()
Set the debug mode
public
setDebug(bool $debug) : self
Parameters
- $debug : bool
Return values
selfgetClassesInHierarchy()
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