Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SimpleQueueItem | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BuyerKiosk\SimpleQueue; |
| 4 | |
| 5 | class SimpleQueueItem { |
| 6 | public $transID; |
| 7 | public $firstName; |
| 8 | public $lastName; |
| 9 | public $status; |
| 10 | public $timeCompleted; |
| 11 | public $timeEntered; |
| 12 | |
| 13 | public function __construct($transID, $firstName, $lastName, $status, $timeEntered = null, $timeCompleted = null ) { |
| 14 | $this->transID = $transID; |
| 15 | $this->firstName = $firstName; |
| 16 | $this->lastName = $lastName; |
| 17 | $this->status = $status; |
| 18 | $this->timeCompleted = $timeCompleted; |
| 19 | $this->timeEntered = $timeEntered; |
| 20 | //Allow for the time to be entered as a string or as a boolean |
| 21 | if($timeEntered == 1) { |
| 22 | $this->timeEntered = new \DateTime('now', new \DateTimeZone('UTC')); |
| 23 | $this->timeEntered = $this->timeEntered->format('Y-m-d H:i:s'); |
| 24 | } |
| 25 | if($timeCompleted == 1) { |
| 26 | $this->timeCompleted = new \DateTime('now', new \DateTimeZone('UTC')); |
| 27 | $this->timeCompleted = $this->timeCompleted->format('Y-m-d H:i:s'); |
| 28 | } |
| 29 | } |
| 30 | } |