You are here

public function FeedsDateTime::addGranularity in Feeds 8.2

Safely adds a granularity entry to the array.

1 call to FeedsDateTime::addGranularity()
FeedsDateTime::setGranularityFromTime in lib/Drupal/feeds/FeedsDateTime.php
Protected function to find the granularity given by the arguments to the constructor.

File

lib/Drupal/feeds/FeedsDateTime.php, line 142

Class

FeedsDateTime
Extend PHP DateTime class with granularity handling, merge functionality and slightly more flexible initialization parameters.

Namespace

Drupal\feeds

Code

public function addGranularity($g) {
  $this->granularity[] = $g;
  $this->granularity = array_unique($this->granularity);
}