| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | stubClassLoader::load('net::stubbles::reflection::annotations::stubAnnotation', |
|---|
| 10 | 'net::stubbles::ipo::request::broker::annotations::stubAbstractFilterAnnotation', |
|---|
| 11 | 'net::stubbles::ipo::request::filter::stubIntegerFilter', |
|---|
| 12 | 'net::stubbles::ipo::request::filter::stubRangeFilterDecorator', |
|---|
| 13 | 'net::stubbles::ipo::request::validator::stubMaxNumberValidator', |
|---|
| 14 | 'net::stubbles::ipo::request::validator::stubMinNumberValidator' |
|---|
| 15 | ); |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | class stubIntegerFilterAnnotation extends stubAbstractFilterAnnotation implements stubAnnotation |
|---|
| 23 | { |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | protected $minValue; |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | protected $minErrorId; |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | protected $maxValue; |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | protected $maxErrorId; |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | public function setMinValue($minValue) |
|---|
| 55 | { |
|---|
| 56 | $this->minValue = $minValue; |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | public function setMinErrorId($minErrorId) |
|---|
| 65 | { |
|---|
| 66 | $this->minErrorId = $minErrorId; |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | public function setMaxValue($maxValue) |
|---|
| 75 | { |
|---|
| 76 | $this->maxValue = $maxValue; |
|---|
| 77 | } |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | public function setMaxErrorId($maxErrorId) |
|---|
| 85 | { |
|---|
| 86 | $this->maxErrorId = $maxErrorId; |
|---|
| 87 | } |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | protected function doGetFilter() |
|---|
| 95 | { |
|---|
| 96 | $filter = new stubIntegerFilter(); |
|---|
| 97 | if (null !== $this->minValue || null !== $this->maxValue) { |
|---|
| 98 | $filter = new stubRangeFilterDecorator($filter, $this->createRVEFactory()); |
|---|
| 99 | if (null !== $this->minValue) { |
|---|
| 100 | $filter->setMinValidator(new stubMinNumberValidator($this->minValue), $this->minErrorId); |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | if (null !== $this->maxValue) { |
|---|
| 104 | $filter->setMaxValidator(new stubMaxNumberValidator($this->maxValue), $this->maxErrorId); |
|---|
| 105 | } |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | return $filter; |
|---|
| 109 | } |
|---|
| 110 | } |
|---|
| 111 | ?> |
|---|