DatabaseEntriesRepository
class DatabaseEntriesRepository implements EntriesRepository, ClearableRepository, PrunableRepository, TerminableRepository
Constants
| DEFAULT_CHUNK_SIZE |
The default number of entries inserted at once. |
| protected MONITORED_TAGS_CONTEXT_KEY |
Context key for the per-request monitored tags cache. |
Properties
| protected string | $connection | The database connection name that should be used. |
|
| protected int | $chunkSize | The number of entries that will be inserted at once into the database. |
Methods
Create a new database repository.
Find the entry with the given ID.
Encode entry content for storage.
Insert a chunk of tags, ignoring unique constraint violations.
Get the tags that should be monitored.
Set the tags that should be monitored.
Load the monitored tags from storage.
Determine if any of the given tags are currently being monitored.
Get the list of tags currently being monitored.
Begin monitoring the given list of tags.
Stop monitoring the given list of tags.
Prune all of the entries older than the given date.
Clear all the entries.
Perform any clean-up tasks needed after storing Telescope entries.
Details
at line 54
__construct(string $connection, int|null $chunkSize = null)
Create a new database repository.
at line 66
EntryResult
find(string $id)
Find the entry with the given ID.
at line 104
array|Collection
get(string|null $type, EntryQueryOptions $options)
Return all the entries of a given type.
at line 132
protected int
countExceptionOccurrences(IncomingEntry $exception)
Count the occurrences of an exception.
at line 143
void
store(Collection $entries)
Store the given array of entries.
at line 171
protected string
encodeContent(array $content)
Encode entry content for storage.
at line 200
protected void
storeExceptions(Collection $exceptions)
Store the given array of exception entries.
at line 249
protected void
storeTags(Collection $results)
Store the tags for the given entries.
at line 275
protected void
insertChunkOfTags(array $tags)
Insert a chunk of tags, ignoring unique constraint violations.
at line 287
Collection|null
update(Collection $updates)
Store the given entry updates and return the failed updates.
at line 321
protected void
updateTags(EntryUpdate $entry)
Update tags of the given entry.
at line 349
array|null
getMonitorTags()
Get the tags that should be monitored.
at line 357
void
setMonitorTags(array|null $tags)
Set the tags that should be monitored.
at line 365
void
loadMonitoredTags()
Load the monitored tags from storage.
at line 381
bool
isMonitoring(array $tags)
Determine if any of the given tags are currently being monitored.
at line 393
array
monitoring()
Get the list of tags currently being monitored.
at line 401
void
monitor(array $tags)
Begin monitoring the given list of tags.
at line 420
void
stopMonitoring(array $tags)
Stop monitoring the given list of tags.
at line 430
int
prune(DateTimeInterface $before, bool $keepExceptions)
Prune all of the entries older than the given date.
at line 454
void
clear()
Clear all the entries.
at line 468
void
terminate()
Perform any clean-up tasks needed after storing Telescope entries.
at line 476
protected Builder
table(string $table)
Get a query builder instance for the given table.