8 namespace Fossology\Lib\Report;
17 public function __construct()
20 $this->clearingDao = $container->get(
'dao.clearing');
21 parent::__construct($groupBy =
"bulkId");
24 protected function getStatements($uploadId, $uploadTreeTableName, $groupId=0)
28 $parentTreeBounds = $this->uploadDao->getParentItemBounds($uploadId, $uploadTreeTableName);
29 $bulkHistory = $this->clearingDao->getBulkHistory($parentTreeBounds, $groupId,
false);
31 foreach ($bulkHistory as $bulk) {
33 $bulkId = $bulk[
'bulkId'];
34 foreach ($bulk[
'removedLicenses'] as $removedLics) {
35 $allLicenses .= ($removedLics ?
"[remove] " :
"") . $removedLics.
', ';
37 foreach ($bulk[
'addedLicenses'] as $addedLics) {
38 $allLicenses .= ($addedLics ?
"[add] " :
"") . $addedLics.
', ';
40 $allLicenses =
trim($allLicenses,
', ');
41 $content = $bulk[
'text'];
43 foreach ($this->clearingDao->getBulkMatches($bulkId, $groupId) as $bulkMatch) {
44 $uploadTreeId = $bulkMatch[
'itemid'];
48 'content' => $content,
49 'textfinding' => $allLicenses,
50 'description' => $content,
51 'uploadtree_pk' => $uploadTreeId
getStatements($uploadId, $uploadTreeTableName, $groupId=0)
char * trim(char *ptext)
Trimming whitespace.