EntityCacheSyncService
in package
Entity Cache Sync Service.
Synchronizes approved NER entities from ahgAIPlugin's ahg_ner_entity table to the heritage_entity_cache table for fast discovery filtering.
Table of Contents
Methods
- cleanOrphaned() : int
- Remove orphaned cache entries (where source NER entity no longer exists or rejected).
- getMinConfidence() : float
- Get current minimum confidence.
- getPendingSync() : array<string|int, mixed>
- Get entities that need syncing (approved but not in cache).
- getStats() : array<string|int, mixed>
- Get sync statistics.
- mapEntityType() : string|null
- Map NER entity type to heritage entity type.
- normalizeValue() : string
- Normalize entity value for matching and deduplication.
- setMinConfidence() : self
- Set minimum confidence threshold.
- syncAllApproved() : array<string|int, mixed>
- Sync all approved NER entities across the system.
- syncFromNer() : int
- Sync approved NER entities to heritage_entity_cache for a specific object.
Methods
cleanOrphaned()
Remove orphaned cache entries (where source NER entity no longer exists or rejected).
public
cleanOrphaned() : int
Return values
int —Number of entries removed
getMinConfidence()
Get current minimum confidence.
public
getMinConfidence() : float
Return values
floatgetPendingSync()
Get entities that need syncing (approved but not in cache).
public
getPendingSync([int $limit = 100 ]) : array<string|int, mixed>
Parameters
- $limit : int = 100
Return values
array<string|int, mixed>getStats()
Get sync statistics.
public
getStats() : array<string|int, mixed>
Return values
array<string|int, mixed>mapEntityType()
Map NER entity type to heritage entity type.
public
mapEntityType(string $nerType) : string|null
Parameters
- $nerType : string
Return values
string|nullnormalizeValue()
Normalize entity value for matching and deduplication.
public
normalizeValue(string $value) : string
Parameters
- $value : string
Return values
stringsetMinConfidence()
Set minimum confidence threshold.
public
setMinConfidence(float $confidence) : self
Parameters
- $confidence : float
Return values
selfsyncAllApproved()
Sync all approved NER entities across the system.
public
syncAllApproved([int $limit = 1000 ][, int|null $sinceId = null ][, bool $dryRun = false ]) : array<string|int, mixed>
Parameters
- $limit : int = 1000
-
Maximum objects to process
- $sinceId : int|null = null
-
Only process objects with ID > sinceId
- $dryRun : bool = false
-
If true, don't actually sync
Return values
array<string|int, mixed> —Summary of sync operation
syncFromNer()
Sync approved NER entities to heritage_entity_cache for a specific object.
public
syncFromNer(int $objectId[, bool $replace = true ]) : int
Parameters
- $objectId : int
-
The information object ID
- $replace : bool = true
-
Whether to replace existing NER entries (default true)
Return values
int —Number of entities synced