Documentation

Course
in package

Course service.

Table of Contents

Properties

$bulkForm  : Bulk|null
$aclService  : AclService
$bulkExamForm  : Bulk
$bulkSummaryForm  : Bulk
$config  : array<string|int, mixed>
$courseDocumentMapper  : CourseDocument
$courseForm  : Course
$courseMapper  : Course
$storageService  : FileStorage
$tempUploadForm  : TempUpload
$translator  : Translator

Methods

__construct()  : mixed
bulkExamEdit()  : bool
bulkSummaryEdit()  : bool
courseDocumentToFilename()  : string
Get a filename from an exam (or summary).
deleteCourse()  : void
Delete a course and all its documents.
deleteDocument()  : void
Delete a course document
deleteTempExam()  : void
Deletes a temp uploaded exam or summary.
getAllCourses()  : array<string|int, Course>
Get all courses.
getBulkExamForm()  : Bulk
Get the bulk exam edit form.
getBulkSummaryForm()  : Bulk
Get the bulk summary edit form.
getConfig()  : array<string|int, mixed>
Get the education config, as used by this service.
getCourse()  : Course|null
Get a course.
getCourseForm()  : Course
Get the add course form.
getDocument()  : CourseDocument|null
Get a specific course document.
getDocumentDownload()  : Stream|null
Get an exam.
getDocumentsForCourse()  : array<string|int, CourseDocument>
Get all documents of a specific type for a specific course.
getTempUploadForm()  : TempUpload
Get the Temporary Upload form.
guessCourseDocumentData()  : array{course: string, date: string, language: string}
Guesses the course code and date based on an exam's filename.
guessSummaryAuthor()  : string
Guesses the summary author based on a summary's filename.
saveCourse()  : Course
Save a course.
searchCourse()  : array<string|int, Course>
Search for a course.
tempExamUpload()  : bool
tempSummaryUpload()  : bool
updateCourse()  : Course
Update a course.
bulkEdit()  : bool
Finish the bulk edit.
getBulkForm()  : Bulk
Get the bulk edit form.
tempUpload()  : bool
Temporary exam upload.

Properties

$bulkSummaryForm read-only

private Bulk $bulkSummaryForm

$config read-only

private array<string|int, mixed> $config

$translator read-only

private Translator $translator

Methods

__construct()

public __construct(AclService $aclService, Translator $translator, FileStorage $storageService, Course $courseMapper, CourseDocument $courseDocumentMapper, Course $courseForm, TempUpload $tempUploadForm, Bulk $bulkSummaryForm, Bulk $bulkExamForm, array<string|int, mixed> $config) : mixed
Parameters
$aclService : AclService
$translator : Translator
$storageService : FileStorage
$courseMapper : Course
$courseDocumentMapper : CourseDocument
$courseForm : Course
$tempUploadForm : TempUpload
$bulkSummaryForm : Bulk
$bulkExamForm : Bulk
$config : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

bulkExamEdit()

public bulkExamEdit(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

bulkSummaryEdit()

public bulkSummaryEdit(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>
Tags
throws
Exception
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

courseDocumentToFilename()

Get a filename from an exam (or summary).

public courseDocumentToFilename(CourseDocument $document) : string

Exams will have a filename of the following format:

-exam---.pdf

Summaries have the following format:

--summary---.pdf

Parameters
$document : CourseDocument
Return values
string

Filename

deleteCourse()

Delete a course and all its documents.

public deleteCourse(Course $course) : void
Parameters
$course : Course

deleteTempExam()

Deletes a temp uploaded exam or summary.

public deleteTempExam(string $filename[, string $type = 'exam' ]) : void
Parameters
$filename : string

The file to delete

$type : string = 'exam'

The type to delete (exam/summary)

getAllCourses()

Get all courses.

public getAllCourses() : array<string|int, Course>
Return values
array<string|int, Course>

getBulkExamForm()

Get the bulk exam edit form.

public getBulkExamForm() : Bulk
Tags
throws
Exception
Return values
Bulk

getBulkSummaryForm()

Get the bulk summary edit form.

public getBulkSummaryForm() : Bulk
Tags
throws
Exception
Return values
Bulk

getConfig()

Get the education config, as used by this service.

public getConfig([string $key = 'education' ]) : array<string|int, mixed>
Parameters
$key : string = 'education'
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification

Return values
array<string|int, mixed>

getCourse()

Get a course.

public getCourse(string $code) : Course|null
Parameters
$code : string
Return values
Course|null

getDocumentDownload()

Get an exam.

public getDocumentDownload(int $id) : Stream|null
Parameters
$id : int
Return values
Stream|null

getDocumentsForCourse()

Get all documents of a specific type for a specific course.

public getDocumentsForCourse(Course $course, string $type) : array<string|int, CourseDocument>
Parameters
$course : Course
$type : string
Tags
psalm-param

class-string<ExamModel>|class-string<SummaryModel> $type

Return values
array<string|int, CourseDocument>

guessCourseDocumentData()

Guesses the course code and date based on an exam's filename.

public guessCourseDocumentData(string $filename) : array{course: string, date: string, language: string}
Parameters
$filename : string
Return values
array{course: string, date: string, language: string}

guessSummaryAuthor()

Guesses the summary author based on a summary's filename.

public static guessSummaryAuthor(string $filename) : string
Parameters
$filename : string
Return values
string

saveCourse()

Save a course.

public saveCourse(array<string|int, mixed> $data) : Course
Parameters
$data : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
Course

searchCourse()

Search for a course.

public searchCourse(array<string|int, mixed> $data) : array<string|int, Course>
Parameters
$data : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
array<string|int, Course>

tempExamUpload()

public tempExamUpload(Parameters $post, Parameters $files) : bool
Parameters
$post : Parameters
$files : Parameters
Return values
bool

tempSummaryUpload()

public tempSummaryUpload(Parameters $post, Parameters $files) : bool
Parameters
$post : Parameters
$files : Parameters
Return values
bool

updateCourse()

Update a course.

public updateCourse(Course $course, array<string|int, mixed> $data) : Course
Parameters
$course : Course
$data : array<string|int, mixed>
Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
Course

bulkEdit()

Finish the bulk edit.

protected bulkEdit(array<string|int, mixed> $data, string $type) : bool
Parameters
$data : array<string|int, mixed>

POST Data

$type : string
Tags
throws
Exception
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

getBulkForm()

Get the bulk edit form.

protected getBulkForm(string $type) : Bulk
Parameters
$type : string
Tags
throws
Exception
Return values
Bulk

tempUpload()

Temporary exam upload.

protected tempUpload(array<string|int, mixed> $post, array<string|int, mixed> $files, string $uploadDirectory) : bool

Uploads exams into a temporary folder.

Parameters
$post : array<string|int, mixed>

POST Data

$files : array<string|int, mixed>

FILES Data

$uploadDirectory : string

the directory to place the exam in

Tags
phpcsSuppress

SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification

Return values
bool

        
On this page

Search results