FOSSology  4.5.1
Open Source License Compliance by Open Source Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ReportImportDataItem.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2017 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 namespace Fossology\ReportImport;
8 
10 
12 {
14  protected $licenseId;
16  protected $customText = NULL;
18  protected $comment = "";
20  private $licenseCandidate = NULL;
21 
22  function __construct($licenseId)
23  {
24  $this->licenseId = $licenseId;
25  }
26 
27  public function setCustomText($customText)
28  {
29  $this->customText = trim($customText);
30  return $this;
31  }
32 
40  public function setLicenseCandidate($name, $text, $spdxCompatible, $url = "")
41  {
42  $spdxCompatible = $spdxCompatible == true;
43  $this->licenseCandidate = new License(
44  $this->licenseId,
45  $this->licenseId,
46  $name,
47  "",
48  trim($text),
49  $url,
50  "", // TODO
51  $spdxCompatible);
52  return $this;
53  }
54 
58  public function getLicenseId()
59  {
60  return $this->licenseId;
61  }
62 
66  public function isSetCustomText()
67  {
68  return $this->customText !== NULL;
69  }
70 
74  public function getCustomText()
75  {
76  return $this->customText;
77  }
78 
82  public function getComment()
83  {
84  return $this->comment;
85  }
86 
90  public function isSetLicenseCandidate()
91  {
92  return $this->licenseCandidate !== NULL;
93  }
94 
98  public function getLicenseCandidate()
99  {
100  return $this->licenseCandidate;
101  }
102 }
setLicenseCandidate($name, $text, $spdxCompatible, $url="")
char * trim(char *ptext)
Trimming whitespace.
Definition: fossconfig.c:690