1 | <?php namespace SimpleUPS\RegionValidate; |
||
15 | class RegionSuggestion |
||
16 | { |
||
17 | private |
||
18 | $rank, |
||
19 | $quality, |
||
20 | $address, |
||
21 | $postalCodeLowEnd, |
||
22 | $postalCodeHighEnd; |
||
23 | |||
24 | /** |
||
25 | * @internal |
||
26 | * |
||
27 | * @param integer $rank |
||
28 | * |
||
29 | * @return RegionSuggestion |
||
30 | */ |
||
31 | |||
32 | public function setRank($rank) |
||
37 | |||
38 | /** |
||
39 | * The rank of each region suggestion |
||
40 | * @since 1.0 |
||
41 | * @return integer |
||
42 | */ |
||
43 | public function getRank() |
||
47 | |||
48 | /** |
||
49 | * @internal |
||
50 | * |
||
51 | * @param float $quality |
||
52 | * |
||
53 | * @return RegionSuggestion |
||
54 | */ |
||
55 | public function setQuality($quality) |
||
60 | |||
61 | /** |
||
62 | * The quality factor, which describes the accuracy of the result compared to the request. |
||
63 | * <ul> |
||
64 | * <li>1.0 = Exact match. Usually this means UPS provided a correction</li> |
||
65 | * <li>95-.99 = Very close match.</li> |
||
66 | * <li>90-.94 = Close match.</li> |
||
67 | * <li>70-.89 = Possible match.</li> |
||
68 | * <li>00-.69 = Poor match</li> |
||
69 | * </ul> |
||
70 | * @see isCorrected() |
||
71 | * @since 1.0 |
||
72 | * @return float |
||
73 | */ |
||
74 | public function getQuality() |
||
78 | |||
79 | /** |
||
80 | * Determine if this region is a correction of the original region requested for validation |
||
81 | * @see getQuality() |
||
82 | * @since 1.0 |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function isCorrected() |
||
89 | |||
90 | /** |
||
91 | * @internal |
||
92 | * |
||
93 | * @param \SimpleUPS\Address $address |
||
94 | * |
||
95 | * @return RegionSuggestion |
||
96 | */ |
||
97 | public function setAddress(Address $address) |
||
102 | |||
103 | /** |
||
104 | * Provides the city, state/province, and country code |
||
105 | * @since 1.0 |
||
106 | * @return \SimpleUPS\Address |
||
107 | */ |
||
108 | public function getAddress() |
||
112 | |||
113 | /** |
||
114 | * @internal |
||
115 | * |
||
116 | * @param integer $postalCodeLowEnd |
||
117 | * |
||
118 | * @return RegionSuggestion |
||
119 | */ |
||
120 | public function setPostalCodeLowEnd($postalCodeLowEnd) |
||
125 | |||
126 | /** |
||
127 | * When matches for a given region combination, a postal code range may be associated with each match. This is the low end of the range. |
||
128 | * @since 1.0 |
||
129 | * @return integer |
||
130 | */ |
||
131 | public function getPostalCodeLowEnd() |
||
135 | |||
136 | /** |
||
137 | * @internal |
||
138 | * |
||
139 | * @param integer $postalCodeHighEnd |
||
140 | * |
||
141 | * @return RegionSuggestion |
||
142 | */ |
||
143 | public function setPostalCodeHighEnd($postalCodeHighEnd) |
||
148 | |||
149 | /** |
||
150 | * When matches for a given region combination, a postal code range may be associated with each match. This is the high end of the range. |
||
151 | * @since 1.0 |
||
152 | * @return integer |
||
153 | */ |
||
154 | public function getPostalCodeHighEnd() |
||
158 | } |