FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ClearingLicense.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2014-2018 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 namespace Fossology\Lib\Data\Clearing;
9 
11 
13 {
14 
15  private $licenseRef;
17  private $removed;
19  private $reportInfo;
21  private $acknowledgement;
23  private $comment;
25  private $type;
26 
35  public function __construct(LicenseRef $licenseRef, $removed, $type, $reportInfo = "", $comment = "", $acknowledgement = "")
36  {
37  $this->licenseRef = $licenseRef;
38  $this->removed = $removed;
39  $this->type = $type;
40  $this->reportInfo = $reportInfo;
41  $this->acknowledgement = $acknowledgement;
42  $this->comment = $comment;
43  }
44 
48  public function copyNegated()
49  {
50  return new ClearingLicense($this->licenseRef, ! ($this->removed),
51  $this->type, $this->reportInfo, $this->comment, $this->acknowledgement);
52  }
53 
57  public function getLicenseRef()
58  {
59  return $this->licenseRef;
60  }
61 
65  public function getLicenseId()
66  {
67  return $this->getLicenseRef()->getId();
68  }
69 
73  public function getFullName()
74  {
75  return $this->getLicenseRef()->getFullName();
76  }
77 
81  public function getShortName()
82  {
83  return $this->getLicenseRef()->getShortName();
84  }
85 
89  public function getSpdxId()
90  {
91  return $this->getLicenseRef()->getSpdxId();
92  }
93 
97  public function isRemoved()
98  {
99  return $this->removed;
100  }
101 
105  public function getType()
106  {
107  return $this->type;
108  }
109 
113  public function getComment()
114  {
115  return $this->comment;
116  }
117 
121  public function getReportinfo()
122  {
123  return $this->reportInfo;
124  }
125 
129  public function getAcknowledgement()
130  {
131  return $this->acknowledgement;
132  }
133 
134  public function __toString()
135  {
136  $eventTypes = new ClearingEventTypes();
137  return "ClearingLicense("
138  .($this->isRemoved() ? "-" : "")
139  .$this->getLicenseRef()
140  .",type='".($eventTypes->getTypeName($this->type))."'(".$this->type.")"
141  .",comment='".$this->comment."'"
142  .",reportinfo='".$this->reportInfo."'"
143  .",acknowledgement='".$this->acknowledgement."'"
144  .")";
145 
146  }
147 }
__construct(LicenseRef $licenseRef, $removed, $type, $reportInfo="", $comment="", $acknowledgement="")