ILIAS  release_4-4 Revision
ilPaymentPrices Class Reference
+ Collaboration diagram for ilPaymentPrices:

Public Member Functions

 __construct ($a_pobject_id=0)
 
 setPriceType ($a_price_type)
 
 getPriceType ()
 
 getPobjectId ()
 
 getPrices ()
 
 getPrice ($a_price_id)
 
 setPrice ($a_price=0)
 
 setCurrency ($a_currency_id)
 
 setDuration ($a_duration)
 
 setUnlimitedDuration ($a_unlimited_duration)
 
 setExtension ($a_extension)
 
 getExtension ()
 
 add ()
 
 update ($a_price_id)
 
 delete ($a_price_id)
 
 deleteAllPrices ()
 
 validate ()
 Validates a price before database manipulations. More...
 
 getExtensionPrices ()
 
 getNumberOfPrices ()
 
 getLowestPrice ()
 
 setDurationFrom ($a_duration_from)
 
 setDurationUntil ($a_duration_until)
 
 setDescription ($a_description)
 

Static Public Member Functions

static _getPrice ($a_price_id)
 
static _countPrices ($a_pobject_id)
 
static _getPriceString ($a_price_id)
 
static _getGUIPrice ($a_price)
 
static _formatPriceToString ($a_price)
 
static _getPriceStringFromAmount ($a_price)
 
static _getTotalAmount ($a_price_ids)
 
static _priceExists ($a_price_id, $a_pobject_id)
 

Data Fields

const TYPE_DURATION_MONTH = 1
 
const TYPE_DURATION_DATE = 2
 
const TYPE_UNLIMITED_DURATION = 3
 
 $price_type = self::TYPE_DURATION_MONTH
 

Private Member Functions

 __getPrice ()
 
 __getCurrency ()
 
 __getDuration ()
 
 __getUnlimitedDuration ()
 
 __read ($with_extension_prices=false)
 
 __getDurationFrom ()
 
 __getDurationUntil ()
 
 __getDescription ()
 

Private Attributes

 $pobject_id
 
 $price
 
 $currency
 
 $duration = 0
 
 $unlimited_duration = 0
 
 $extension = 0
 
 $duration_from
 
 $duration_until
 
 $description
 
 $prices = array()
 

Detailed Description

Definition at line 11 of file class.ilPaymentPrices.php.

Constructor & Destructor Documentation

◆ __construct()

ilPaymentPrices::__construct (   $a_pobject_id = 0)

Definition at line 38 of file class.ilPaymentPrices.php.

References __read().

39  {
40  global $ilDB;
41 
42  $this->db = $ilDB;
43 
44  $this->pobject_id = $a_pobject_id;
45 
46  $this->__read();
47  }
__read($with_extension_prices=false)
+ Here is the call graph for this function:

Member Function Documentation

◆ __getCurrency()

ilPaymentPrices::__getCurrency ( )
private

Definition at line 391 of file class.ilPaymentPrices.php.

References $currency.

Referenced by add(), and update().

392  {
393  /*TODO: CURRENCY not finished yet -> return 1 as default */
394  if($this->currency == null)
395  $this->currency = 1;
396  return $this->currency;
397  }
+ Here is the caller graph for this function:

◆ __getDescription()

ilPaymentPrices::__getDescription ( )
private

Definition at line 527 of file class.ilPaymentPrices.php.

References $description.

Referenced by add(), and update().

528  {
529  return $this->description;
530  }
+ Here is the caller graph for this function:

◆ __getDuration()

ilPaymentPrices::__getDuration ( )
private

Definition at line 398 of file class.ilPaymentPrices.php.

References $duration.

Referenced by add(), update(), and validate().

399  {
400  return $this->duration;
401  }
+ Here is the caller graph for this function:

◆ __getDurationFrom()

ilPaymentPrices::__getDurationFrom ( )
private

Definition at line 518 of file class.ilPaymentPrices.php.

References $duration_from.

Referenced by add(), update(), and validate().

519  {
520  return $this->duration_from;
521  }
+ Here is the caller graph for this function:

◆ __getDurationUntil()

ilPaymentPrices::__getDurationUntil ( )
private

Definition at line 523 of file class.ilPaymentPrices.php.

References $duration_until.

Referenced by add(), update(), and validate().

524  {
525  return $this->duration_until;
526  }
+ Here is the caller graph for this function:

◆ __getPrice()

ilPaymentPrices::__getPrice ( )
private

Definition at line 387 of file class.ilPaymentPrices.php.

References $price.

Referenced by add(), update(), and validate().

388  {
389  return $this->price;
390  }
+ Here is the caller graph for this function:

◆ __getUnlimitedDuration()

ilPaymentPrices::__getUnlimitedDuration ( )
private

Definition at line 402 of file class.ilPaymentPrices.php.

References $unlimited_duration.

Referenced by add(), and update().

403  {
405  }
+ Here is the caller graph for this function:

◆ __read()

ilPaymentPrices::__read (   $with_extension_prices = false)
private

Definition at line 407 of file class.ilPaymentPrices.php.

References $res, $row, and getPobjectId().

Referenced by __construct(), add(), delete(), deleteAllPrices(), and update().

408  {
409  $this->prices = array();
410 
411  if(!$with_extension_prices)
412  {
413  $res = $this->db->queryf('
414  SELECT * FROM payment_prices
415  WHERE pobject_id = %s
416  AND extension = %s
417  ORDER BY duration',
418  array('integer','integer'),
419  array($this->getPobjectId(), 0));
420  }
421  else
422  {
423  // needed for administration view
424  $res = $this->db->queryf('
425  SELECT * FROM payment_prices
426  WHERE pobject_id = %s
427  ORDER BY duration',
428  array('integer'),
429  array($this->getPobjectId()));
430  }
431 
432  while($row = $this->db->fetchObject($res))
433  {
434  $this->prices[$row->price_id]['pobject_id'] = $row->pobject_id;
435  $this->prices[$row->price_id]['price_id'] = $row->price_id;
436  $this->prices[$row->price_id]['currency'] = $row->currency;
437  $this->prices[$row->price_id]['duration'] = $row->duration;
438  $this->prices[$row->price_id]['unlimited_duration'] = $row->unlimited_duration;
439  $this->prices[$row->price_id]['price'] = $row->price;
440  $this->prices[$row->price_id]['extension'] = $row->extension;
441  $this->prices[$row->price_id]['duration_from'] = $row->duration_from;
442  $this->prices[$row->price_id]['duration_until'] = $row->duration_until;
443  $this->prices[$row->price_id]['description'] = $row->description;
444  $this->prices[$row->price_id]['price_type'] = $row->price_type;
445  }
446  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _countPrices()

static ilPaymentPrices::_countPrices (   $a_pobject_id)
static

Definition at line 104 of file class.ilPaymentPrices.php.

References $res, and $row.

105  {
106  global $ilDB;
107 
108  $res = $ilDB->queryf('
109  SELECT count(price_id) FROM payment_prices
110  WHERE pobject_id = %s',
111  array('integer'),
112  array($a_pobject_id));
113 
114  $row = $ilDB->fetchAssoc($res);
115 
116  return ($row[0]);
117  }

◆ _formatPriceToString()

static ilPaymentPrices::_formatPriceToString (   $a_price)
static

Definition at line 149 of file class.ilPaymentPrices.php.

References ilPaymentSettings\_getInstance().

Referenced by ilShopResultPresentationGUI\renderItems(), and ilShopPurchaseGUI\showDetails().

150  {
151  include_once './Services/Payment/classes/class.ilPaymentSettings.php';
152 
154  $currency_unit = $genSet->get('currency_unit');
155 
156  $gui_price = self::_getGUIPrice($a_price);
157 
158  return $gui_price . ' ' . $currency_unit;
159 
160 /* TODO: after currency implementation is finished -> replace whole function
161  * include_once './Services/Payment/classes/class.ilPaymentCurrency.php';
162 
163  $separator= ilPaymentCurrency::_getDecimalSeparator();
164  $currency_symbol = ilPaymentCurrency::_getSymbol($a_currency_id);
165  $price_string = number_format($a_price,'2',$separator,'');
166 
167  return $price_string . ' ' . $currency_symbol;
168  */
169  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getGUIPrice()

static ilPaymentPrices::_getGUIPrice (   $a_price)
static

Definition at line 127 of file class.ilPaymentPrices.php.

References $lng.

Referenced by ilShopShoppingCartGUI\showItems().

128  {
129  global $lng;
130 
131  $system_lng = $lng->getDefaultLanguage();
132 
133  // CODES: ISO 639
134  $use_comma_seperator = array('ar','bg','cs','de','da','es','et','it',
135  'fr','nl','el','sr','uk','ru','ro','tr','pl','lt','pt','sq','hu');
136 
137 // $use_point_separator = array('en','ja','zh','vi');
138 
139  if(in_array($system_lng, $use_comma_seperator))
140  {
141  $gui_price = number_format((float)$a_price, 2, ',', '');
142  }
143  else
144  $gui_price = number_format((float)$a_price, 2, '.', '');
145 
146  return $gui_price;
147  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ _getPrice()

static ilPaymentPrices::_getPrice (   $a_price_id)
static

Definition at line 79 of file class.ilPaymentPrices.php.

References $price, $res, and $row.

Referenced by ilPurchaseBaseGUI\__getShoppingCart(), ilPaymentObjectGUI\__initPaymentObject(), ilPurchaseBaseGUI\__showItemsTable(), ilPurchaseBaseGUI\__showShoppingCart(), _getPriceString(), _getTotalAmount(), ilShopShoppingCartGUI\addBookings(), ilObjPaymentSettingsGUI\editPriceObject(), ilPaymentShoppingCart\getShoppingCart(), ilObjPaymentSettingsGUI\saveCustomerObject(), ilShopShoppingCartGUI\showItems(), and ilShopShoppingCartGUI\showItemsTable().

80  {
81  global $ilDB;
82 
83  $res = $ilDB->queryf('
84  SELECT * FROM payment_prices
85  WHERE price_id = %s',
86  array('integer'), array($a_price_id));
87 
88  while($row = $ilDB->fetchObject($res))
89  {
90  $price['duration'] = $row->duration;
91  $price['duration_from'] = $row->duration_from;
92  $price['duration_until'] = $row->duration_until;
93  $price['description'] = $row->description;
94  $price['unlimited_duration'] = $row->unlimited_duration;
95  $price['currency'] = $row->currency;
96  $price['price'] = number_format($row->price, 2, '.', '');
97  $price['extension'] = $row->extension;
98  $price['price_type'] = $row->price_type;
99  }
100 
101  return count($price) ? $price : array();
102  }
+ Here is the caller graph for this function:

◆ _getPriceString()

static ilPaymentPrices::_getPriceString (   $a_price_id)
static

Definition at line 119 of file class.ilPaymentPrices.php.

References $price, and _getPrice().

Referenced by ilShopShoppingCartGUI\addBookings(), ilPaymentStatisticGUI\addCustomer(), ilObjPaymentSettingsGUI\addCustomerObject(), ilPaymentShoppingCart\getShoppingCart(), and ilShopShoppingCartGUI\showItems().

120  {
121  $price = ilPaymentPrices::_getPrice($a_price_id);
122  $gui_price = self::_getGUIPrice($price['price']);
123 
124  return $gui_price;
125  }
static _getPrice($a_price_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getPriceStringFromAmount()

static ilPaymentPrices::_getPriceStringFromAmount (   $a_price)
static

Definition at line 172 of file class.ilPaymentPrices.php.

References ilPaymentSettings\_getInstance().

173  {
174  include_once './Services/Payment/classes/class.ilPaymentCurrency.php';
175  include_once './Services/Payment/classes/class.ilPaymentSettings.php';
176 
178  $currency_unit = $genSet->get("currency_unit");
179 
180  $pr_str = '';
181  $pr_str .= number_format($a_price , 2, ",", ".");
182 /* TODO: CURRENCY $pr_str = number_format($a_price * $this->getCurrencyConversionRate() , 2, ",", ".");
183  * remove genset
184  * */
185 
186  return $pr_str . " " . $currency_unit;
187  }
+ Here is the call graph for this function:

◆ _getTotalAmount()

static ilPaymentPrices::_getTotalAmount (   $a_price_ids)
static

Definition at line 190 of file class.ilPaymentPrices.php.

References $price, and _getPrice().

Referenced by ilPaymentShoppingCart\__read().

191  {
192  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
193 
194  $amount = array();
195 
196  if (is_array($a_price_ids))
197  {
198  for ($i = 0; $i < count($a_price_ids); $i++)
199  {
200  $price_data = ilPaymentPrices::_getPrice($a_price_ids[$i]["id"]);
201 
202  $price = (float) $price_data["price"];
203  $amount[$a_price_ids[$i]["pay_method"]] += (float) $price;
204  }
205  }
206  return $amount;
207  }
static _getPrice($a_price_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _priceExists()

static ilPaymentPrices::_priceExists (   $a_price_id,
  $a_pobject_id 
)
static

Definition at line 371 of file class.ilPaymentPrices.php.

References $res.

Referenced by ilPaymentShoppingCart\__read().

372  {
373  global $ilDB;
374 
375  $res = $ilDB->queryf('
376  SELECT * FROM payment_prices
377  WHERE price_id = %s
378  AND pobject_id = %s',
379  array('integer', 'integer'),
380  array($a_price_id, $a_pobject_id));
381 
382  return $res->numRows() ? true : false;
383  }
+ Here is the caller graph for this function:

◆ add()

ilPaymentPrices::add ( )

Definition at line 248 of file class.ilPaymentPrices.php.

References $res, __getCurrency(), __getDescription(), __getDuration(), __getDurationFrom(), __getDurationUntil(), __getPrice(), __getUnlimitedDuration(), __read(), getExtension(), getPobjectId(), and getPriceType().

249  {
250  $next_id = $this->db->nextId('payment_prices');
251 
252  $res = $this->db->insert('payment_prices', array(
253  'price_id' => array('integer', $next_id),
254  'pobject_id' => array('integer', $this->getPobjectId()),
255  'currency' => array('integer', $this->__getCurrency()),
256  'duration' => array('integer', $this->__getDuration()),
257  'unlimited_duration'=> array('integer', $this->__getUnlimitedDuration()),
258  'price' => array('float', $this->__getPrice()),
259  'extension' => array('integer', $this->getExtension()),
260  'duration_from' => array('date', $this->__getDurationFrom()),
261  'duration_until' => array('date', $this->__getDurationUntil()),
262  'description' => array('text', $this->__getDescription()),
263  'price_type' => array('integer', $this->getPriceType())
264  ));
265 
266  $this->__read(true);
267  return true;
268  }
__read($with_extension_prices=false)
+ Here is the call graph for this function:

◆ delete()

ilPaymentPrices::delete (   $a_price_id)

Definition at line 289 of file class.ilPaymentPrices.php.

References __read().

290  {
291  $statement = $this->db->manipulateF('
292  DELETE FROM payment_prices
293  WHERE price_id = %s',
294  array('integer'), array($a_price_id));
295 
296  $this->__read(true);
297 
298  return true;
299  }
__read($with_extension_prices=false)
+ Here is the call graph for this function:

◆ deleteAllPrices()

ilPaymentPrices::deleteAllPrices ( )

Definition at line 300 of file class.ilPaymentPrices.php.

References __read(), and getPobjectId().

301  {
302  $statement = $this->db->manipulateF('
303  DELETE FROM payment_prices
304  WHERE pobject_id = %s',
305  array('integer'),
306  array($this->getPobjectId()));
307 
308  $this->__read(true);
309 
310  return true;
311  }
__read($with_extension_prices=false)
+ Here is the call graph for this function:

◆ getExtension()

ilPaymentPrices::getExtension ( )

Definition at line 242 of file class.ilPaymentPrices.php.

References $extension.

Referenced by add(), and update().

243  {
244  return $this->extension;
245  }
+ Here is the caller graph for this function:

◆ getExtensionPrices()

ilPaymentPrices::getExtensionPrices ( )

Definition at line 448 of file class.ilPaymentPrices.php.

References $prices, $res, $row, and getPobjectId().

449  {
450  $prices = array();
451 
452  $res = $this->db->queryf('
453  SELECT * FROM payment_prices
454  WHERE pobject_id = %s
455  AND extension = %s
456  ORDER BY duration',
457  array('integer','integer'),
458  array($this->getPobjectId(), 1));
459 
460  while($row = $this->db->fetchObject($res))
461  {
462  $prices[$row->price_id]['pobject_id'] = $row->pobject_id;
463  $prices[$row->price_id]['price_id'] = $row->price_id;
464  $prices[$row->price_id]['currency'] = $row->currency;
465  $prices[$row->price_id]['duration'] = $row->duration;
466  $prices[$row->price_id]['unlimited_duration'] = $row->unlimited_duration;
467  $prices[$row->price_id]['price'] = $row->price;
468  $prices[$row->price_id]['extension'] = $row->extension;
469  $prices[$row->price_id]['duration_from'] = $row->duration_from;
470  $prices[$row->price_id]['duration_until'] = $row->duration_until;
471  $prices[$row->price_id]['description'] = $row->description;
472  $prices[$row->price_id]['price_type'] = $row->price_type;
473  }
474  return $prices;
475  }
+ Here is the call graph for this function:

◆ getLowestPrice()

ilPaymentPrices::getLowestPrice ( )

Definition at line 482 of file class.ilPaymentPrices.php.

References $data.

Referenced by ilShopResultPresentationGUI\renderItems().

483  {
484  $lowest_price_id = 0;
485  $lowest_price = 0;
486 
487  foreach ($this->prices as $price_id => $data)
488  {
489  $current_price = $data['price'];
490 
491  if($lowest_price == 0||
492  $lowest_price > (float)$current_price)
493  {
494  $lowest_price = (float)$current_price;
495  $lowest_price_id = $price_id;
496  }
497  }
498 
499  return is_array($this->prices[$lowest_price_id]) ? $this->prices[$lowest_price_id] : array();
500  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the caller graph for this function:

◆ getNumberOfPrices()

ilPaymentPrices::getNumberOfPrices ( )

Definition at line 477 of file class.ilPaymentPrices.php.

478  {
479  return count($this->prices);
480  }

◆ getPobjectId()

ilPaymentPrices::getPobjectId ( )

Definition at line 63 of file class.ilPaymentPrices.php.

References $pobject_id.

Referenced by __read(), add(), deleteAllPrices(), getExtensionPrices(), and update().

64  {
65  return $this->pobject_id;
66  }
+ Here is the caller graph for this function:

◆ getPrice()

ilPaymentPrices::getPrice (   $a_price_id)

Definition at line 72 of file class.ilPaymentPrices.php.

73  {
74  return $this->prices[$a_price_id] ? $this->prices[$a_price_id] : array();
75  }

◆ getPrices()

ilPaymentPrices::getPrices ( )

Definition at line 68 of file class.ilPaymentPrices.php.

69  {
70  return $this->prices ? $this->prices : array();
71  }

◆ getPriceType()

ilPaymentPrices::getPriceType ( )

Definition at line 56 of file class.ilPaymentPrices.php.

References $price_type.

Referenced by add(), update(), and validate().

57  {
58  return $this->price_type;
59  }
+ Here is the caller graph for this function:

◆ setCurrency()

ilPaymentPrices::setCurrency (   $a_currency_id)

Definition at line 216 of file class.ilPaymentPrices.php.

217  {
218  $this->currency = $a_currency_id;
219  }

◆ setDescription()

ilPaymentPrices::setDescription (   $a_description)

Definition at line 513 of file class.ilPaymentPrices.php.

514  {
515  $this->description = $a_description;
516  }

◆ setDuration()

ilPaymentPrices::setDuration (   $a_duration)

Definition at line 220 of file class.ilPaymentPrices.php.

221  {
222  if($this->unlimited_duration == '1' && ($a_duration == '' || null))
223  $a_duration = 0;
224 
225  $this->duration = (int)$a_duration;
226  }

◆ setDurationFrom()

ilPaymentPrices::setDurationFrom (   $a_duration_from)

Definition at line 502 of file class.ilPaymentPrices.php.

503  {
504  // $a_duration_from = "dd.mm.YYYY HH:ii:ss"
505  $this->duration_from = $a_duration_from;
506  }

◆ setDurationUntil()

ilPaymentPrices::setDurationUntil (   $a_duration_until)

Definition at line 508 of file class.ilPaymentPrices.php.

509  {
510  $this->duration_until = $a_duration_until;
511  }

◆ setExtension()

ilPaymentPrices::setExtension (   $a_extension)

Definition at line 237 of file class.ilPaymentPrices.php.

238  {
239  $this->extension = (int)$a_extension;
240  }

◆ setPrice()

ilPaymentPrices::setPrice (   $a_price = 0)

Definition at line 210 of file class.ilPaymentPrices.php.

211  {
212  $this->price = preg_replace('/,/','.',$a_price);
213  $this->price = (float)$a_price;
214  }

◆ setPriceType()

ilPaymentPrices::setPriceType (   $a_price_type)

Definition at line 49 of file class.ilPaymentPrices.php.

50  {
51  $this->price_type = $a_price_type;
52 
53  return $this;
54  }

◆ setUnlimitedDuration()

ilPaymentPrices::setUnlimitedDuration (   $a_unlimited_duration)

Definition at line 228 of file class.ilPaymentPrices.php.

229  {
230  if($a_unlimited_duration)
231  $this->unlimited_duration = (int)$a_unlimited_duration;
232  else
233  $this->unlimited_duration = 0;
234  }

◆ update()

ilPaymentPrices::update (   $a_price_id)

Definition at line 269 of file class.ilPaymentPrices.php.

References __getCurrency(), __getDescription(), __getDuration(), __getDurationFrom(), __getDurationUntil(), __getPrice(), __getUnlimitedDuration(), __read(), getExtension(), getPobjectId(), and getPriceType().

270  {
271  $this->db->update('payment_prices',
272  array( 'pobject_id' => array('integer', $this->getPobjectId()),
273  'currency' => array('integer', $this->__getCurrency()),
274  'duration' => array('integer', $this->__getDuration()),
275  'unlimited_duration'=> array('integer', $this->__getUnlimitedDuration()),
276  'price' => array('float', $this->__getPrice()),
277  'extension' => array('integer', $this->getExtension()),
278  'duration_from' => array('date', $this->__getDurationFrom()),
279  'duration_until' => array('date', $this->__getDurationUntil()),
280  'description' => array('text', $this->__getDescription()),
281  'price_type' => array('integer', $this->getPriceType())
282  ),
283  array('price_id'=> array('integer', $a_price_id)));
284 
285  $this->__read(true);
286 
287  return true;
288  }
__read($with_extension_prices=false)
+ Here is the call graph for this function:

◆ validate()

ilPaymentPrices::validate ( )

Validates a price before database manipulations.

public

Exceptions
ilShopException

Definition at line 319 of file class.ilPaymentPrices.php.

References $lng, __getDuration(), __getDurationFrom(), __getDurationUntil(), __getPrice(), and getPriceType().

320  {
321  global $lng;
322 
323  include_once 'Services/Payment/exceptions/class.ilShopException.php';
324 
325  switch($this->getPriceType())
326  {
327  case self::TYPE_DURATION_MONTH:
328  if(!preg_match('/^[1-9][0-9]{0,1}$/', $this->__getDuration()))
329  throw new ilShopException($lng->txt('paya_price_not_valid'));
330  break;
331 
332  case self::TYPE_DURATION_DATE:
333  if(!preg_match('/^[0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}$/', $this->__getDurationFrom()))
334  throw new ilShopException($lng->txt('payment_price_invalid_date_from'));
335 
336  $from_date = explode('-', $this->__getDurationFrom());
337  if(!checkdate($from_date[1], $from_date[2], $from_date[0]))
338  throw new ilShopException($lng->txt('payment_price_invalid_date_from'));
339 
340  if(!preg_match('/^[0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}$/', $this->__getDurationUntil()))
341  throw new ilShopException($lng->txt('payment_price_invalid_date_until'));
342 
343  $till_date = explode('-', $this->__getDurationUntil());
344  if(!checkdate($till_date[1], $till_date[2], $till_date[0]))
345  throw new ilShopException($lng->txt('payment_price_invalid_date_until'));
346 
347  $from = mktime(12, 12, 12, $from_date[1], $from_date[2], $from_date[0]);
348  $till = mktime(12, 12, 12, $till_date[1], $till_date[2], $till_date[0]);
349 
350  if($from >= $till)
351  throw new ilShopException($lng->txt('payment_price_invalid_date_from_gt_until'));
352  break;
353 
354  case self::TYPE_UNLIMITED_DURATION:
355  return true;
356  break;
357 
358  default:
359  throw new ilShopException($lng->txt('payment_no_price_type_selected_sdf'));
360  break;
361  }
362 
363  if(preg_match('/[0-9]/',$this->__getPrice()))
364  {
365  return true;
366  }
367  throw new ilShopException($lng->txt('payment_price_invalid_price'));
368  }
global $lng
Definition: privfeed.php:40
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:

Field Documentation

◆ $currency

ilPaymentPrices::$currency
private

Definition at line 22 of file class.ilPaymentPrices.php.

Referenced by __getCurrency().

◆ $description

ilPaymentPrices::$description
private

Definition at line 29 of file class.ilPaymentPrices.php.

Referenced by __getDescription().

◆ $duration

ilPaymentPrices::$duration = 0
private

Definition at line 23 of file class.ilPaymentPrices.php.

Referenced by __getDuration().

◆ $duration_from

ilPaymentPrices::$duration_from
private

Definition at line 27 of file class.ilPaymentPrices.php.

Referenced by __getDurationFrom().

◆ $duration_until

ilPaymentPrices::$duration_until
private

Definition at line 28 of file class.ilPaymentPrices.php.

Referenced by __getDurationUntil().

◆ $extension

ilPaymentPrices::$extension = 0
private

Definition at line 25 of file class.ilPaymentPrices.php.

Referenced by getExtension().

◆ $pobject_id

ilPaymentPrices::$pobject_id
private

Definition at line 19 of file class.ilPaymentPrices.php.

Referenced by getPobjectId().

◆ $price

ilPaymentPrices::$price
private

Definition at line 21 of file class.ilPaymentPrices.php.

Referenced by __getPrice(), _getPrice(), _getPriceString(), and _getTotalAmount().

◆ $price_type

ilPaymentPrices::$price_type = self::TYPE_DURATION_MONTH

Definition at line 30 of file class.ilPaymentPrices.php.

Referenced by getPriceType().

◆ $prices

ilPaymentPrices::$prices = array()
private

Definition at line 36 of file class.ilPaymentPrices.php.

Referenced by getExtensionPrices().

◆ $unlimited_duration

ilPaymentPrices::$unlimited_duration = 0
private

Definition at line 24 of file class.ilPaymentPrices.php.

Referenced by __getUnlimitedDuration().

◆ TYPE_DURATION_DATE

◆ TYPE_DURATION_MONTH

◆ TYPE_UNLIMITED_DURATION


The documentation for this class was generated from the following file: