You are here

public function IntervalItem::getIntervalPlugin in Interval Field 8

Gets the interval plugin for this item.

Return value

\Drupal\interval\IntervalInterface The interval plugin.

Overrides IntervalItemInterface::getIntervalPlugin

2 calls to IntervalItem::getIntervalPlugin()
IntervalItem::applyInterval in src/Plugin/Field/FieldType/IntervalItem.php
Applies an interval to a date object.
IntervalItem::buildPHPString in src/Plugin/Field/FieldType/IntervalItem.php
Builds a php date interval string from the plugin properties.

File

src/Plugin/Field/FieldType/IntervalItem.php, line 98

Class

IntervalItem
Provides a data type plugin for an interval item.

Namespace

Drupal\interval\Plugin\Field\FieldType

Code

public function getIntervalPlugin() {
  if (!$this->intervalPlugin) {
    $this->intervalPlugin = \Drupal::service('plugin.manager.interval.intervals')
      ->getDefinition($this
      ->getPeriod());
  }
  return $this->intervalPlugin;
}