+ // This hook is the api contributions equivalent to the
+ // ContributionsLineEnding hook. Hook implementers may cancel
+ // the hook to signal the user is not allowed to read this item.
+ $feedItem = null;
+ $hookResult = Hooks::run(
+ 'ApiFeedContributions::feedItem',
+ array( $row, $this->getContext(), &$feedItem )
+ );
+ // Hook returned a valid feed item
+ if ( $feedItem instanceof FeedItem ) {
+ return $feedItem;
+ // Hook was canceled and did not return a valid feed item
+ } elseif ( !$hookResult ) {
+ return null;
+ }
+
+ // Hook completed and did not return a valid feed item