TitleSlide.php in Views TimelineJS integration 8.3
File
src/TimelineJS/TitleSlide.php
View source
<?php
namespace Drupal\views_timelinejs\TimelineJS;
class TitleSlide extends Slide {
public function __construct(TextInterface $text = NULL) {
if (!empty($text)) {
$this->text = $text;
}
}
public function buildArray() {
$slide = [];
if (!empty($this->text)) {
$slide['text'] = $this->text
->buildArray();
}
if (!empty($this->media)) {
$slide['media'] = $this->media
->buildArray();
}
if (!empty($this->background)) {
$slide['background'] = $this->background
->buildArray();
}
if (!$this->autolink) {
$slide['autolink'] = FALSE;
}
if (!empty($this->uniqueId)) {
$slide['unique_id'] = $this->uniqueId;
}
return array_filter($slide);
}
}