You are here

function CourseObjectNode::getTitle in Course 3.x

Same name and namespace in other branches
  1. 8.3 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::getTitle()
  2. 8.2 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::getTitle()

Get the object title, or return this object's node's title if the option is set.

Overrides CourseObject::getTitle

3 calls to CourseObjectNode::getTitle()
CourseObjectBook::getCloneAbility in modules/course_book/src/Plugin/course/CourseObject/CourseObjectBook.php
Returns an translated error message if this object has issues with cloning.
CourseObjectNode::createInstance in modules/course_content/src/Course/Object/CourseObjectNode.php
Create a node and set it as this course object's node.
CourseObjectNode::getCloneAbility in modules/course_content/src/Course/Object/CourseObjectNode.php
Returns an translated error message if this object has issues with cloning.

File

modules/course_content/src/Course/Object/CourseObjectNode.php, line 382

Class

CourseObjectNode
A course object that uses a node as a base.

Namespace

Drupal\course_content\Course\Object

Code

function getTitle() {
  if ($this
    ->getOption('use_node_title') && $this
    ->getNode()) {
    return $this
      ->getNode()->title;
  }
  else {
    return parent::getTitle();
  }
}