You are here

public function FeedsDateTime::addGranularity in Feeds 6

Same name and namespace in other branches
  1. 7.2 plugins/FeedsParser.inc \FeedsDateTime::addGranularity()
  2. 7 plugins/FeedsParser.inc \FeedsDateTime::addGranularity()

Safely adds a granularity entry to the array.

1 call to FeedsDateTime::addGranularity()
FeedsDateTime::setGranularityFromTime in plugins/FeedsParser.inc
Protected function to find the granularity given by the arguments to the constructor.

File

plugins/FeedsParser.inc, line 588

Class

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

Code

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