DiscoveryLogRepository
in package
Discovery Log Repository.
Provides database access for heritage_discovery_log table. Tracks search queries and analytics.
Table of Contents
Methods
- cleanup() : int
- Cleanup old logs.
- getPopularSearches() : Collection
- Get popular searches (aggregated).
- getRecentSearches() : Collection
- Get recent searches.
- getSearchesByDate() : Collection
- Get searches by date (for charts).
- getStats() : object
- Get search statistics.
- log() : int
- Log a search query.
Methods
cleanup()
Cleanup old logs.
public
cleanup([int $daysToKeep = 90 ]) : int
Parameters
- $daysToKeep : int = 90
Return values
intgetPopularSearches()
Get popular searches (aggregated).
public
getPopularSearches([int|null $institutionId = null ][, int $days = 30 ][, int $limit = 20 ]) : Collection
Parameters
- $institutionId : int|null = null
- $days : int = 30
- $limit : int = 20
Return values
CollectiongetRecentSearches()
Get recent searches.
public
getRecentSearches([int|null $institutionId = null ][, int $limit = 100 ]) : Collection
Parameters
- $institutionId : int|null = null
- $limit : int = 100
Return values
CollectiongetSearchesByDate()
Get searches by date (for charts).
public
getSearchesByDate([int|null $institutionId = null ][, int $days = 30 ]) : Collection
Parameters
- $institutionId : int|null = null
- $days : int = 30
Return values
CollectiongetStats()
Get search statistics.
public
getStats([int|null $institutionId = null ][, int $days = 30 ]) : object
Parameters
- $institutionId : int|null = null
- $days : int = 30
Return values
objectlog()
Log a search query.
public
log(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>