You are here

class TimelineText in Views TimelineJS integration 7.3

Defines a TimelineJS3 text object.

Hierarchy

Expanded class hierarchy of TimelineText

File

src/TimelineText.php, line 6

View source
class TimelineText implements TimelineTextInterface {

  /**
   * The text object headline.
   *
   * @var string
   */
  protected $headline;

  /**
   * The text object text.
   *
   * Yes, this property's name is terribly ambiguous.
   *
   * @var string
   */
  protected $text;
  public function __construct($headline = '', $text = '') {
    $this->headline = $headline;
    $this->text = $text;
  }
  public function buildArray() {
    $text = array();
    if (!empty($this->headline)) {
      $text['headline'] = $this->headline;
    }
    if (!empty($this->text)) {
      $text['text'] = $this->text;
    }
    return $text;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TimelineText::$headline protected property The text object headline.
TimelineText::$text protected property The text object text.
TimelineText::buildArray public function Creates an array representing the TimelineJS javascript object. Overrides TimelineObjectInterface::buildArray
TimelineText::__construct public function