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.

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