class TimelineEra in Views TimelineJS integration 7.3
Defines a TimelineJS3 era.
Hierarchy
- class \TimelineEra implements TimelineEraInterface
Expanded class hierarchy of TimelineEra
File
- src/
TimelineEra.php, line 6
View source
class TimelineEra implements TimelineEraInterface {
/**
* The era start date.
*
* @var TimelineDateInterface
*/
protected $start_date;
/**
* The era end date.
*
* @var TimelineDateInterface
*/
protected $end_date;
/**
* The era headline and text.
*
* @var TimelineTextInterface
*/
protected $text;
public function __construct(TimelineDateInterface $start_date, TimelineDateInterface $end_date, TimelineTextInterface $text = NULL) {
$this->start_date = $start_date;
$this->end_date = $end_date;
if (!empty($text)) {
$this->text = $text;
}
}
/**
* {@inheritdoc}
*/
public function buildArray() {
$era = array(
'start_date' => $this->start_date
->buildArray(),
'end_date' => $this->end_date
->buildArray(),
);
if (!empty($this->text)) {
$era['text'] = $this->text
->buildArray();
}
return $era;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TimelineEra:: |
protected | property | The era end date. | |
TimelineEra:: |
protected | property | The era start date. | |
TimelineEra:: |
protected | property | The era headline and text. | |
TimelineEra:: |
public | function |
Creates an array representing the TimelineJS javascript object. Overrides TimelineObjectInterface:: |
|
TimelineEra:: |
public | function |