Course
in package
implements
ResourceInterface
Course.
Tags
Attributes
- #[Entity]
Table of Contents
Interfaces
- ResourceInterface
Properties
- $code : string
- Course code.
- $documents : Collection<string|int, CourseDocument>
- Exams (and summaries) in this course.
- $name : string
- Course name.
- $similarCoursesFrom : Collection<string|int, Course>
- Courses that say they are similar to this course
- $similarCoursesTo : Collection<string|int, Course>
- Courses similar to this course
Methods
- __construct() : mixed
- addSimilarCourseTo() : void
- Adds a course to the similar courses to list if it doesn't yet exist.
- clearSimilarCoursesTo() : void
- Removes all references to similar courses to this course.
- getCode() : string
- Get the course code.
- getDocuments() : Collection<string|int, CourseDocument>
- Get all exams belonging to this study.
- getName() : string
- Get the course name.
- getResourceId() : string
- Get the resource ID.
- getSimilarCoursesAsString() : string
- Get the similar courses to this course as a comma separated string.
- getSimilarCoursesTo() : Collection<string|int, Course>
- Get the similar courses to this course.
- setCode() : void
- Set the course code.
- setName() : void
- Set the course name.
- toArray() : array{code: string, name: string, similar: string}
- toGdprArray() : CourseGdprArrayType
Properties
$code
Course code.
protected
string
$code
Attributes
- #[Column]
- $type: 'string'
- #[Id]
$documents
Exams (and summaries) in this course.
protected
Collection<string|int, CourseDocument>
$documents
Ordered by date, from old to recent since documents are not necessarily uploaded in chronological order
Attributes
- #[OneToMany]
- $targetEntity: \Education\Model\CourseDocument::class
- $mappedBy: 'course'
- #[OrderBy]
- $value: ['date' => 'ASC']
$name
Course name.
protected
string
$name
Attributes
- #[Column]
- $type: 'string'
$similarCoursesFrom
Courses that say they are similar to this course
protected
Collection<string|int, Course>
$similarCoursesFrom
Attributes
- #[ManyToMany]
- $targetEntity: self::class
- $mappedBy: 'similarCoursesTo'
$similarCoursesTo
Courses similar to this course
private
Collection<string|int, Course>
$similarCoursesTo
Attributes
- #[InverseJoinColumn]
- $name: 'similar_course_code'
- $referencedColumnName: 'code'
- #[JoinColumn]
- $name: 'course_code'
- $referencedColumnName: 'code'
- #[JoinTable]
- $name: 'SimilarCourse'
- #[ManyToMany]
- $targetEntity: self::class
- $inversedBy: 'similarCoursesFrom'
Methods
__construct()
public
__construct() : mixed
addSimilarCourseTo()
Adds a course to the similar courses to list if it doesn't yet exist.
public
addSimilarCourseTo(self $course) : void
Parameters
- $course : self
clearSimilarCoursesTo()
Removes all references to similar courses to this course.
public
clearSimilarCoursesTo() : void
getCode()
Get the course code.
public
getCode() : string
Return values
stringgetDocuments()
Get all exams belonging to this study.
public
getDocuments() : Collection<string|int, CourseDocument>
Return values
Collection<string|int, CourseDocument>getName()
Get the course name.
public
getName() : string
Return values
stringgetResourceId()
Get the resource ID.
public
getResourceId() : string
Return values
stringgetSimilarCoursesAsString()
Get the similar courses to this course as a comma separated string.
public
getSimilarCoursesAsString() : string
Return values
stringgetSimilarCoursesTo()
Get the similar courses to this course.
public
getSimilarCoursesTo() : Collection<string|int, Course>
Return values
Collection<string|int, Course>setCode()
Set the course code.
public
setCode(string $code) : void
Parameters
- $code : string
setName()
Set the course name.
public
setName(string $name) : void
Parameters
- $name : string
toArray()
public
toArray() : array{code: string, name: string, similar: string}
Return values
array{code: string, name: string, similar: string}toGdprArray()
public
toGdprArray() : CourseGdprArrayType