Doctrine
in package
implements
Search
Define database search and dbal
Define the interface for search using the doctrine server
Tags
Interfaces, Classes, Traits and Enums
- Search
Table of Contents
- $table : string
- Placeholder for table field
- $charset : string
- $interface : null|bool|Connection
- The search interface
- AddDocument() : Result
- Add a document
- DeleteDocument() : Result
- DeleteDocumentList() : Result
- Delete a document list
- DirectQuery() : Result
- Direct execute query
- Execute() : Result
- GetClient() : Connection|null
- GetServerVersion() : string|null
- GetVersion() : string
- IndexList() : Result
- Update() : Result
- Update a document
- client() : null|Connection
- Setup client
- setupFilters() : void
Properties
$table
Placeholder for table field
protected
string
$table
= ''
$charset
private
string
$charset
= 'utf8mb4'
The charset for the connection
$interface
The search interface
private
null|bool|Connection
$interface
= null
A client instance
Methods
AddDocument()
Add a document
public
AddDocument(int|string|null $id, string|null $type, mixed $data[, bool $has_auto_increment = false ][, string|null $table = null ]) : Result
Add a document to search index.
Parameters
- $id : int|string|null
-
A object id
- $type : string|null
-
The type of object, in our case the primary column
- $data : mixed
-
The document data with key value pairs
- $has_auto_increment : bool = false
-
Known table with auto increment column
- $table : string|null = null
Return values
Result —A system result object
DeleteDocument()
public
DeleteDocument(int|string|array<string|int, mixed> $id, string $type) : Result
Parameters
- $id : int|string|array<string|int, mixed>
- $type : string
Tags
Return values
Result —DeleteDocumentList()
Delete a document list
public
DeleteDocumentList(string|null $type) : Result
Delete a document list from search index. When no type is given then delete the hole index
Parameters
- $type : string|null
-
The type of object
Return values
Result —A system result object
DirectQuery()
Direct execute query
public
DirectQuery(string $sql) : Result
Execute a given query, use with care and commit using external arguments
Parameters
- $sql : string
-
The query to execute
Return values
Result —A system result object
Execute()
public
Execute(array<string|int, mixed> $filter, array<string|int, mixed> $order, array<string|int, mixed> $payload, string|null $language, null|object $handler) : Result
Parameters
- $filter : array<string|int, mixed>
- $order : array<string|int, mixed>
- $payload : array<string|int, mixed>
- $language : string|null
- $handler : null|object
Tags
Return values
Result —GetClient()
public
GetClient() : Connection|null
Return values
Connection|null —GetServerVersion()
public
GetServerVersion() : string|null
Tags
Return values
string|null —GetVersion()
public
GetVersion() : string
Tags
Return values
string —IndexList()
public
IndexList(string $type, array<string|int, mixed> $list[, bool $is_full = false ][, int|string|object $correct_count = -1 ]) : Result
Parameters
- $type : string
- $list : array<string|int, mixed>
- $is_full : bool = false
- $correct_count : int|string|object = -1
Tags
Return values
Result —Update()
Update a document
public
Update(array<string|int, mixed> $condition, array<string|int, mixed> $data[, string|null $table = null ]) : Result
Update a document in search index, without check for existing.
Parameters
- $condition : array<string|int, mixed>
- $data : array<string|int, mixed>
-
The document data with key value pairs
- $table : string|null = null
Return values
Result —A system result object
client()
Setup client
protected
client() : null|Connection
Connect to local database server and return instance. This method is cached
Return values
null|Connection —setupFilters()
private
setupFilters(array<string|int, Filter> $filters, QueryBuilder &$queryBuilder, QueryBuilder &$queryBuilderCount) : void
Parameters
- $filters : array<string|int, Filter>
-
A set of filters
- $queryBuilder : QueryBuilder
-
A doctrine query builder for search
- $queryBuilderCount : QueryBuilder
-
A doctrine query builder for count