You are here

function CourseObject::getReport in Course 3.x

Same name and namespace in other branches
  1. 8.3 src/Entity/CourseObject.php \Drupal\course\Entity\CourseObject::getReport()
  2. 8.2 src/Entity/CourseObject.php \Drupal\course\Entity\CourseObject::getReport()

Let the course object provide its own reports.

Return value

array An array containing:

  • title: The title of this report as show on the page
  • content: Content to be displayed.
  • url: URL to be loaded in an iframe.

Reports should return either 'content' or 'url'.

3 calls to CourseObject::getReport()
CourseObjectPoll::getReport in modules/course_poll/src/Plugin/course/CourseObject/CourseObjectPoll.php
Let the course object provide its own reports.
CourseObjectQuiz::getReport in modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuiz.php
Let the course object provide its own reports.
CourseObjectWebform::getReport in modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php
Let the course object provide its own reports.
3 methods override CourseObject::getReport()
CourseObjectPoll::getReport in modules/course_poll/src/Plugin/course/CourseObject/CourseObjectPoll.php
Let the course object provide its own reports.
CourseObjectQuiz::getReport in modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuiz.php
Let the course object provide its own reports.
CourseObjectWebform::getReport in modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebform.php
Let the course object provide its own reports.

File

src/Entity/CourseObject.php, line 849

Class

CourseObject
Parent abstract base class of all course objects.

Namespace

Drupal\course\Entity

Code

function getReport($key) {
  if ($key == 'default') {
    return array(
      'title' => 'Overview',
      'content' => views_embed_view('course_object_report', 'default', $this
        ->getCourse()
        ->id(), $this
        ->id()),
    );
  }
}