FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ItemTreeBounds.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2014 Siemens AG
4  Author: Andreas Würl
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 namespace Fossology\Lib\Data\Tree;
9 
11 {
15  private $uploadTreeTableName;
19  private $uploadId;
23  private $left;
27  private $right;
28 
32  private $itemId;
33 
41  public function __construct($itemId, $uploadTreeTableName, $uploadId, $left, $right)
42  {
43  $this->uploadTreeTableName = $uploadTreeTableName;
44  $this->uploadId = (int) $uploadId;
45  $this->left = (int) $left;
46  $this->right = (int) $right;
47  $this->itemId = (int) $itemId;
48  }
49 
53  public function getItemId()
54  {
55  return $this->itemId;
56  }
57 
61  public function getUploadTreeTableName()
62  {
63  return $this->uploadTreeTableName;
64  }
65 
69  public function getUploadId()
70  {
71  return $this->uploadId;
72  }
73 
77  public function getLeft()
78  {
79  return $this->left;
80  }
81 
85  public function getRight()
86  {
87  return $this->right;
88  }
89 
90  public function containsFiles()
91  {
92  return $this->right - $this->left > 1;
93  }
94 
95  function __toString()
96  {
97  return "ItemTreeBounds([" . $this->left . ", " . $this->right . "] " .
98  "upload " . $this->uploadId . "@" . $this->uploadTreeTableName . ")";
99  }
100 }
__construct($itemId, $uploadTreeTableName, $uploadId, $left, $right)