TimelineTitleSlide.php in Views TimelineJS integration 7.3
File
src/TimelineTitleSlide.php
View source
<?php
class TimelineTitleSlide extends TimelineSlide {
public function __construct(TimelineTextInterface $text = NULL) {
if (!empty($text)) {
$this->text = $text;
}
}
public function buildArray() {
$slide = array();
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->unique_id)) {
$slide['unique_id'] = $this->unique_id;
}
return array_filter($slide);
}
}