Expose access to protected members of FeedItem_Common

I want to make a plugin hook to the HOOK_FEED_PARSED. And it need to access the members doc and elem of FeedItem_Common to modify them. The only way to achive this it exposing the protected members.

e: should be fixed by 40f4a7a. i’ve added a getter method for DOMElement, and you can get owner document using that.

tbh this hook just feels wrong, even more so with full DOM access for plugins. however, this exact same thing can be achieved (with a bit more bullshit) by using feed fetched so i guess no harm done allowing this.

I have considered using feed fetched. But in the hook of FEED_FETCHED, I have to parsed the raw string data to structured object myself. It is duplicated with what’s being done by FeedParser. So the feed_parsed it the best place to get / modify the structured rss object.

By the way, in order to create element, is it needed to expose doc member or I can use elem to create sub element?

my plugin currently use this to append child:

$summary_node = $item->getDoc()->createElement("summary", str_replace("&", "&", $summary_value));
$item->getElem->appendChild($summary_node);

you should be able to use ownerDocument property of exposed DOMElement (which extends DOMNode), see php docs for details