class ProjectStatisticsController extends Controller

Traits

AuthorizesRequests
ValidatesRequests

Methods

bool
isAutomatedRequest(Request|null $request = null)

Determines if the request was done by an automated script (with API token or ajax).

array
getAnnotationStatistics(string $type, callable $restrict)

Compute the annotation statistics of image or video volumes.

show(Request $request, int $id)

Shows the project statistics page.

array
getVolumeStatistics(Project $project, string $type)

Get the statistics of volumes with a certain media type.

Details

in Controller at line 21
bool isAutomatedRequest(Request|null $request = null)

Determines if the request was done by an automated script (with API token or ajax).

Parameters

Request|null $request

Return Value

bool

protected array getAnnotationStatistics(string $type, callable $restrict)

Compute the annotation statistics of image or video volumes.

The statistics are derived from the same join of annotations, annotation labels and files. The join is computed only once (as materialized CTE) and all statistics are fetched with a single query.

Parameters

string $type

'image' or 'video'

callable $restrict

Receives the base query and restricts it to the volumes of the statistics (e.g. with a where on "{$type}s.volume_id").

Return Value

array

at line 23
show(Request $request, int $id)

Shows the project statistics page.

Parameters

Request $request
int $id

project ID

at line 98
protected array getVolumeStatistics(Project $project, string $type)

Get the statistics of volumes with a certain media type.

Parameters

Project $project
string $type

Return Value

array