public function FeedsParser::getSourceElement in Feeds 7
Same name and namespace in other branches
- 6 plugins/FeedsParser.inc \FeedsParser::getSourceElement()
- 7.2 plugins/FeedsParser.inc \FeedsParser::getSourceElement()
Get an element identified by $element_key of the given item. The element key corresponds to the values in the array returned by FeedsParser::getMappingSources().
This method is invoked from FeedsProcessor::map() when a concrete item is processed.
Parameters
$batch: FeedsImportBatch object containing the sources to be mapped from.
$element_key: The key identifying the element that should be retrieved from $source
Return value
The source element from $item identified by $element_key.
See also
FeedsCSVParser::getSourceElement().
Related topics
1 call to FeedsParser::getSourceElement()
- FeedsCSVParser::getSourceElement in plugins/
FeedsCSVParser.inc - Override parent::getSourceElement() to use only lower keys.
1 method overrides FeedsParser::getSourceElement()
- FeedsCSVParser::getSourceElement in plugins/
FeedsCSVParser.inc - Override parent::getSourceElement() to use only lower keys.
File
- plugins/
FeedsParser.inc, line 83
Class
- FeedsParser
- Abstract class, defines interface for parsers.
Code
public function getSourceElement(FeedsImportBatch $batch, $element_key) {
if (($node = $batch
->feedNode()) && $element_key == 'parent:uid') {
return $node->uid;
}
$item = $batch
->currentItem();
return isset($item[$element_key]) ? $item[$element_key] : '';
}