A QCodo powered CMS
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.

714 lines
34 KiB

  1. <?php
  2. /**
  3. * This is a MetaControl class, providing a QForm or QPanel access to event handlers
  4. * and QControls to perform the Create, Edit, and Delete functionality
  5. * of the ShippingMethod class. This code-generated class
  6. * contains all the basic elements to help a QPanel or QForm display an HTML form that can
  7. * manipulate a single ShippingMethod object.
  8. *
  9. * To take advantage of some (or all) of these control objects, you
  10. * must create a new QForm or QPanel which instantiates a ShippingMethodMetaControl
  11. * class.
  12. *
  13. * Any and all changes to this file will be overwritten with any subsequent
  14. * code re-generation.
  15. *
  16. * @package Quinta CMS
  17. * @subpackage MetaControls
  18. * property-read ShippingMethod $ShippingMethod the actual ShippingMethod data class being edited
  19. * property QLabel $IdControl
  20. * property-read QLabel $IdLabel
  21. * property QTextBox $TitleControl
  22. * property-read QLabel $TitleLabel
  23. * property QTextBox $CarrierControl
  24. * property-read QLabel $CarrierLabel
  25. * property QTextBox $ServiceTypeControl
  26. * property-read QLabel $ServiceTypeLabel
  27. * property QTextBox $ClassNameControl
  28. * property-read QLabel $ClassNameLabel
  29. * property QTextBox $TransitTimeControl
  30. * property-read QLabel $TransitTimeLabel
  31. * property QTextBox $DescriptionControl
  32. * property-read QLabel $DescriptionLabel
  33. * property QTextBox $ImageFilenameControl
  34. * property-read QLabel $ImageFilenameLabel
  35. * property QCheckBox $ActiveControl
  36. * property-read QLabel $ActiveLabel
  37. * property QCheckBox $IsInternationalControl
  38. * property-read QLabel $IsInternationalLabel
  39. * property QCheckBox $TestModeControl
  40. * property-read QLabel $TestModeLabel
  41. * property QIntegerTextBox $SortOrderControl
  42. * property-read QLabel $SortOrderLabel
  43. * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
  44. * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
  45. */
  46. class ShippingMethodMetaControlGen extends QBaseClass {
  47. // General Variables
  48. protected $objShippingMethod;
  49. protected $objParentObject;
  50. protected $strTitleVerb;
  51. protected $blnEditMode;
  52. // Controls that allow the editing of ShippingMethod's individual data fields
  53. protected $lblId;
  54. protected $txtTitle;
  55. protected $txtCarrier;
  56. protected $txtServiceType;
  57. protected $txtClassName;
  58. protected $txtTransitTime;
  59. protected $txtDescription;
  60. protected $txtImageFilename;
  61. protected $chkActive;
  62. protected $chkIsInternational;
  63. protected $chkTestMode;
  64. protected $txtSortOrder;
  65. // Controls that allow the viewing of ShippingMethod's individual data fields
  66. protected $lblTitle;
  67. protected $lblCarrier;
  68. protected $lblServiceType;
  69. protected $lblClassName;
  70. protected $lblTransitTime;
  71. protected $lblDescription;
  72. protected $lblImageFilename;
  73. protected $lblActive;
  74. protected $lblIsInternational;
  75. protected $lblTestMode;
  76. protected $lblSortOrder;
  77. // QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References
  78. // QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References
  79. /**
  80. * Main constructor. Constructor OR static create methods are designed to be called in either
  81. * a parent QPanel or the main QForm when wanting to create a
  82. * ShippingMethodMetaControl to edit a single ShippingMethod object within the
  83. * QPanel or QForm.
  84. *
  85. * This constructor takes in a single ShippingMethod object, while any of the static
  86. * create methods below can be used to construct based off of individual PK ID(s).
  87. *
  88. * @param mixed $objParentObject QForm or QPanel which will be using this ShippingMethodMetaControl
  89. * @param ShippingMethod $objShippingMethod new or existing ShippingMethod object
  90. */
  91. public function __construct($objParentObject, ShippingMethod $objShippingMethod) {
  92. // Setup Parent Object (e.g. QForm or QPanel which will be using this ShippingMethodMetaControl)
  93. $this->objParentObject = $objParentObject;
  94. // Setup linked ShippingMethod object
  95. $this->objShippingMethod = $objShippingMethod;
  96. // Figure out if we're Editing or Creating New
  97. if ($this->objShippingMethod->__Restored) {
  98. $this->strTitleVerb = QApplication::Translate('Edit');
  99. $this->blnEditMode = true;
  100. } else {
  101. $this->strTitleVerb = QApplication::Translate('Create');
  102. $this->blnEditMode = false;
  103. }
  104. }
  105. /**
  106. * Static Helper Method to Create using PK arguments
  107. * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  108. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  109. * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
  110. * edit, or if we are also allowed to create a new one, etc.
  111. *
  112. * @param mixed $objParentObject QForm or QPanel which will be using this ShippingMethodMetaControl
  113. * @param integer $intId primary key value
  114. * @param QMetaControlCreateType $intCreateType rules governing ShippingMethod object creation - defaults to CreateOrEdit
  115. * @return ShippingMethodMetaControl
  116. */
  117. public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  118. // Attempt to Load from PK Arguments
  119. if (strlen($intId)) {
  120. $objShippingMethod = ShippingMethod::Load($intId);
  121. // ShippingMethod was found -- return it!
  122. if ($objShippingMethod)
  123. return new ShippingMethodMetaControl($objParentObject, $objShippingMethod);
  124. // If CreateOnRecordNotFound not specified, throw an exception
  125. else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
  126. throw new QCallerException('Could not find a ShippingMethod object with PK arguments: ' . $intId);
  127. // If EditOnly is specified, throw an exception
  128. } else if ($intCreateType == QMetaControlCreateType::EditOnly)
  129. throw new QCallerException('No PK arguments specified');
  130. // If we are here, then we need to create a new record
  131. return new ShippingMethodMetaControl($objParentObject, new ShippingMethod());
  132. }
  133. /**
  134. * Static Helper Method to Create using PathInfo arguments
  135. *
  136. * @param mixed $objParentObject QForm or QPanel which will be using this ShippingMethodMetaControl
  137. * @param QMetaControlCreateType $intCreateType rules governing ShippingMethod object creation - defaults to CreateOrEdit
  138. * @return ShippingMethodMetaControl
  139. */
  140. public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  141. $intId = QApplication::PathInfo(0);
  142. return ShippingMethodMetaControl::Create($objParentObject, $intId, $intCreateType);
  143. }
  144. /**
  145. * Static Helper Method to Create using QueryString arguments
  146. *
  147. * @param mixed $objParentObject QForm or QPanel which will be using this ShippingMethodMetaControl
  148. * @param QMetaControlCreateType $intCreateType rules governing ShippingMethod object creation - defaults to CreateOrEdit
  149. * @return ShippingMethodMetaControl
  150. */
  151. public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  152. $intId = QApplication::QueryString('intId');
  153. return ShippingMethodMetaControl::Create($objParentObject, $intId, $intCreateType);
  154. }
  155. ///////////////////////////////////////////////
  156. // PUBLIC CREATE and REFRESH METHODS
  157. ///////////////////////////////////////////////
  158. /**
  159. * Create and setup QLabel lblId
  160. * @param string $strControlId optional ControlId to use
  161. * @return QLabel
  162. */
  163. public function lblId_Create($strControlId = null) {
  164. $this->lblId = new QLabel($this->objParentObject, $strControlId);
  165. $this->lblId->Name = QApplication::Translate('Id');
  166. if ($this->blnEditMode)
  167. $this->lblId->Text = $this->objShippingMethod->Id;
  168. else
  169. $this->lblId->Text = 'N/A';
  170. return $this->lblId;
  171. }
  172. /**
  173. * Create and setup QTextBox txtTitle
  174. * @param string $strControlId optional ControlId to use
  175. * @return QTextBox
  176. */
  177. public function txtTitle_Create($strControlId = null) {
  178. $this->txtTitle = new QTextBox($this->objParentObject, $strControlId);
  179. $this->txtTitle->Name = QApplication::Translate('Title');
  180. $this->txtTitle->Text = $this->objShippingMethod->Title;
  181. $this->txtTitle->MaxLength = ShippingMethod::TitleMaxLength;
  182. return $this->txtTitle;
  183. }
  184. /**
  185. * Create and setup QLabel lblTitle
  186. * @param string $strControlId optional ControlId to use
  187. * @return QLabel
  188. */
  189. public function lblTitle_Create($strControlId = null) {
  190. $this->lblTitle = new QLabel($this->objParentObject, $strControlId);
  191. $this->lblTitle->Name = QApplication::Translate('Title');
  192. $this->lblTitle->Text = $this->objShippingMethod->Title;
  193. return $this->lblTitle;
  194. }
  195. /**
  196. * Create and setup QTextBox txtCarrier
  197. * @param string $strControlId optional ControlId to use
  198. * @return QTextBox
  199. */
  200. public function txtCarrier_Create($strControlId = null) {
  201. $this->txtCarrier = new QTextBox($this->objParentObject, $strControlId);
  202. $this->txtCarrier->Name = QApplication::Translate('Carrier');
  203. $this->txtCarrier->Text = $this->objShippingMethod->Carrier;
  204. $this->txtCarrier->MaxLength = ShippingMethod::CarrierMaxLength;
  205. return $this->txtCarrier;
  206. }
  207. /**
  208. * Create and setup QLabel lblCarrier
  209. * @param string $strControlId optional ControlId to use
  210. * @return QLabel
  211. */
  212. public function lblCarrier_Create($strControlId = null) {
  213. $this->lblCarrier = new QLabel($this->objParentObject, $strControlId);
  214. $this->lblCarrier->Name = QApplication::Translate('Carrier');
  215. $this->lblCarrier->Text = $this->objShippingMethod->Carrier;
  216. return $this->lblCarrier;
  217. }
  218. /**
  219. * Create and setup QTextBox txtServiceType
  220. * @param string $strControlId optional ControlId to use
  221. * @return QTextBox
  222. */
  223. public function txtServiceType_Create($strControlId = null) {
  224. $this->txtServiceType = new QTextBox($this->objParentObject, $strControlId);
  225. $this->txtServiceType->Name = QApplication::Translate('Service Type');
  226. $this->txtServiceType->Text = $this->objShippingMethod->ServiceType;
  227. $this->txtServiceType->MaxLength = ShippingMethod::ServiceTypeMaxLength;
  228. return $this->txtServiceType;
  229. }
  230. /**
  231. * Create and setup QLabel lblServiceType
  232. * @param string $strControlId optional ControlId to use
  233. * @return QLabel
  234. */
  235. public function lblServiceType_Create($strControlId = null) {
  236. $this->lblServiceType = new QLabel($this->objParentObject, $strControlId);
  237. $this->lblServiceType->Name = QApplication::Translate('Service Type');
  238. $this->lblServiceType->Text = $this->objShippingMethod->ServiceType;
  239. return $this->lblServiceType;
  240. }
  241. /**
  242. * Create and setup QTextBox txtClassName
  243. * @param string $strControlId optional ControlId to use
  244. * @return QTextBox
  245. */
  246. public function txtClassName_Create($strControlId = null) {
  247. $this->txtClassName = new QTextBox($this->objParentObject, $strControlId);
  248. $this->txtClassName->Name = QApplication::Translate('Class Name');
  249. $this->txtClassName->Text = $this->objShippingMethod->ClassName;
  250. $this->txtClassName->MaxLength = ShippingMethod::ClassNameMaxLength;
  251. return $this->txtClassName;
  252. }
  253. /**
  254. * Create and setup QLabel lblClassName
  255. * @param string $strControlId optional ControlId to use
  256. * @return QLabel
  257. */
  258. public function lblClassName_Create($strControlId = null) {
  259. $this->lblClassName = new QLabel($this->objParentObject, $strControlId);
  260. $this->lblClassName->Name = QApplication::Translate('Class Name');
  261. $this->lblClassName->Text = $this->objShippingMethod->ClassName;
  262. return $this->lblClassName;
  263. }
  264. /**
  265. * Create and setup QTextBox txtTransitTime
  266. * @param string $strControlId optional ControlId to use
  267. * @return QTextBox
  268. */
  269. public function txtTransitTime_Create($strControlId = null) {
  270. $this->txtTransitTime = new QTextBox($this->objParentObject, $strControlId);
  271. $this->txtTransitTime->Name = QApplication::Translate('Transit Time');
  272. $this->txtTransitTime->Text = $this->objShippingMethod->TransitTime;
  273. $this->txtTransitTime->MaxLength = ShippingMethod::TransitTimeMaxLength;
  274. return $this->txtTransitTime;
  275. }
  276. /**
  277. * Create and setup QLabel lblTransitTime
  278. * @param string $strControlId optional ControlId to use
  279. * @return QLabel
  280. */
  281. public function lblTransitTime_Create($strControlId = null) {
  282. $this->lblTransitTime = new QLabel($this->objParentObject, $strControlId);
  283. $this->lblTransitTime->Name = QApplication::Translate('Transit Time');
  284. $this->lblTransitTime->Text = $this->objShippingMethod->TransitTime;
  285. return $this->lblTransitTime;
  286. }
  287. /**
  288. * Create and setup QTextBox txtDescription
  289. * @param string $strControlId optional ControlId to use
  290. * @return QTextBox
  291. */
  292. public function txtDescription_Create($strControlId = null) {
  293. $this->txtDescription = new QTextBox($this->objParentObject, $strControlId);
  294. $this->txtDescription->Name = QApplication::Translate('Description');
  295. $this->txtDescription->Text = $this->objShippingMethod->Description;
  296. $this->txtDescription->TextMode = QTextMode::MultiLine;
  297. return $this->txtDescription;
  298. }
  299. /**
  300. * Create and setup QLabel lblDescription
  301. * @param string $strControlId optional ControlId to use
  302. * @return QLabel
  303. */
  304. public function lblDescription_Create($strControlId = null) {
  305. $this->lblDescription = new QLabel($this->objParentObject, $strControlId);
  306. $this->lblDescription->Name = QApplication::Translate('Description');
  307. $this->lblDescription->Text = $this->objShippingMethod->Description;
  308. return $this->lblDescription;
  309. }
  310. /**
  311. * Create and setup QTextBox txtImageFilename
  312. * @param string $strControlId optional ControlId to use
  313. * @return QTextBox
  314. */
  315. public function txtImageFilename_Create($strControlId = null) {
  316. $this->txtImageFilename = new QTextBox($this->objParentObject, $strControlId);
  317. $this->txtImageFilename->Name = QApplication::Translate('Image Filename');
  318. $this->txtImageFilename->Text = $this->objShippingMethod->ImageFilename;
  319. $this->txtImageFilename->MaxLength = ShippingMethod::ImageFilenameMaxLength;
  320. return $this->txtImageFilename;
  321. }
  322. /**
  323. * Create and setup QLabel lblImageFilename
  324. * @param string $strControlId optional ControlId to use
  325. * @return QLabel
  326. */
  327. public function lblImageFilename_Create($strControlId = null) {
  328. $this->lblImageFilename = new QLabel($this->objParentObject, $strControlId);
  329. $this->lblImageFilename->Name = QApplication::Translate('Image Filename');
  330. $this->lblImageFilename->Text = $this->objShippingMethod->ImageFilename;
  331. return $this->lblImageFilename;
  332. }
  333. /**
  334. * Create and setup QCheckBox chkActive
  335. * @param string $strControlId optional ControlId to use
  336. * @return QCheckBox
  337. */
  338. public function chkActive_Create($strControlId = null) {
  339. $this->chkActive = new QCheckBox($this->objParentObject, $strControlId);
  340. $this->chkActive->Name = QApplication::Translate('Active');
  341. $this->chkActive->Checked = $this->objShippingMethod->Active;
  342. return $this->chkActive;
  343. }
  344. /**
  345. * Create and setup QLabel lblActive
  346. * @param string $strControlId optional ControlId to use
  347. * @return QLabel
  348. */
  349. public function lblActive_Create($strControlId = null) {
  350. $this->lblActive = new QLabel($this->objParentObject, $strControlId);
  351. $this->lblActive->Name = QApplication::Translate('Active');
  352. $this->lblActive->Text = ($this->objShippingMethod->Active) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  353. return $this->lblActive;
  354. }
  355. /**
  356. * Create and setup QCheckBox chkIsInternational
  357. * @param string $strControlId optional ControlId to use
  358. * @return QCheckBox
  359. */
  360. public function chkIsInternational_Create($strControlId = null) {
  361. $this->chkIsInternational = new QCheckBox($this->objParentObject, $strControlId);
  362. $this->chkIsInternational->Name = QApplication::Translate('Is International');
  363. $this->chkIsInternational->Checked = $this->objShippingMethod->IsInternational;
  364. return $this->chkIsInternational;
  365. }
  366. /**
  367. * Create and setup QLabel lblIsInternational
  368. * @param string $strControlId optional ControlId to use
  369. * @return QLabel
  370. */
  371. public function lblIsInternational_Create($strControlId = null) {
  372. $this->lblIsInternational = new QLabel($this->objParentObject, $strControlId);
  373. $this->lblIsInternational->Name = QApplication::Translate('Is International');
  374. $this->lblIsInternational->Text = ($this->objShippingMethod->IsInternational) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  375. return $this->lblIsInternational;
  376. }
  377. /**
  378. * Create and setup QCheckBox chkTestMode
  379. * @param string $strControlId optional ControlId to use
  380. * @return QCheckBox
  381. */
  382. public function chkTestMode_Create($strControlId = null) {
  383. $this->chkTestMode = new QCheckBox($this->objParentObject, $strControlId);
  384. $this->chkTestMode->Name = QApplication::Translate('Test Mode');
  385. $this->chkTestMode->Checked = $this->objShippingMethod->TestMode;
  386. return $this->chkTestMode;
  387. }
  388. /**
  389. * Create and setup QLabel lblTestMode
  390. * @param string $strControlId optional ControlId to use
  391. * @return QLabel
  392. */
  393. public function lblTestMode_Create($strControlId = null) {
  394. $this->lblTestMode = new QLabel($this->objParentObject, $strControlId);
  395. $this->lblTestMode->Name = QApplication::Translate('Test Mode');
  396. $this->lblTestMode->Text = ($this->objShippingMethod->TestMode) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  397. return $this->lblTestMode;
  398. }
  399. /**
  400. * Create and setup QIntegerTextBox txtSortOrder
  401. * @param string $strControlId optional ControlId to use
  402. * @return QIntegerTextBox
  403. */
  404. public function txtSortOrder_Create($strControlId = null) {
  405. $this->txtSortOrder = new QIntegerTextBox($this->objParentObject, $strControlId);
  406. $this->txtSortOrder->Name = QApplication::Translate('Sort Order');
  407. $this->txtSortOrder->Text = $this->objShippingMethod->SortOrder;
  408. return $this->txtSortOrder;
  409. }
  410. /**
  411. * Create and setup QLabel lblSortOrder
  412. * @param string $strControlId optional ControlId to use
  413. * @param string $strFormat optional sprintf format to use
  414. * @return QLabel
  415. */
  416. public function lblSortOrder_Create($strControlId = null, $strFormat = null) {
  417. $this->lblSortOrder = new QLabel($this->objParentObject, $strControlId);
  418. $this->lblSortOrder->Name = QApplication::Translate('Sort Order');
  419. $this->lblSortOrder->Text = $this->objShippingMethod->SortOrder;
  420. $this->lblSortOrder->Format = $strFormat;
  421. return $this->lblSortOrder;
  422. }
  423. /**
  424. * Refresh this MetaControl with Data from the local ShippingMethod object.
  425. * @param boolean $blnReload reload ShippingMethod from the database
  426. * @return void
  427. */
  428. public function Refresh($blnReload = false) {
  429. if ($blnReload)
  430. $this->objShippingMethod->Reload();
  431. if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objShippingMethod->Id;
  432. if ($this->txtTitle) $this->txtTitle->Text = $this->objShippingMethod->Title;
  433. if ($this->lblTitle) $this->lblTitle->Text = $this->objShippingMethod->Title;
  434. if ($this->txtCarrier) $this->txtCarrier->Text = $this->objShippingMethod->Carrier;
  435. if ($this->lblCarrier) $this->lblCarrier->Text = $this->objShippingMethod->Carrier;
  436. if ($this->txtServiceType) $this->txtServiceType->Text = $this->objShippingMethod->ServiceType;
  437. if ($this->lblServiceType) $this->lblServiceType->Text = $this->objShippingMethod->ServiceType;
  438. if ($this->txtClassName) $this->txtClassName->Text = $this->objShippingMethod->ClassName;
  439. if ($this->lblClassName) $this->lblClassName->Text = $this->objShippingMethod->ClassName;
  440. if ($this->txtTransitTime) $this->txtTransitTime->Text = $this->objShippingMethod->TransitTime;
  441. if ($this->lblTransitTime) $this->lblTransitTime->Text = $this->objShippingMethod->TransitTime;
  442. if ($this->txtDescription) $this->txtDescription->Text = $this->objShippingMethod->Description;
  443. if ($this->lblDescription) $this->lblDescription->Text = $this->objShippingMethod->Description;
  444. if ($this->txtImageFilename) $this->txtImageFilename->Text = $this->objShippingMethod->ImageFilename;
  445. if ($this->lblImageFilename) $this->lblImageFilename->Text = $this->objShippingMethod->ImageFilename;
  446. if ($this->chkActive) $this->chkActive->Checked = $this->objShippingMethod->Active;
  447. if ($this->lblActive) $this->lblActive->Text = ($this->objShippingMethod->Active) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  448. if ($this->chkIsInternational) $this->chkIsInternational->Checked = $this->objShippingMethod->IsInternational;
  449. if ($this->lblIsInternational) $this->lblIsInternational->Text = ($this->objShippingMethod->IsInternational) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  450. if ($this->chkTestMode) $this->chkTestMode->Checked = $this->objShippingMethod->TestMode;
  451. if ($this->lblTestMode) $this->lblTestMode->Text = ($this->objShippingMethod->TestMode) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  452. if ($this->txtSortOrder) $this->txtSortOrder->Text = $this->objShippingMethod->SortOrder;
  453. if ($this->lblSortOrder) $this->lblSortOrder->Text = $this->objShippingMethod->SortOrder;
  454. }
  455. ///////////////////////////////////////////////
  456. // PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
  457. ///////////////////////////////////////////////
  458. ///////////////////////////////////////////////
  459. // PUBLIC SHIPPINGMETHOD OBJECT MANIPULATORS
  460. ///////////////////////////////////////////////
  461. /**
  462. * This will save this object's ShippingMethod instance,
  463. * updating only the fields which have had a control created for it.
  464. */
  465. public function SaveShippingMethod() {
  466. try {
  467. // Update any fields for controls that have been created
  468. if ($this->txtTitle) $this->objShippingMethod->Title = $this->txtTitle->Text;
  469. if ($this->txtCarrier) $this->objShippingMethod->Carrier = $this->txtCarrier->Text;
  470. if ($this->txtServiceType) $this->objShippingMethod->ServiceType = $this->txtServiceType->Text;
  471. if ($this->txtClassName) $this->objShippingMethod->ClassName = $this->txtClassName->Text;
  472. if ($this->txtTransitTime) $this->objShippingMethod->TransitTime = $this->txtTransitTime->Text;
  473. if ($this->txtDescription) $this->objShippingMethod->Description = $this->txtDescription->Text;
  474. if ($this->txtImageFilename) $this->objShippingMethod->ImageFilename = $this->txtImageFilename->Text;
  475. if ($this->chkActive) $this->objShippingMethod->Active = $this->chkActive->Checked;
  476. if ($this->chkIsInternational) $this->objShippingMethod->IsInternational = $this->chkIsInternational->Checked;
  477. if ($this->chkTestMode) $this->objShippingMethod->TestMode = $this->chkTestMode->Checked;
  478. if ($this->txtSortOrder) $this->objShippingMethod->SortOrder = $this->txtSortOrder->Text;
  479. // Update any UniqueReverseReferences (if any) for controls that have been created for it
  480. // Save the ShippingMethod object
  481. $this->objShippingMethod->Save();
  482. // Finally, update any ManyToManyReferences (if any)
  483. } catch (QCallerException $objExc) {
  484. $objExc->IncrementOffset();
  485. throw $objExc;
  486. }
  487. }
  488. /**
  489. * This will DELETE this object's ShippingMethod instance from the database.
  490. * It will also unassociate itself from any ManyToManyReferences.
  491. */
  492. public function DeleteShippingMethod() {
  493. $this->objShippingMethod->Delete();
  494. }
  495. ///////////////////////////////////////////////
  496. // PUBLIC GETTERS and SETTERS
  497. ///////////////////////////////////////////////
  498. /**
  499. * Override method to perform a property "Get"
  500. * This will get the value of $strName
  501. *
  502. * @param string $strName Name of the property to get
  503. * @return mixed
  504. */
  505. public function __get($strName) {
  506. switch ($strName) {
  507. // General MetaControlVariables
  508. case 'ShippingMethod': return $this->objShippingMethod;
  509. case 'TitleVerb': return $this->strTitleVerb;
  510. case 'EditMode': return $this->blnEditMode;
  511. // Controls that point to ShippingMethod fields -- will be created dynamically if not yet created
  512. case 'IdControl':
  513. if (!$this->lblId) return $this->lblId_Create();
  514. return $this->lblId;
  515. case 'IdLabel':
  516. if (!$this->lblId) return $this->lblId_Create();
  517. return $this->lblId;
  518. case 'TitleControl':
  519. if (!$this->txtTitle) return $this->txtTitle_Create();
  520. return $this->txtTitle;
  521. case 'TitleLabel':
  522. if (!$this->lblTitle) return $this->lblTitle_Create();
  523. return $this->lblTitle;
  524. case 'CarrierControl':
  525. if (!$this->txtCarrier) return $this->txtCarrier_Create();
  526. return $this->txtCarrier;
  527. case 'CarrierLabel':
  528. if (!$this->lblCarrier) return $this->lblCarrier_Create();
  529. return $this->lblCarrier;
  530. case 'ServiceTypeControl':
  531. if (!$this->txtServiceType) return $this->txtServiceType_Create();
  532. return $this->txtServiceType;
  533. case 'ServiceTypeLabel':
  534. if (!$this->lblServiceType) return $this->lblServiceType_Create();
  535. return $this->lblServiceType;
  536. case 'ClassNameControl':
  537. if (!$this->txtClassName) return $this->txtClassName_Create();
  538. return $this->txtClassName;
  539. case 'ClassNameLabel':
  540. if (!$this->lblClassName) return $this->lblClassName_Create();
  541. return $this->lblClassName;
  542. case 'TransitTimeControl':
  543. if (!$this->txtTransitTime) return $this->txtTransitTime_Create();
  544. return $this->txtTransitTime;
  545. case 'TransitTimeLabel':
  546. if (!$this->lblTransitTime) return $this->lblTransitTime_Create();
  547. return $this->lblTransitTime;
  548. case 'DescriptionControl':
  549. if (!$this->txtDescription) return $this->txtDescription_Create();
  550. return $this->txtDescription;
  551. case 'DescriptionLabel':
  552. if (!$this->lblDescription) return $this->lblDescription_Create();
  553. return $this->lblDescription;
  554. case 'ImageFilenameControl':
  555. if (!$this->txtImageFilename) return $this->txtImageFilename_Create();
  556. return $this->txtImageFilename;
  557. case 'ImageFilenameLabel':
  558. if (!$this->lblImageFilename) return $this->lblImageFilename_Create();
  559. return $this->lblImageFilename;
  560. case 'ActiveControl':
  561. if (!$this->chkActive) return $this->chkActive_Create();
  562. return $this->chkActive;
  563. case 'ActiveLabel':
  564. if (!$this->lblActive) return $this->lblActive_Create();
  565. return $this->lblActive;
  566. case 'IsInternationalControl':
  567. if (!$this->chkIsInternational) return $this->chkIsInternational_Create();
  568. return $this->chkIsInternational;
  569. case 'IsInternationalLabel':
  570. if (!$this->lblIsInternational) return $this->lblIsInternational_Create();
  571. return $this->lblIsInternational;
  572. case 'TestModeControl':
  573. if (!$this->chkTestMode) return $this->chkTestMode_Create();
  574. return $this->chkTestMode;
  575. case 'TestModeLabel':
  576. if (!$this->lblTestMode) return $this->lblTestMode_Create();
  577. return $this->lblTestMode;
  578. case 'SortOrderControl':
  579. if (!$this->txtSortOrder) return $this->txtSortOrder_Create();
  580. return $this->txtSortOrder;
  581. case 'SortOrderLabel':
  582. if (!$this->lblSortOrder) return $this->lblSortOrder_Create();
  583. return $this->lblSortOrder;
  584. default:
  585. try {
  586. return parent::__get($strName);
  587. } catch (QCallerException $objExc) {
  588. $objExc->IncrementOffset();
  589. throw $objExc;
  590. }
  591. }
  592. }
  593. /**
  594. * Override method to perform a property "Set"
  595. * This will set the property $strName to be $mixValue
  596. *
  597. * @param string $strName Name of the property to set
  598. * @param string $mixValue New value of the property
  599. * @return mixed
  600. */
  601. public function __set($strName, $mixValue) {
  602. try {
  603. switch ($strName) {
  604. // Controls that point to ShippingMethod fields
  605. case 'IdControl':
  606. return ($this->lblId = QType::Cast($mixValue, 'QControl'));
  607. case 'TitleControl':
  608. return ($this->txtTitle = QType::Cast($mixValue, 'QControl'));
  609. case 'CarrierControl':
  610. return ($this->txtCarrier = QType::Cast($mixValue, 'QControl'));
  611. case 'ServiceTypeControl':
  612. return ($this->txtServiceType = QType::Cast($mixValue, 'QControl'));
  613. case 'ClassNameControl':
  614. return ($this->txtClassName = QType::Cast($mixValue, 'QControl'));
  615. case 'TransitTimeControl':
  616. return ($this->txtTransitTime = QType::Cast($mixValue, 'QControl'));
  617. case 'DescriptionControl':
  618. return ($this->txtDescription = QType::Cast($mixValue, 'QControl'));
  619. case 'ImageFilenameControl':
  620. return ($this->txtImageFilename = QType::Cast($mixValue, 'QControl'));
  621. case 'ActiveControl':
  622. return ($this->chkActive = QType::Cast($mixValue, 'QControl'));
  623. case 'IsInternationalControl':
  624. return ($this->chkIsInternational = QType::Cast($mixValue, 'QControl'));
  625. case 'TestModeControl':
  626. return ($this->chkTestMode = QType::Cast($mixValue, 'QControl'));
  627. case 'SortOrderControl':
  628. return ($this->txtSortOrder = QType::Cast($mixValue, 'QControl'));
  629. default:
  630. return parent::__set($strName, $mixValue);
  631. }
  632. } catch (QCallerException $objExc) {
  633. $objExc->IncrementOffset();
  634. throw $objExc;
  635. }
  636. }
  637. }
  638. ?>