/** * Find the item language. * * @param SimpleXMLElement $entry Feed item * @param \PicoFeed\Parser\Item $item Item object * @param \PicoFeed\Parser\Feed $feed Feed object */ public function findItemLanguage(SimpleXMLElement $entry, Item $item, Feed $feed) { $language = XmlParser::getXPathResult($entry, 'dc:language', $this->namespaces); $item->setLanguage(XmlParser::getValue($language) ?: $feed->getLanguage()); }
/** * Find the item language. * * @param SimpleXMLElement $entry Feed item * @param \PicoFeed\Parser\Item $item Item object * @param \PicoFeed\Parser\Feed $feed Feed object */ public function findItemLanguage(SimpleXMLElement $entry, Item $item, Feed $feed) { $language = XmlParser::getXPathResult($entry, './/@xml:lang'); $item->setLanguage(XmlParser::getValue($language) ?: $feed->getLanguage()); }