Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 30 |
|
0.00% |
0 / 12 |
CRAP | |
0.00% |
0 / 1 |
| ReceiptCoupon | |
0.00% |
0 / 30 |
|
0.00% |
0 / 12 |
210 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
12 | |||
| getArray | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| getEnabled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEnabled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLine1 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setLine1 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLine2 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setLine2 | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTagLine | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setTagLine | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getExpireDate | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setExpireDate | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BuyerKiosk\Core; |
| 4 | |
| 5 | class ReceiptCoupon extends Store |
| 6 | { |
| 7 | |
| 8 | private $enabled; |
| 9 | |
| 10 | public $line1; |
| 11 | public $line2; |
| 12 | public $tagLine; |
| 13 | public $expireDate; |
| 14 | |
| 15 | public function __construct($typeNum) |
| 16 | { |
| 17 | parent::__construct(); |
| 18 | if($this->createStore($typeNum)) { |
| 19 | $this->line1 = $this->getRcLine1(); |
| 20 | $this->line2 = $this->getRcLine2(); |
| 21 | $this->tagLine = $this->getRcTagLine(); |
| 22 | $this->enabled = $this->getRcEnable(); |
| 23 | if((int)$this->enabled == 1) { |
| 24 | $now = new \DateTime('now', new \DateTimeZone($this->getTimeZone())); |
| 25 | $now->add(new \DateInterval('P'.$this->getRcValidDays().'D')); |
| 26 | $this->expireDate = $now->format("m-d-Y"); |
| 27 | return true; |
| 28 | } |
| 29 | } |
| 30 | return false; |
| 31 | } |
| 32 | public function getArray() { |
| 33 | return array( |
| 34 | "line1" => $this->line1, |
| 35 | "line2" => $this->line2, |
| 36 | "tagLine" => $this->tagLine, |
| 37 | "expireDate" => $this->expireDate, |
| 38 | "enabled" => (bool)$this->enabled, |
| 39 | "expireDays" => $this->getRcValidDays(), |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | |
| 44 | public function getEnabled() |
| 45 | { |
| 46 | return $this->enabled; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * @param mixed $enabled |
| 51 | */ |
| 52 | public function setEnabled($enabled) |
| 53 | { |
| 54 | $this->enabled = $enabled; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * @return mixed |
| 59 | */ |
| 60 | public function getLine1() |
| 61 | { |
| 62 | return $this->line1; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * @param mixed $line1 |
| 67 | */ |
| 68 | public function setLine1($line1) |
| 69 | { |
| 70 | $this->line1 = $line1; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @return mixed |
| 75 | */ |
| 76 | public function getLine2() |
| 77 | { |
| 78 | return $this->line2; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * @param mixed $line2 |
| 83 | */ |
| 84 | public function setLine2($line2) |
| 85 | { |
| 86 | $this->line2 = $line2; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * @return mixed |
| 91 | */ |
| 92 | public function getTagLine() |
| 93 | { |
| 94 | return $this->tagLine; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * @param mixed $tagLine |
| 99 | */ |
| 100 | public function setTagLine($tagLine) |
| 101 | { |
| 102 | $this->tagLine = $tagLine; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * @return mixed |
| 107 | */ |
| 108 | public function getExpireDate() |
| 109 | { |
| 110 | return $this->expireDate; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * @param mixed $expireDate |
| 115 | */ |
| 116 | public function setExpireDate($expireDate) |
| 117 | { |
| 118 | $this->expireDate = $expireDate; |
| 119 | } |
| 120 | } |