FileAccess Orion

EventDBAL extends BaseDBAL
in package
implements DBAL

Define doctrine search and dbal

Implement the database storage layer for events that is abstract for sql queries with interface that could also be in the solr server

Tags
category

Interface function

author

Tobias Teichner webmaster@teichner.biz

since

File available since v3.13.1

Interfaces, Classes, Traits and Enums

DBAL
Define Database abstraction layer This is the dba handler interface definition

Table of Contents

$FIELD_ASSIGNMENT_ID  : string
$FIELD_DESCRIPTION  : string
$FIELD_EMPLOYEE_ID  : string
$FIELD_EXTERNAL_ID  : string
$FIELD_ID  : string
$FIELD_PROCESSED  : string
$FIELD_TASK_ID  : string
$FIELD_TASK_TYPE  : string
$FIELD_TRIGGER_DATE  : string
$FIELD_TYPE  : string
$TABLE  : string
$table  : string
Placeholder for table field
$charset  : string
$interface  : null|bool|Connection
The search interface
__construct()  : mixed
Create with individual table
AddDocument()  : Result
Add a document
DeleteDocument()  : Result
DeleteDocumentList()  : Result
Delete a document list
DirectQuery()  : Result
Direct execute query
Drop()  : Result
Delete a document
Execute()  : Result
Fetch()  : Result
Get a document Get a document from database index.
FetchPending()  : Result
Fetch list of pending event push notifications
GetClient()  : Connection|null
GetServerVersion()  : string|null
GetVersion()  : string
IndexList()  : Result
Update()  : Result
Update a document
Write()  : Result
Add a document Add a document to search index.
WriteList()  : Result
Add a document set Add a list of documents to search index.
AddSingle()  : Result
client()  : null|Connection
Setup client
DropSingle()  : Result
FetchSingle()  : Result
hasDelta()  : bool
setupFilters()  : void

Properties

$FIELD_ASSIGNMENT_ID

public static string $FIELD_ASSIGNMENT_ID = 'assignment_id'

$FIELD_DESCRIPTION

public static string $FIELD_DESCRIPTION = 'description'

$FIELD_EMPLOYEE_ID

public static string $FIELD_EMPLOYEE_ID = 'employee_id'

$FIELD_EXTERNAL_ID

public static string $FIELD_EXTERNAL_ID = 'external_id'

$FIELD_ID

public static string $FIELD_ID = 'id'

$FIELD_PROCESSED

public static string $FIELD_PROCESSED = 'processed'

$FIELD_TASK_ID

public static string $FIELD_TASK_ID = 'task_id'

$FIELD_TASK_TYPE

public static string $FIELD_TASK_TYPE = 'task_type'

$FIELD_TRIGGER_DATE

public static string $FIELD_TRIGGER_DATE = 'trigger_date'

$FIELD_TYPE

public static string $FIELD_TYPE = 'type'

$TABLE

public static string $TABLE = 'event'

$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

__construct()

Create with individual table

public __construct() : mixed

VoucherDBAL constructor.

Return values
mixed

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
inheritDoc
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

Drop()

Delete a document

public Drop(int|string $id) : Result
Parameters
$id : int|string

A object id

Tags
inheritDoc
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
inheritDoc
Return values
Result

Fetch()

Get a document Get a document from database index.

public Fetch(mixed $id) : Result
Parameters
$id : mixed

A object id

Tags
inheritDoc
Return values
Result

A system result object

FetchPending()

Fetch list of pending event push notifications

public FetchPending() : Result
Return values
Result

GetClient()

public GetClient() : Connection|null
Return values
Connection|null

GetServerVersion()

public GetServerVersion() : string|null
Tags
inheritDoc
Return values
string|null

GetVersion()

public GetVersion() : string
Tags
inheritDoc
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
inheritDoc
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

Write()

Add a document Add a document to search index.

public Write(int|string|null $id, array<string|int, mixed> $data) : Result
Parameters
$id : int|string|null

A object id or, null for new entries

$data : array<string|int, mixed>

The document data with key value pairs

Return values
Result

A system result object

WriteList()

Add a document set Add a list of documents to search index.

public WriteList(int $id, string $type, array<string|int, mixed> $data) : Result
Parameters
$id : int

A object id, this field is mandatory

$type : string

A object type name, this field is mandatory

$data : array<string|int, mixed>

The document data with key value pairs

Return values
Result

A system result object

AddSingle()

protected AddSingle(array<string|int, mixed> $cells, string $pk, string $table) : Result
Parameters
$cells : array<string|int, mixed>
$pk : string
$table : string
Return values
Result

client()

Setup client

protected client() : null|Connection

Connect to local database server and return instance. This method is cached

Return values
null|Connection

DropSingle()

protected DropSingle(int|string $id, string $pk, string $table) : Result
Parameters
$id : int|string
$pk : string
$table : string
Return values
Result

FetchSingle()

protected FetchSingle(int|string $id, string $pk, string $table) : Result
Parameters
$id : int|string
$pk : string
$table : string
Return values
Result

hasDelta()

private hasDelta( $old,  $new) : bool
Parameters
$old :
$new :
Return values
bool

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

Return values
void

Search results