class DefaultManager implements IndexManagerInterface, ApplicationAwareInterface (View source)

Default Search Index Manager This manager allows indexing a type against all applicable registered indexes.

When searching, it returns the first result set found.

Traits

Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface

Constants

TYPE_ALL

The type to use when you want to apply to all types

Properties

protected Application $app from  ApplicationAwareTrait
protected array $indexes
protected $inflated

Methods

setApplication(Application $app)

Setter method for the application

Iterator
getIndexes(string $type, bool $includeGlobal = true)

Get the indexes for a type

inflateIndex($class)

Get the proper index from the stored value

getAllIndexes()

Get all indexes registered against this manager

addIndex(string $type, IndexInterface|string $index)

Add an index to this manager

void
index($type, $object)

Index an object

void
forget(string $type, mixed $object)

Forget an object

clear(string $type)

Clear out a type.

Details

setApplication(Application $app)

Setter method for the application

Parameters

Application $app

Iterator getIndexes(string $type, bool $includeGlobal = true)

Get the indexes for a type

Parameters

string $type
bool $includeGlobal

Return Value

Iterator

protected IndexInterface inflateIndex($class)

Get the proper index from the stored value

Parameters

$class

Return Value

IndexInterface

Generator getAllIndexes()

Get all indexes registered against this manager

Return Value

Generator

addIndex(string $type, IndexInterface|string $index)

Add an index to this manager

Parameters

string $type

The type to index. Use DefaultManager::TYPE_ALL to apply to all types.

IndexInterface|string $index

void index($type, $object)

Index an object

Parameters

$type
$object

Return Value

void

void forget(string $type, mixed $object)

Forget an object

Parameters

string $type
mixed $object

Return Value

void

clear(string $type)

Clear out a type.

Passing DefaultManager::TYPE_ALL will clear out ALL types, not just types registered against ALL

Parameters

string $type

The type to clear