You are here

protected function FeedsXPathParserBase::getUniques in Feeds XPath Parser 7

Gets the unique mappings targets that are used by this parser.

Return value

array An array of mappings keyed source => target.

1 call to FeedsXPathParserBase::getUniques()
FeedsXPathParserBase::sourceForm in ./FeedsXPathParserBase.inc
Overrides parent::sourceForm().

File

./FeedsXPathParserBase.inc, line 495
Provides the base class for FeedsXPathParserHTML and FeedsXPathParserXML.

Class

FeedsXPathParserBase
Base class for the HTML and XML parsers.

Code

protected function getUniques() {
  $uniques = array();
  $importer = feeds_importer($this->id);
  $targets = $importer->processor
    ->getMappingTargets();
  foreach ($importer->processor
    ->getMappings() as $mapping) {
    if (!empty($mapping['unique'])) {
      $uniques[$mapping['source']] = $targets[$mapping['target']]['name'];
    }
  }
  return $uniques;
}