Handler
in package
implements
SearchPlugin, ContentSearchIndex
Uses
ParallelSearchIndex
Implement basket search handler
This class provides interfaces for custom basket search handling
Tags
Interfaces, Classes, Traits and Enums
- SearchPlugin
- Define a system search plugin
- ContentSearchIndex
Table of Contents
- $_bookingsDb : BookingsDBAL|null
- Buffer for bookings db
- $multi_threads : int
- Allow the multi threading with this parallel tasks
- BasketChangeStatus() : void
- Called on basket status change, reaction is needed on cancel
- BuildEntry() : stdClass
- Build entry
- DoSearch() : Result
- Do search for baskets
- DoSearchBooking() : Result
- Do search for baskets
- DoSearchStorageMovement() : Result
- FindFittingRoom() : array<string|int, mixed>|null
- Find a fitting room for persons count and frame size
- LisFreeRooms() : array<string|int, mixed>|null
- ListBookedRooms() : array<string|int, mixed>|null
- Get booked person count mapped by room
- OnAddOrUpdateContent() : void
- React on new bookings and baskets
- OnAdminChangeBasket() : void
- OnCommandLineInterfaceCall() : void
- OnDeleteContent() : void
- React on basket deletion
- OnIndex() : void
- OnMergeUserAccount() : void
- Move ownership of linked baskets to new master account
- OnNewIndex() : void
- OnSyncronize() : void
- RegisterHooks() : array<string|int, mixed>
- Register system hooks
- SetupTemplate() : Result
- Setup getter and setter
- doIndex() : Result
- bookBasketRooms() : Result
- bookingsDb() : BookingsDBAL
- bookRoom() : Result
- Create a single booking into certain space
- checkBasketArticles() : Result
- fixBasketArticles() : Result
Properties
$_bookingsDb
Buffer for bookings db
private
BookingsDBAL|null
$_bookingsDb
= null
$multi_threads
Allow the multi threading with this parallel tasks
private
int
$multi_threads
= 3
Methods
BasketChangeStatus()
Called on basket status change, reaction is needed on cancel
public
BasketChangeStatus( $req) : void
Parameters
Return values
void —BuildEntry()
Build entry
public
BuildEntry(object $doc[, string|null $language = null ][, array<string|int, mixed>|null $extra = null ]) : stdClass
Convert the search result to frontend object row
Parameters
- $doc : object
-
The search response
- $language : string|null = null
-
The request language
- $extra : array<string|int, mixed>|null = null
-
Additional fields
Return values
stdClass —A result object
DoSearch()
Do search for baskets
public
DoSearch(string|null $language, array<string|int, mixed> $payload) : Result
Execute the search by given arguments
Parameters
- $language : string|null
-
The language to search in
- $payload : array<string|int, mixed>
-
The search request
Return values
Result —A system result
DoSearchBooking()
Do search for baskets
public
DoSearchBooking(string|null $language, array<string|int, mixed> $payload) : Result
Execute the search by given arguments
Parameters
- $language : string|null
-
The language to search in
- $payload : array<string|int, mixed>
-
The search request
Return values
Result —A system result
DoSearchStorageMovement()
public
DoSearchStorageMovement(string|null $language, array<string|int, mixed> $payload) : Result
Parameters
- $language : string|null
- $payload : array<string|int, mixed>
Return values
Result —FindFittingRoom()
Find a fitting room for persons count and frame size
public
FindFittingRoom(string $article_id, array<string|int, mixed> $frames, int $persons, int $frame_size[, string|null $room_article_id = null ][, string|null $target_room = null ]) : array<string|int, mixed>|null
Parameters
- $article_id : string
-
The reference article parent id
- $frames : array<string|int, mixed>
-
The found frames
- $persons : int
-
The requesting persons
- $frame_size : int
-
The target frame size
- $room_article_id : string|null = null
-
When set, the frame size does not matter but the actually linked room article
- $target_room : string|null = null
-
Explicit given target room id in context of article
Return values
array<string|int, mixed>|null —LisFreeRooms()
public
LisFreeRooms(string $article_id, array<string|int, mixed> $frames) : array<string|int, mixed>|null
Parameters
- $article_id : string
- $frames : array<string|int, mixed>
Return values
array<string|int, mixed>|null —ListBookedRooms()
Get booked person count mapped by room
public
ListBookedRooms(array<string|int, mixed> $room_ids) : array<string|int, mixed>|null
Parameters
- $room_ids : array<string|int, mixed>
Return values
array<string|int, mixed>|null —OnAddOrUpdateContent()
React on new bookings and baskets
public
OnAddOrUpdateContent(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnAdminChangeBasket()
public
OnAdminChangeBasket(HookArgument $req) : void
Parameters
- $req : HookArgument
Return values
void —OnCommandLineInterfaceCall()
public
OnCommandLineInterfaceCall(HookArgument $param) : void
Parameters
- $param : HookArgument
Return values
void —OnDeleteContent()
React on basket deletion
public
OnDeleteContent(HookArgument $reference) : void
Clean search index and the bookings list
Parameters
- $reference : HookArgument
Return values
void —OnIndex()
public
OnIndex(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnMergeUserAccount()
Move ownership of linked baskets to new master account
public
OnMergeUserAccount(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnNewIndex()
public
OnNewIndex(HookArgument $reference) : void
Parameters
- $reference : HookArgument
Return values
void —OnSyncronize()
public
OnSyncronize(HookArgument $reference[, bool $is_full = false ]) : void
Parameters
- $reference : HookArgument
- $is_full : bool = false
Return values
void —RegisterHooks()
Register system hooks
public
RegisterHooks() : array<string|int, mixed>
Register a set of handler functions to be called in certain positions. These are mainly used to manage the basket search with update interfaces
Return values
array<string|int, mixed> —The hooks to register
SetupTemplate()
Setup getter and setter
public
SetupTemplate([array<string|int, mixed> $data = null ]) : Result
The setter is just an interface and not active
Parameters
- $data : array<string|int, mixed> = null
-
New configuration values
Return values
Result —The template fetch result
doIndex()
protected
doIndex(string $type, array<string|int, mixed> $list, CronJob $job, bool $is_full) : Result
Parameters
- $type : string
- $list : array<string|int, mixed>
- $job : CronJob
- $is_full : bool
Return values
Result —bookBasketRooms()
private
bookBasketRooms(Basket|null $basket) : Result
Parameters
- $basket : Basket|null
Return values
Result —bookingsDb()
private
bookingsDb() : BookingsDBAL
Return values
BookingsDBAL —bookRoom()
Create a single booking into certain space
private
bookRoom(array<string|int, mixed> $room, string $article_id, string $basket_id, int $persons) : Result
Parameters
- $room : array<string|int, mixed>
-
The room data
- $article_id : string
-
The related article
- $basket_id : string
-
The causing basket
- $persons : int
-
The persons to book into
Return values
Result —checkBasketArticles()
private
checkBasketArticles(Basket|null $basket) : Result
Parameters
- $basket : Basket|null
Return values
Result —fixBasketArticles()
private
fixBasketArticles(Basket|null $basket) : Result
Parameters
- $basket : Basket|null