FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ReportImportDataItem.php
1 <?php
2 /*
3  * Copyright (C) 2017, 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 namespace Fossology\ReportImport;
19 
21 
23 {
25  protected $licenseId;
27  protected $customText = NULL;
29  protected $comment = "";
31  private $licenseCandidate = NULL;
32 
33  function __construct($licenseId)
34  {
35  $this->licenseId = $licenseId;
36  }
37 
38  public function setCustomText($customText)
39  {
40  $this->customText = $customText;
41  return $this;
42  }
43 
50  public function setLicenseCandidate($name, $text, $spdxCompatible)
51  {
52  $spdxCompatible = $spdxCompatible == true;
53  $this->licenseCandidate = new License(
54  $this->licenseId,
55  $this->licenseId,
56  $name,
57  "",
58  $text,
59  "", // TODO: $this->getValue($license,'seeAlso'),
60  "", // TODO
61  $spdxCompatible);
62  return $this;
63  }
64 
68  public function getLicenseId()
69  {
70  return $this->licenseId;
71  }
72 
76  public function isSetCustomText()
77  {
78  return $this->customText !== NULL;
79  }
80 
84  public function getCustomText()
85  {
86  return $this->customText;
87  }
88 
92  public function getComment()
93  {
94  return $this->comment;
95  }
96 
100  public function isSetLicenseCandidate()
101  {
102  return $this->licenseCandidate !== NULL;
103  }
104 
108  public function getLicenseCandidate()
109  {
110  return $this->licenseCandidate;
111  }
112 }
setLicenseCandidate($name, $text, $spdxCompatible)