1 <?php
2 3 4
5 namespace Team3\PayU\Order\Model;
6
7 class OrderStatus implements OrderStatusInterface
8 {
9 10 11
12 protected $value;
13
14 15 16
17 public function __construct($value = null)
18 {
19 $this->value = $value;
20 }
21
22 23 24
25 public function getValue()
26 {
27 return $this->value;
28 }
29
30 31 32
33 public function isEmpty()
34 {
35 return null === $this->value;
36 }
37
38 39 40
41 public function isNew()
42 {
43 return self::NEW_ORDER === $this->value;
44 }
45
46 47 48
49 public function isPending()
50 {
51 return self::PENDING === $this->value;
52 }
53
54 55 56
57 public function isWaitingForConfirmation()
58 {
59 return self::WAITING_FOR_CONFIRMATION === $this->value;
60 }
61
62 63 64
65 public function isCompleted()
66 {
67 return self::COMPLETED === $this->value;
68 }
69
70 71 72
73 public function isCanceled()
74 {
75 return self::CANCELED === $this->value;
76 }
77
78 79 80
81 public function isRejected()
82 {
83 return self::REJECTED === $this->value;
84 }
85 }
86