A Qcodo based CMS/ecommerce framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
4.7 KiB

12 years ago
  1. <?php
  2. /**
  3. * This file is a part of Quasi CMS
  4. *@package Quasi
  5. */
  6. if(!defined('QUASICMS') ) die('No Quasi.');
  7. if (!defined("CUSTOMSINFORMATION.CLASS.PHP")){
  8. define("CUSTOMSINFORMATION.CLASS.PHP",1);
  9. /**
  10. * Class CustomsInformation - container for information in a customs declaration for a line item
  11. *
  12. *
  13. *@author Erik Winn <erikwinnmail@yahoo.com>
  14. *
  15. * $Id: CustomsInformation.class.php 354 2008-11-21 05:42:08Z erikwinn $
  16. *@version 0.1
  17. *
  18. *@copyright (C) 2008 by Erik Winn
  19. *@license GPL v.2
  20. This program is free software; you can redistribute it and/or modify
  21. it under the terms of the GNU General Public License as published by
  22. the Free Software Foundation; either version 2 of the License, or
  23. (at your option) any later version.
  24. This program is distributed in the hope that it will be useful,
  25. but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. GNU General Public License for more details.
  28. You should have received a copy of the GNU General Public License
  29. along with this program; if not, write to the Free Software
  30. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
  31. *
  32. *@package Quasi
  33. * @subpackage CMS
  34. */
  35. class CustomsInformation
  36. {
  37. /**
  38. *@var string strDescription - describes the Item
  39. */
  40. protected $strDescription;
  41. /**
  42. *@var integer intQuantity ..
  43. */
  44. protected $intQuantity;
  45. /**
  46. *@var float fltWeight - item weight in ounces (aggregate).
  47. */
  48. protected $fltWeight;
  49. /**
  50. *@var float fltValue - normally the final sale price of the item (aggregate)
  51. */
  52. protected $fltValue;
  53. /**
  54. * Defaults to the store address ..
  55. *@var string strOriginCountry - the country of origin for the shipment
  56. */
  57. protected $strOriginCountry = STORE_COUNTRY;
  58. public function __get($strName)
  59. {
  60. switch ($strName)
  61. {
  62. case 'Description':
  63. return $this->strDescription ;
  64. case 'OriginCountry':
  65. return $this->strOriginCountry ;
  66. case 'Quantity':
  67. return $this->intQuantity ;
  68. case 'Weight':
  69. return $this->fltWeight ;
  70. case 'Value':
  71. return $this->fltValue ;
  72. default:
  73. throw new QCallerException('CustomsInformation::__get() Unknown property: ' . $strName);
  74. }
  75. }
  76. public function __set($strName, $mixValue)
  77. {
  78. switch ($strName)
  79. {
  80. case 'Description':
  81. try {
  82. return ($this->strDescription = QType::Cast($mixValue, QType::String ));
  83. } catch (QInvalidCastException $objExc) {
  84. $objExc->IncrementOffset();
  85. throw $objExc;
  86. }
  87. case 'OriginCountry':
  88. try {
  89. return ($this->strOriginCountry = QType::Cast($mixValue, QType::String ));
  90. } catch (QInvalidCastException $objExc) {
  91. $objExc->IncrementOffset();
  92. throw $objExc;
  93. }
  94. case 'Quantity':
  95. try {
  96. return ($this->intQuantity = QType::Cast($mixValue, QType::Integer ));
  97. } catch (QInvalidCastException $objExc) {
  98. $objExc->IncrementOffset();
  99. throw $objExc;
  100. }
  101. case 'Value':
  102. try {
  103. return ($this->fltValue = QType::Cast($mixValue, QType::Float ));
  104. } catch (QInvalidCastException $objExc) {
  105. $objExc->IncrementOffset();
  106. throw $objExc;
  107. }
  108. case 'Weight':
  109. try {
  110. return ($this->fltWeight = QType::Cast($mixValue, QType::Float ));
  111. } catch (QInvalidCastException $objExc) {
  112. $objExc->IncrementOffset();
  113. throw $objExc;
  114. }
  115. default:
  116. throw new QCallerException('CustomsInformation::__get() Unknown property: ' . $strName);
  117. /* try {
  118. return (parent::__set($strName, $mixValue));
  119. } catch (QCallerException $objExc) {
  120. $objExc->IncrementOffset();
  121. throw $objExc;
  122. }*/
  123. }
  124. }
  125. }//end class
  126. }//end define
  127. ?>