class Text in Views TimelineJS integration 8.3
Defines a TimelineJS3 text object.
Hierarchy
- class \Drupal\views_timelinejs\TimelineJS\Text implements TextInterface
 
Expanded class hierarchy of Text
1 file declares its use of Text
- TimelineJS.php in src/
Plugin/ views/ style/ TimelineJS.php  
File
- src/
TimelineJS/ Text.php, line 8  
Namespace
Drupal\views_timelinejs\TimelineJSView source
class Text implements TextInterface {
  /**
   * The text object headline.
   *
   * @var string
   */
  protected $headline;
  /**
   * The text object text.
   *
   * Yes, this property's name is terribly ambiguous.
   *
   * @var string
   */
  protected $text;
  /**
   * Constructs a new Text object.
   *
   * @param string $headline
   *   The title of the text resource.
   * @param string $text
   *   The body of the text resource.
   */
  public function __construct($headline = '', $text = '') {
    $this->headline = $headline;
    $this->text = $text;
  }
  /**
   * {@inheritdoc}
   */
  public function buildArray() {
    $text = [];
    if (!empty($this->headline)) {
      $text['headline'] = $this->headline;
    }
    if (!empty($this->text)) {
      $text['text'] = $this->text;
    }
    return $text;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            Text:: | 
                  protected | property | The text object headline. | |
| 
            Text:: | 
                  protected | property | The text object text. | |
| 
            Text:: | 
                  public | function | 
            Creates an array representing the TimelineJS javascript object. Overrides ObjectInterface:: | 
                  |
| 
            Text:: | 
                  public | function | Constructs a new Text object. |