FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ClearingLicense.php
1 <?php
2 /*
3 Copyright (C) 2014-2018, Siemens AG
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 version 2 as published by the Free Software Foundation.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
20 
22 
24 {
25 
26  private $licenseRef;
28  private $removed;
30  private $reportInfo;
32  private $acknowledgement;
34  private $comment;
36  private $type;
37 
45  public function __construct(LicenseRef $licenseRef, $removed, $type, $reportInfo = "", $comment = "", $acknowledgement = "")
46  {
47  $this->licenseRef = $licenseRef;
48  $this->removed = $removed;
49  $this->type = $type;
50  $this->reportInfo = $reportInfo;
51  $this->acknowledgement = $acknowledgement;
52  $this->comment = $comment;
53  }
54 
58  public function copyNegated()
59  {
60  return new ClearingLicense($this->licenseRef, ! ($this->removed),
61  $this->type, $this->reportInfo, $this->comment, $this->acknowledgement);
62  }
63 
67  public function getLicenseRef()
68  {
69  return $this->licenseRef;
70  }
71 
75  public function getLicenseId()
76  {
77  return $this->getLicenseRef()->getId();
78  }
79 
83  public function getFullName()
84  {
85  return $this->getLicenseRef()->getFullName();
86  }
87 
91  public function getShortName()
92  {
93  return $this->getLicenseRef()->getShortName();
94  }
95 
99  public function isRemoved()
100  {
101  return $this->removed;
102  }
103 
107  public function getType()
108  {
109  return $this->type;
110  }
111 
115  public function getComment()
116  {
117  return $this->comment;
118  }
119 
123  public function getReportinfo()
124  {
125  return $this->reportInfo;
126  }
127 
131  public function getAcknowledgement()
132  {
133  return $this->acknowledgement;
134  }
135 
136  public function __toString()
137  {
138  $eventTypes = new ClearingEventTypes();
139  return "ClearingLicense("
140  .($this->isRemoved() ? "-" : "")
141  .$this->getLicenseRef()
142  .",type='".($eventTypes->getTypeName($this->type))."'(".$this->type.")"
143  .",comment='".$this->comment."'"
144  .",reportinfo='".$this->reportInfo."'"
145  .",acknowledgement='".$this->acknowledgement."'"
146  .")";
147 
148  }
149 }
__construct(LicenseRef $licenseRef, $removed, $type, $reportInfo="", $comment="", $acknowledgement="")