FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ItemTreeBounds.php
1 <?php
2 /*
3 Copyright (C) 2014, Siemens AG
4 Author: Andreas Würl
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 version 2 as published by the Free Software Foundation.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 namespace Fossology\Lib\Data\Tree;
21 
23 {
27  private $uploadTreeTableName;
31  private $uploadId;
35  private $left;
39  private $right;
40 
44  private $itemId;
45 
53  public function __construct($itemId, $uploadTreeTableName, $uploadId, $left, $right)
54  {
55  $this->uploadTreeTableName = $uploadTreeTableName;
56  $this->uploadId = (int) $uploadId;
57  $this->left = (int) $left;
58  $this->right = (int) $right;
59  $this->itemId = (int) $itemId;
60  }
61 
65  public function getItemId()
66  {
67  return $this->itemId;
68  }
69 
73  public function getUploadTreeTableName()
74  {
75  return $this->uploadTreeTableName;
76  }
77 
81  public function getUploadId()
82  {
83  return $this->uploadId;
84  }
85 
89  public function getLeft()
90  {
91  return $this->left;
92  }
93 
97  public function getRight()
98  {
99  return $this->right;
100  }
101 
102  public function containsFiles()
103  {
104  return $this->right - $this->left > 1;
105  }
106 
107  function __toString()
108  {
109  return "ItemTreeBounds([" . $this->left . ", " . $this->right . "] " .
110  "upload " . $this->uploadId . "@" . $this->uploadTreeTableName . ")";
111  }
112 }
__construct($itemId, $uploadTreeTableName, $uploadId, $left, $right)