You are here

public function FeedsDateTimeElement::merge in Feeds 7.2

Same name and namespace in other branches
  1. 6 plugins/FeedsParser.inc \FeedsDateTimeElement::merge()
  2. 7 plugins/FeedsParser.inc \FeedsDateTimeElement::merge()

Merge this field with another. Most stuff goes down when merging the two sub-dates.

See also

FeedsDateTime

1 call to FeedsDateTimeElement::merge()
FeedsDateTimeElement::buildDateField in plugins/FeedsParser.inc
Build a entity's date field from our object.

File

plugins/FeedsParser.inc, line 580
Contains FeedsParser and related classes.

Class

FeedsDateTimeElement
Defines a date element of a parsed result (including ranges, repeat).

Code

public function merge(FeedsDateTimeElement $other) {
  $this2 = clone $this;
  if ($this->start && $other->start) {
    $this2->start = $this->start
      ->merge($other->start);
  }
  elseif ($other->start) {
    $this2->start = clone $other->start;
  }
  elseif ($this->start) {
    $this2->start = clone $this->start;
  }
  if ($this->end && $other->end) {
    $this2->end = $this->end
      ->merge($other->end);
  }
  elseif ($other->end) {
    $this2->end = clone $other->end;
  }
  elseif ($this->end) {
    $this2->end = clone $this->end;
  }
  return $this2;
}