You are here

public function Text::buildArray in Views TimelineJS integration 8.3

Creates an array representing the TimelineJS javascript object.

Return value

mixed[] The formatted array.

Overrides ObjectInterface::buildArray

File

src/TimelineJS/Text.php, line 42

Class

Text
Defines a TimelineJS3 text object.

Namespace

Drupal\views_timelinejs\TimelineJS

Code

public function buildArray() {
  $text = [];
  if (!empty($this->headline)) {
    $text['headline'] = $this->headline;
  }
  if (!empty($this->text)) {
    $text['text'] = $this->text;
  }
  return $text;
}