1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8class Search_Action_ReportingTransform
9{
10	private $data = [];
11
12	function setStatus($objectType, $objectId, $success)
13	{
14		$this->data["$objectType:$objectId"] = $success ? 'success' : 'error';
15	}
16
17	function __invoke($entry)
18	{
19		$identifier = "{$entry['object_type']}:{$entry['object_id']}";
20		$entry['report_status'] = isset($this->data[$identifier]) ? $this->data[$identifier] : 'none';
21		return $entry;
22	}
23}
24