VLAM Documentation

CaseController extends BaseController
in package

Class BaseController

BaseController provides a convenient place for loading components and performing functions that are needed by all your controllers. Extend this class in any new controllers: class Home extends BaseController

For security be sure to declare any new methods as protected or private.

Table of Contents

Properties

$assignmentEntry  : mixed
$assignmentEntryProperties  : mixed
$assignmentResult  : mixed
$assignments  : mixed
$caseEntry  : mixed
$caseEntryProperties  : mixed
$caseResult  : mixed
$cases  : mixed
$data  : mixed
$helpers  : array<int, string>
An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all other controllers that extend BaseController.
$meetings  : mixed
$request  : CLIRequest|IncomingRequest
Instance of the main Request object.
$user  : mixed

Methods

complete()  : mixed
entry()  : mixed
get_assignment()  : mixed
get_assignment_results()  : mixed
get_case()  : mixed
Get case from database and make sure it exists
get_case_results()  : mixed
get_edit_route()  : mixed
get_entry_properties_result()  : array<string|int, mixed>
Retrieves entry properties and maps property values based on user ID.
get_meeting()  : mixed
get_training()  : mixed
index()  : string
initController()  : mixed
outro()  : mixed
save()  : mixed
user_in_training()  : mixed
errorResponse()  : mixed
Helper to return json error message.
fetch_entry()  : bool
fetch_entry_properties()  : mixed
get_complete_action()  : mixed
has_complete_action()  : mixed
initSessionController()  : void
is_complete_action()  : mixed
validTrainingForUser()  : mixed

Properties

$assignmentEntryProperties

protected mixed $assignmentEntryProperties

$helpers

An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all other controllers that extend BaseController.

protected array<int, string> $helpers = ['download', 'csrf', 'user', 'front/dashboard', 'front/sidebar', 'front/header', 'front/footer']

$request

Instance of the main Request object.

protected CLIRequest|IncomingRequest $request

Methods

complete()

public complete(int $meeting_id, int $assignment_id, int $case_id) : mixed
Parameters
$meeting_id : int
$assignment_id : int
$case_id : int

entry()

public entry(int $meeting_id, int $assignment_id, int $case_id, int $entry_num) : mixed
Parameters
$meeting_id : int
$assignment_id : int
$case_id : int
$entry_num : int

get_assignment()

public get_assignment(int $assignment_id) : mixed
Parameters
$assignment_id : int

get_assignment_results()

public get_assignment_results(int $assignment_id) : mixed
Parameters
$assignment_id : int

get_case()

Get case from database and make sure it exists

public get_case(int $assignment_id, int $case_id) : mixed
Parameters
$assignment_id : int
$case_id : int

get_case_results()

public get_case_results(int $case_id) : mixed
Parameters
$case_id : int

get_edit_route()

public get_edit_route(string $route, mixed ...$args) : mixed
Parameters
$route : string
$args : mixed

get_entry_properties_result()

Retrieves entry properties and maps property values based on user ID.

public get_entry_properties_result(int $id, string $id_key, object &$result_object, object &$entry_object, object &$property_object) : array<string|int, mixed>

This function fetches results from the given result object (assignment or case), joins it with the entry object, and maps the corresponding property values using the property object.

Parameters
$id : int

The ID of the entry to fetch properties for.

$id_key : string

The column name used to filter results by ID.

$result_object : object

The model instance representing the results table (passed by reference).

$entry_object : object

The model instance representing the entry table (passed by reference).

$property_object : object

The model instance representing the property table (passed by reference).

Return values
array<string|int, mixed>

An array of results with mapped property values. Returns an empty array if no user ID is found.

get_meeting()

public get_meeting(int $meeting_id) : mixed
Parameters
$meeting_id : int

get_training()

public get_training(int $training_id) : mixed
Parameters
$training_id : int

index()

public index(int $meeting_id, int $assignment_id, int $case_id) : string
Parameters
$meeting_id : int
$assignment_id : int
$case_id : int
Return values
string

initController()

public initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) : mixed
Parameters
$request : RequestInterface
$response : ResponseInterface
$logger : LoggerInterface

outro()

public outro(int $meeting_id, int $assignment_id, int $case_id) : mixed
Parameters
$meeting_id : int
$assignment_id : int
$case_id : int

save()

public save(int $meeting_id, int $assignment_id, int $case_id, int $entry_num) : mixed
Parameters
$meeting_id : int
$assignment_id : int
$case_id : int
$entry_num : int

user_in_training()

public user_in_training(int $user_id, int $training_id) : mixed
Parameters
$user_id : int
$training_id : int

errorResponse()

Helper to return json error message.

private errorResponse(mixed &$warnings, mixed $message) : mixed
Parameters
$warnings : mixed
$message : mixed

fetch_entry()

private fetch_entry(int $assignment_id, int $case_id, int $entry_num) : bool
Parameters
$assignment_id : int
$case_id : int
$entry_num : int
Return values
bool

fetch_entry_properties()

private fetch_entry_properties(array<string|int, mixed> $properties, array<string|int, mixed> &$saved_results, array<string|int, mixed> &$entry) : mixed
Parameters
$properties : array<string|int, mixed>
$saved_results : array<string|int, mixed>
$entry : array<string|int, mixed>

get_complete_action()

private get_complete_action(mixed $controller_name) : mixed
Parameters
$controller_name : mixed

has_complete_action()

private has_complete_action(mixed $case) : mixed
Parameters
$case : mixed

is_complete_action()

private is_complete_action(mixed $controller_name) : mixed
Parameters
$controller_name : mixed

validTrainingForUser()

private validTrainingForUser(mixed $user) : mixed
Parameters
$user : mixed

        
On this page

Search results