You are here

public function Background::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/Background.php, line 42

Class

Background
Defines a TimelineJS3 background object.

Namespace

Drupal\views_timelinejs\TimelineJS

Code

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