1 | <?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
||
27 | class EE_Price extends EE_Soft_Delete_Base_Class { |
||
28 | |||
29 | /** |
||
30 | * |
||
31 | * @param array $props_n_values incoming values |
||
32 | * @param string $timezone incoming timezone (if not set the timezone set for the website will be |
||
33 | * used.) |
||
34 | * @param array $date_formats incoming date_formats in an array where the first value is the |
||
35 | * date_format and the second value is the time format |
||
36 | * @return EE_Attendee |
||
37 | */ |
||
38 | public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) { |
||
42 | |||
43 | |||
44 | |||
45 | /** |
||
46 | * @param array $props_n_values incoming values from the database |
||
47 | * @param string $timezone incoming timezone as set by the model. If not set the timezone for |
||
48 | * the website will be used. |
||
49 | * @return EE_Attendee |
||
50 | */ |
||
51 | public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) { |
||
54 | |||
55 | |||
56 | |||
57 | /** |
||
58 | * Set Price type ID |
||
59 | * |
||
60 | * @access public |
||
61 | * @param int $PRT_ID |
||
62 | */ |
||
63 | public function set_type( $PRT_ID = 0 ) { |
||
66 | |||
67 | |||
68 | |||
69 | /** |
||
70 | * Set Price Amount |
||
71 | * |
||
72 | * @access public |
||
73 | * @param float $PRC_amount |
||
74 | */ |
||
75 | public function set_amount( $PRC_amount = 0.00 ) { |
||
78 | |||
79 | |||
80 | |||
81 | /** |
||
82 | * Set Price Name |
||
83 | * |
||
84 | * @access public |
||
85 | * @param string $PRC_name |
||
86 | */ |
||
87 | public function set_name( $PRC_name = '' ) { |
||
90 | |||
91 | |||
92 | |||
93 | /** |
||
94 | * Set Price Description |
||
95 | * |
||
96 | * @access public |
||
97 | * @param string $PRC_desc |
||
98 | */ |
||
99 | public function set_description( $PRC_desc = '' ) { |
||
102 | |||
103 | |||
104 | |||
105 | /** |
||
106 | * set is_default |
||
107 | * |
||
108 | * @access public |
||
109 | * @param bool $PRC_is_default |
||
110 | */ |
||
111 | public function set_is_default( $PRC_is_default = FALSE ) { |
||
114 | |||
115 | |||
116 | |||
117 | /** |
||
118 | * set deleted |
||
119 | * |
||
120 | * @access public |
||
121 | * @param bool $PRC_deleted |
||
122 | */ |
||
123 | public function set_deleted( $PRC_deleted = NULL ) { |
||
126 | |||
127 | |||
128 | |||
129 | /** |
||
130 | * get Price type |
||
131 | * @access public |
||
132 | * @return int |
||
133 | */ |
||
134 | public function type() { |
||
137 | |||
138 | |||
139 | |||
140 | /** |
||
141 | * get Price Amount |
||
142 | * @access public |
||
143 | * @return float |
||
144 | */ |
||
145 | public function amount() { |
||
148 | |||
149 | |||
150 | |||
151 | /** |
||
152 | * get Price Name |
||
153 | * @access public |
||
154 | * @return string |
||
155 | */ |
||
156 | public function name() { |
||
159 | |||
160 | |||
161 | |||
162 | /** |
||
163 | * get Price description |
||
164 | * @access public |
||
165 | * @return string |
||
166 | */ |
||
167 | public function desc() { |
||
170 | |||
171 | |||
172 | |||
173 | /** |
||
174 | * get overrides |
||
175 | * @access public |
||
176 | * @return int |
||
177 | */ |
||
178 | public function overrides() { |
||
181 | |||
182 | |||
183 | |||
184 | /** |
||
185 | * get order |
||
186 | * @access public |
||
187 | * @return int |
||
188 | */ |
||
189 | public function order() { |
||
192 | |||
193 | |||
194 | |||
195 | /** |
||
196 | * get the author of the price |
||
197 | * |
||
198 | * @since 4.5.0 |
||
199 | * |
||
200 | * @return int |
||
201 | */ |
||
202 | public function wp_user() { |
||
205 | |||
206 | |||
207 | |||
208 | /** |
||
209 | * get is_default |
||
210 | * @access public |
||
211 | * @return bool |
||
212 | */ |
||
213 | public function is_default() { |
||
216 | |||
217 | |||
218 | |||
219 | /** |
||
220 | * get deleted |
||
221 | * @access public |
||
222 | * @return bool |
||
223 | */ |
||
224 | public function deleted() { |
||
227 | |||
228 | |||
229 | |||
230 | /** |
||
231 | * @return bool |
||
232 | */ |
||
233 | public function parent() { |
||
236 | |||
237 | |||
238 | //some helper methods for getting info on the price_type for this price |
||
239 | |||
240 | /** |
||
241 | * return whether the price is a base price or not |
||
242 | * @return boolean |
||
243 | */ |
||
244 | public function is_base_price() { |
||
248 | |||
249 | |||
250 | |||
251 | /** |
||
252 | * |
||
253 | * @return EE_Price_Type |
||
254 | */ |
||
255 | public function type_obj() { |
||
258 | |||
259 | |||
260 | |||
261 | /** |
||
262 | * Simply indicates whether this price increases or decreases the total |
||
263 | * @return boolean true = discount, otherwise adds to the total |
||
264 | */ |
||
265 | public function is_discount() { |
||
269 | |||
270 | |||
271 | |||
272 | /** |
||
273 | * whether the price is a percentage or not |
||
274 | * @return boolean |
||
275 | */ |
||
276 | public function is_percent() { |
||
280 | |||
281 | |||
282 | /** |
||
283 | * return pretty price dependant on whether its a dollar or percent. |
||
284 | * |
||
285 | * @since 4.4.0 |
||
286 | * |
||
287 | * @return string |
||
288 | */ |
||
289 | public function pretty_price() { |
||
292 | |||
293 | |||
294 | |||
295 | /** |
||
296 | * @return mixed |
||
297 | */ |
||
298 | public function get_price_without_currency_symbol() { |
||
301 | } |
||
302 | |||
305 |