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

__construct(string $connection, int|null $chunkSize = null)

Create a new database repository.

find(mixed $id)

Find the entry with the given ID.

array|Collection
get(string|null $type, EntryQueryOptions $options)

Return all the entries of a given type.

int
countExceptionOccurrences(IncomingEntry $exception)

Count the occurrences of an exception.

void
store(Collection $entries)

Store the given array of entries.

string
encodeContent(array $content)

Encode entry content for storage.

void
storeExceptions(Collection $exceptions)

Store the given array of exception entries.

void
storeTags(Collection $results)

Store the tags for the given entries.

void
insertChunkOfTags(array $tags)

Insert a chunk of tags, ignoring unique constraint violations.

Collection|null
update(Collection $updates)

Store the given entry updates and return the failed updates.

void
updateTags(EntryUpdate $entry)

Update tags of the given entry.

array|null
getMonitorTags()

Get the tags that should be monitored.

void
setMonitorTags(array|null $tags)

Set the tags that should be monitored.

void
loadMonitoredTags()

Load the monitored tags from storage.

bool
isMonitoring(array $tags)

Determine if any of the given tags are currently being monitored.

array
monitoring()

Get the list of tags currently being monitored.

void
monitor(array $tags)

Begin monitoring the given list of tags.

void
stopMonitoring(array $tags)

Stop monitoring the given list of tags.

int
prune(DateTimeInterface $before, bool $keepExceptions)

Prune all of the entries older than the given date.

void
clear()

Clear all the entries.

void
terminate()

Perform any clean-up tasks needed after storing Telescope entries.

table(string $table)

Get a query builder instance for the given table.

Details

at line 51
__construct(string $connection, int|null $chunkSize = null)

Create a new database repository.

Parameters

string $connection
int|null $chunkSize

at line 63
EntryResult find(mixed $id)

Find the entry with the given ID.

Parameters

mixed $id

Return Value

EntryResult

at line 90
array|Collection get(string|null $type, EntryQueryOptions $options)

Return all the entries of a given type.

Parameters

string|null $type
EntryQueryOptions $options

Return Value

array|Collection

at line 118
protected int countExceptionOccurrences(IncomingEntry $exception)

Count the occurrences of an exception.

Parameters

IncomingEntry $exception

Return Value

int

at line 129
void store(Collection $entries)

Store the given array of entries.

Parameters

Collection $entries

Return Value

void

at line 157
protected string encodeContent(array $content)

Encode entry content for storage.

Parameters

array $content

Return Value

string

at line 186
protected void storeExceptions(Collection $exceptions)

Store the given array of exception entries.

Parameters

Collection $exceptions

Return Value

void

at line 235
protected void storeTags(Collection $results)

Store the tags for the given entries.

Parameters

Collection $results

Return Value

void

at line 261
protected void insertChunkOfTags(array $tags)

Insert a chunk of tags, ignoring unique constraint violations.

Parameters

array $tags

Return Value

void

at line 273
Collection|null update(Collection $updates)

Store the given entry updates and return the failed updates.

Parameters

Collection $updates

Return Value

Collection|null

at line 307
protected void updateTags(EntryUpdate $entry)

Update tags of the given entry.

Parameters

EntryUpdate $entry

Return Value

void

at line 335
array|null getMonitorTags()

Get the tags that should be monitored.

Return Value

array|null

at line 343
void setMonitorTags(array|null $tags)

Set the tags that should be monitored.

Parameters

array|null $tags

Return Value

void

at line 351
void loadMonitoredTags()

Load the monitored tags from storage.

Return Value

void

at line 363
bool isMonitoring(array $tags)

Determine if any of the given tags are currently being monitored.

Parameters

array $tags

Return Value

bool

at line 375
array monitoring()

Get the list of tags currently being monitored.

Return Value

array

at line 383
void monitor(array $tags)

Begin monitoring the given list of tags.

Parameters

array $tags

Return Value

void

at line 399
void stopMonitoring(array $tags)

Stop monitoring the given list of tags.

Parameters

array $tags

Return Value

void

at line 409
int prune(DateTimeInterface $before, bool $keepExceptions)

Prune all of the entries older than the given date.

Parameters

DateTimeInterface $before
bool $keepExceptions

Return Value

int

at line 433
void clear()

Clear all the entries.

Return Value

void

at line 447
void terminate()

Perform any clean-up tasks needed after storing Telescope entries.

Return Value

void

at line 455
protected Builder table(string $table)

Get a query builder instance for the given table.

Parameters

string $table

Return Value

Builder