FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
Job.php
Go to the documentation of this file.
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  ***************************************************************/
23 namespace Fossology\UI\Api\Models;
24 
30 class Job
31 {
36  private $id;
41  private $name;
46  private $queueDate;
51  private $uploadId;
56  private $userId;
61  private $groupId;
66  private $eta;
67 
76  private $status;
77 
90  public function __construct($id, $name = "", $queueDate = "", $uploadId = 0,
91  $userId = 0, $groupId = 0, $eta = 0, $status = "")
92  {
93  $this->id = intval($id);
94  $this->name = $name;
95  $this->queueDate = $queueDate;
96  $this->uploadId = intval($uploadId);
97  $this->userId = intval($userId);
98  $this->groupId = intval($groupId);
99  $this->eta = intval($eta);
100  $this->status = $status;
101  }
102 
107  public function getJSON()
108  {
109  return json_encode($this->getArray());
110  }
111 
116  public function getArray()
117  {
118  return [
119  'id' => $this->id,
120  'name' => $this->name,
121  'queueDate' => $this->queueDate,
122  'uploadId' => $this->uploadId,
123  'userId' => $this->userId,
124  'groupId' => $this->groupId,
125  'eta' => $this->eta,
126  'status' => $this->status
127  ];
128  }
129 
134  public function getId()
135  {
136  return $this->id;
137  }
138 
143  public function getName()
144  {
145  return $this->name;
146  }
147 
152  public function getQueueDate()
153  {
154  return $this->queueDate;
155  }
156 
161  public function getUploadId()
162  {
163  return $this->uploadId;
164  }
165 
170  public function getUserId()
171  {
172  return $this->userId;
173  }
174 
179  public function getGroupId()
180  {
181  return $this->groupId;
182  }
183 
188  public function getEta()
189  {
190  return $this->eta;
191  }
192 
197  public function getStatus()
198  {
199  return $this->status;
200  }
201 
206  public function setName($name)
207  {
208  $this->name = $name;
209  }
210 
215  public function setQueueDate($queueDate)
216  {
217  $this->queueDate = $queueDate;
218  }
219 
224  public function setUploadId($uploadId)
225  {
226  $this->uploadId = $uploadId;
227  }
228 
233  public function setUserId($userId)
234  {
235  $this->userId = $userId;
236  }
237 
242  public function setGroupId($groupId)
243  {
244  $this->groupId = $groupId;
245  }
246 
251  public function setEta($eta)
252  {
253  $this->eta = $eta;
254  }
255 
260  public function setStatus($status)
261  {
262  $this->status = $status;
263  }
264 }
setUploadId($uploadId)
Definition: Job.php:224
setQueueDate($queueDate)
Definition: Job.php:215
__construct($id, $name="", $queueDate="", $uploadId=0, $userId=0, $groupId=0, $eta=0, $status="")
Definition: Job.php:90