protected static function FeedsDateTimeElement::readDateField in Feeds 7
Same name and namespace in other branches
- 6 plugins/FeedsParser.inc \FeedsDateTimeElement::readDateField()
- 7.2 plugins/FeedsParser.inc \FeedsDateTimeElement::readDateField()
Helper method for buildDateField(). Build a FeedsDateTimeElement object from a standard formatted node.
1 call to FeedsDateTimeElement::readDateField()
- FeedsDateTimeElement::buildDateField in plugins/
FeedsParser.inc - Build a node's date CCK field from our object.
File
- plugins/
FeedsParser.inc, line 355
Class
- FeedsDateTimeElement
- Defines a date element of a parsed result (including ranges, repeat).
Code
protected static function readDateField($node, $field_name) {
$field = content_fields($field_name);
$ret = new FeedsDateTimeElement();
if (isset($node->{$field_name}[0]['date']) && $node->{$field_name}[0]['date'] instanceof FeedsDateTime) {
$ret->start = $node->{$field_name}[0]['date'];
}
if (isset($node->{$field_name}[0]['date2']) && $node->{$field_name}[0]['date2'] instanceof FeedsDateTime) {
$ret->end = $node->{$field_name}[0]['date2'];
}
return $ret;
}