You are here

public function CourseObjectWebform::getWarnings in Course 7

Same name and namespace in other branches
  1. 6 modules/course_webform/course_webform.classes.inc \CourseObjectWebform::getWarnings()
  2. 7.2 modules/course_webform/course_webform.classes.inc \CourseObjectWebform::getWarnings()

Show a warning if this object has an instance, but the node does not exist.

Overrides CourseObjectNode::getWarnings

File

modules/course_webform/course_webform.classes.inc, line 8

Class

CourseObjectWebform
Parent class for webform course tracking.

Code

public function getWarnings() {
  $warnings = parent::getWarnings();
  if ($this
    ->getInstanceId()) {
    if (!$this->node->webform['components']) {
      $warnings[] = t('The Webform has no questions. Please !link.', array(
        '!link' => l('add questions', "node/{$this->getInstanceId()}/webform"),
      ));
    }
  }
  return $warnings;
}