You are here

public function FeedsDateTimeElement::merge in Feeds 6

Same name and namespace in other branches
  1. 7.2 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 node's date CCK field from our object.

File

plugins/FeedsParser.inc, line 349

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;
}