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.

909 lines
44 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 PaypalTransaction 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 PaypalTransaction 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 PaypalTransactionMetaControl
  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 PaypalTransaction $PaypalTransaction the actual PaypalTransaction data class being edited
  19. * property QLabel $IdControl
  20. * property-read QLabel $IdLabel
  21. * property QListBox $OrderIdControl
  22. * property-read QLabel $OrderIdLabel
  23. * property QTextBox $CorrelationIdControl
  24. * property-read QLabel $CorrelationIdLabel
  25. * property QTextBox $TransactionIdControl
  26. * property-read QLabel $TransactionIdLabel
  27. * property QTextBox $PpTokenControl
  28. * property-read QLabel $PpTokenLabel
  29. * property QTextBox $PayerIdControl
  30. * property-read QLabel $PayerIdLabel
  31. * property QTextBox $PayerStatusControl
  32. * property-read QLabel $PayerStatusLabel
  33. * property QTextBox $PaymentStatusControl
  34. * property-read QLabel $PaymentStatusLabel
  35. * property QTextBox $AckReturnedControl
  36. * property-read QLabel $AckReturnedLabel
  37. * property QTextBox $ApiActionControl
  38. * property-read QLabel $ApiActionLabel
  39. * property QDateTimePicker $TimeStampControl
  40. * property-read QLabel $TimeStampLabel
  41. * property QTextBox $ApiVersionControl
  42. * property-read QLabel $ApiVersionLabel
  43. * property QTextBox $MessagesControl
  44. * property-read QLabel $MessagesLabel
  45. * property QFloatTextBox $AmountControl
  46. * property-read QLabel $AmountLabel
  47. * property QFloatTextBox $PpFeeControl
  48. * property-read QLabel $PpFeeLabel
  49. * property QIntegerTextBox $PaymentMethodIdControl
  50. * property-read QLabel $PaymentMethodIdLabel
  51. * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
  52. * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
  53. */
  54. class PaypalTransactionMetaControlGen extends QBaseClass {
  55. // General Variables
  56. protected $objPaypalTransaction;
  57. protected $objParentObject;
  58. protected $strTitleVerb;
  59. protected $blnEditMode;
  60. // Controls that allow the editing of PaypalTransaction's individual data fields
  61. protected $lblId;
  62. protected $lstOrder;
  63. protected $txtCorrelationId;
  64. protected $txtTransactionId;
  65. protected $txtPpToken;
  66. protected $txtPayerId;
  67. protected $txtPayerStatus;
  68. protected $txtPaymentStatus;
  69. protected $txtAckReturned;
  70. protected $txtApiAction;
  71. protected $calTimeStamp;
  72. protected $txtApiVersion;
  73. protected $txtMessages;
  74. protected $txtAmount;
  75. protected $txtPpFee;
  76. protected $txtPaymentMethodId;
  77. // Controls that allow the viewing of PaypalTransaction's individual data fields
  78. protected $lblOrderId;
  79. protected $lblCorrelationId;
  80. protected $lblTransactionId;
  81. protected $lblPpToken;
  82. protected $lblPayerId;
  83. protected $lblPayerStatus;
  84. protected $lblPaymentStatus;
  85. protected $lblAckReturned;
  86. protected $lblApiAction;
  87. protected $lblTimeStamp;
  88. protected $lblApiVersion;
  89. protected $lblMessages;
  90. protected $lblAmount;
  91. protected $lblPpFee;
  92. protected $lblPaymentMethodId;
  93. // QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References
  94. // QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References
  95. /**
  96. * Main constructor. Constructor OR static create methods are designed to be called in either
  97. * a parent QPanel or the main QForm when wanting to create a
  98. * PaypalTransactionMetaControl to edit a single PaypalTransaction object within the
  99. * QPanel or QForm.
  100. *
  101. * This constructor takes in a single PaypalTransaction object, while any of the static
  102. * create methods below can be used to construct based off of individual PK ID(s).
  103. *
  104. * @param mixed $objParentObject QForm or QPanel which will be using this PaypalTransactionMetaControl
  105. * @param PaypalTransaction $objPaypalTransaction new or existing PaypalTransaction object
  106. */
  107. public function __construct($objParentObject, PaypalTransaction $objPaypalTransaction) {
  108. // Setup Parent Object (e.g. QForm or QPanel which will be using this PaypalTransactionMetaControl)
  109. $this->objParentObject = $objParentObject;
  110. // Setup linked PaypalTransaction object
  111. $this->objPaypalTransaction = $objPaypalTransaction;
  112. // Figure out if we're Editing or Creating New
  113. if ($this->objPaypalTransaction->__Restored) {
  114. $this->strTitleVerb = QApplication::Translate('Edit');
  115. $this->blnEditMode = true;
  116. } else {
  117. $this->strTitleVerb = QApplication::Translate('Create');
  118. $this->blnEditMode = false;
  119. }
  120. }
  121. /**
  122. * Static Helper Method to Create using PK arguments
  123. * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  124. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  125. * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
  126. * edit, or if we are also allowed to create a new one, etc.
  127. *
  128. * @param mixed $objParentObject QForm or QPanel which will be using this PaypalTransactionMetaControl
  129. * @param integer $intId primary key value
  130. * @param QMetaControlCreateType $intCreateType rules governing PaypalTransaction object creation - defaults to CreateOrEdit
  131. * @return PaypalTransactionMetaControl
  132. */
  133. public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  134. // Attempt to Load from PK Arguments
  135. if (strlen($intId)) {
  136. $objPaypalTransaction = PaypalTransaction::Load($intId);
  137. // PaypalTransaction was found -- return it!
  138. if ($objPaypalTransaction)
  139. return new PaypalTransactionMetaControl($objParentObject, $objPaypalTransaction);
  140. // If CreateOnRecordNotFound not specified, throw an exception
  141. else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
  142. throw new QCallerException('Could not find a PaypalTransaction object with PK arguments: ' . $intId);
  143. // If EditOnly is specified, throw an exception
  144. } else if ($intCreateType == QMetaControlCreateType::EditOnly)
  145. throw new QCallerException('No PK arguments specified');
  146. // If we are here, then we need to create a new record
  147. return new PaypalTransactionMetaControl($objParentObject, new PaypalTransaction());
  148. }
  149. /**
  150. * Static Helper Method to Create using PathInfo arguments
  151. *
  152. * @param mixed $objParentObject QForm or QPanel which will be using this PaypalTransactionMetaControl
  153. * @param QMetaControlCreateType $intCreateType rules governing PaypalTransaction object creation - defaults to CreateOrEdit
  154. * @return PaypalTransactionMetaControl
  155. */
  156. public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  157. $intId = QApplication::PathInfo(0);
  158. return PaypalTransactionMetaControl::Create($objParentObject, $intId, $intCreateType);
  159. }
  160. /**
  161. * Static Helper Method to Create using QueryString arguments
  162. *
  163. * @param mixed $objParentObject QForm or QPanel which will be using this PaypalTransactionMetaControl
  164. * @param QMetaControlCreateType $intCreateType rules governing PaypalTransaction object creation - defaults to CreateOrEdit
  165. * @return PaypalTransactionMetaControl
  166. */
  167. public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  168. $intId = QApplication::QueryString('intId');
  169. return PaypalTransactionMetaControl::Create($objParentObject, $intId, $intCreateType);
  170. }
  171. ///////////////////////////////////////////////
  172. // PUBLIC CREATE and REFRESH METHODS
  173. ///////////////////////////////////////////////
  174. /**
  175. * Create and setup QLabel lblId
  176. * @param string $strControlId optional ControlId to use
  177. * @return QLabel
  178. */
  179. public function lblId_Create($strControlId = null) {
  180. $this->lblId = new QLabel($this->objParentObject, $strControlId);
  181. $this->lblId->Name = QApplication::Translate('Id');
  182. if ($this->blnEditMode)
  183. $this->lblId->Text = $this->objPaypalTransaction->Id;
  184. else
  185. $this->lblId->Text = 'N/A';
  186. return $this->lblId;
  187. }
  188. /**
  189. * Create and setup QListBox lstOrder
  190. * @param string $strControlId optional ControlId to use
  191. * @return QListBox
  192. */
  193. public function lstOrder_Create($strControlId = null) {
  194. $this->lstOrder = new QListBox($this->objParentObject, $strControlId);
  195. $this->lstOrder->Name = QApplication::Translate('Order');
  196. $this->lstOrder->Required = true;
  197. if (!$this->blnEditMode)
  198. $this->lstOrder->AddItem(QApplication::Translate('- Select One -'), null);
  199. $objOrderArray = Order::LoadAll();
  200. if ($objOrderArray) foreach ($objOrderArray as $objOrder) {
  201. $objListItem = new QListItem($objOrder->__toString(), $objOrder->Id);
  202. if (($this->objPaypalTransaction->Order) && ($this->objPaypalTransaction->Order->Id == $objOrder->Id))
  203. $objListItem->Selected = true;
  204. $this->lstOrder->AddItem($objListItem);
  205. }
  206. return $this->lstOrder;
  207. }
  208. /**
  209. * Create and setup QLabel lblOrderId
  210. * @param string $strControlId optional ControlId to use
  211. * @return QLabel
  212. */
  213. public function lblOrderId_Create($strControlId = null) {
  214. $this->lblOrderId = new QLabel($this->objParentObject, $strControlId);
  215. $this->lblOrderId->Name = QApplication::Translate('Order');
  216. $this->lblOrderId->Text = ($this->objPaypalTransaction->Order) ? $this->objPaypalTransaction->Order->__toString() : null;
  217. $this->lblOrderId->Required = true;
  218. return $this->lblOrderId;
  219. }
  220. /**
  221. * Create and setup QTextBox txtCorrelationId
  222. * @param string $strControlId optional ControlId to use
  223. * @return QTextBox
  224. */
  225. public function txtCorrelationId_Create($strControlId = null) {
  226. $this->txtCorrelationId = new QTextBox($this->objParentObject, $strControlId);
  227. $this->txtCorrelationId->Name = QApplication::Translate('Correlation Id');
  228. $this->txtCorrelationId->Text = $this->objPaypalTransaction->CorrelationId;
  229. $this->txtCorrelationId->MaxLength = PaypalTransaction::CorrelationIdMaxLength;
  230. return $this->txtCorrelationId;
  231. }
  232. /**
  233. * Create and setup QLabel lblCorrelationId
  234. * @param string $strControlId optional ControlId to use
  235. * @return QLabel
  236. */
  237. public function lblCorrelationId_Create($strControlId = null) {
  238. $this->lblCorrelationId = new QLabel($this->objParentObject, $strControlId);
  239. $this->lblCorrelationId->Name = QApplication::Translate('Correlation Id');
  240. $this->lblCorrelationId->Text = $this->objPaypalTransaction->CorrelationId;
  241. return $this->lblCorrelationId;
  242. }
  243. /**
  244. * Create and setup QTextBox txtTransactionId
  245. * @param string $strControlId optional ControlId to use
  246. * @return QTextBox
  247. */
  248. public function txtTransactionId_Create($strControlId = null) {
  249. $this->txtTransactionId = new QTextBox($this->objParentObject, $strControlId);
  250. $this->txtTransactionId->Name = QApplication::Translate('Transaction Id');
  251. $this->txtTransactionId->Text = $this->objPaypalTransaction->TransactionId;
  252. $this->txtTransactionId->MaxLength = PaypalTransaction::TransactionIdMaxLength;
  253. return $this->txtTransactionId;
  254. }
  255. /**
  256. * Create and setup QLabel lblTransactionId
  257. * @param string $strControlId optional ControlId to use
  258. * @return QLabel
  259. */
  260. public function lblTransactionId_Create($strControlId = null) {
  261. $this->lblTransactionId = new QLabel($this->objParentObject, $strControlId);
  262. $this->lblTransactionId->Name = QApplication::Translate('Transaction Id');
  263. $this->lblTransactionId->Text = $this->objPaypalTransaction->TransactionId;
  264. return $this->lblTransactionId;
  265. }
  266. /**
  267. * Create and setup QTextBox txtPpToken
  268. * @param string $strControlId optional ControlId to use
  269. * @return QTextBox
  270. */
  271. public function txtPpToken_Create($strControlId = null) {
  272. $this->txtPpToken = new QTextBox($this->objParentObject, $strControlId);
  273. $this->txtPpToken->Name = QApplication::Translate('Pp Token');
  274. $this->txtPpToken->Text = $this->objPaypalTransaction->PpToken;
  275. $this->txtPpToken->MaxLength = PaypalTransaction::PpTokenMaxLength;
  276. return $this->txtPpToken;
  277. }
  278. /**
  279. * Create and setup QLabel lblPpToken
  280. * @param string $strControlId optional ControlId to use
  281. * @return QLabel
  282. */
  283. public function lblPpToken_Create($strControlId = null) {
  284. $this->lblPpToken = new QLabel($this->objParentObject, $strControlId);
  285. $this->lblPpToken->Name = QApplication::Translate('Pp Token');
  286. $this->lblPpToken->Text = $this->objPaypalTransaction->PpToken;
  287. return $this->lblPpToken;
  288. }
  289. /**
  290. * Create and setup QTextBox txtPayerId
  291. * @param string $strControlId optional ControlId to use
  292. * @return QTextBox
  293. */
  294. public function txtPayerId_Create($strControlId = null) {
  295. $this->txtPayerId = new QTextBox($this->objParentObject, $strControlId);
  296. $this->txtPayerId->Name = QApplication::Translate('Payer Id');
  297. $this->txtPayerId->Text = $this->objPaypalTransaction->PayerId;
  298. $this->txtPayerId->MaxLength = PaypalTransaction::PayerIdMaxLength;
  299. return $this->txtPayerId;
  300. }
  301. /**
  302. * Create and setup QLabel lblPayerId
  303. * @param string $strControlId optional ControlId to use
  304. * @return QLabel
  305. */
  306. public function lblPayerId_Create($strControlId = null) {
  307. $this->lblPayerId = new QLabel($this->objParentObject, $strControlId);
  308. $this->lblPayerId->Name = QApplication::Translate('Payer Id');
  309. $this->lblPayerId->Text = $this->objPaypalTransaction->PayerId;
  310. return $this->lblPayerId;
  311. }
  312. /**
  313. * Create and setup QTextBox txtPayerStatus
  314. * @param string $strControlId optional ControlId to use
  315. * @return QTextBox
  316. */
  317. public function txtPayerStatus_Create($strControlId = null) {
  318. $this->txtPayerStatus = new QTextBox($this->objParentObject, $strControlId);
  319. $this->txtPayerStatus->Name = QApplication::Translate('Payer Status');
  320. $this->txtPayerStatus->Text = $this->objPaypalTransaction->PayerStatus;
  321. $this->txtPayerStatus->MaxLength = PaypalTransaction::PayerStatusMaxLength;
  322. return $this->txtPayerStatus;
  323. }
  324. /**
  325. * Create and setup QLabel lblPayerStatus
  326. * @param string $strControlId optional ControlId to use
  327. * @return QLabel
  328. */
  329. public function lblPayerStatus_Create($strControlId = null) {
  330. $this->lblPayerStatus = new QLabel($this->objParentObject, $strControlId);
  331. $this->lblPayerStatus->Name = QApplication::Translate('Payer Status');
  332. $this->lblPayerStatus->Text = $this->objPaypalTransaction->PayerStatus;
  333. return $this->lblPayerStatus;
  334. }
  335. /**
  336. * Create and setup QTextBox txtPaymentStatus
  337. * @param string $strControlId optional ControlId to use
  338. * @return QTextBox
  339. */
  340. public function txtPaymentStatus_Create($strControlId = null) {
  341. $this->txtPaymentStatus = new QTextBox($this->objParentObject, $strControlId);
  342. $this->txtPaymentStatus->Name = QApplication::Translate('Payment Status');
  343. $this->txtPaymentStatus->Text = $this->objPaypalTransaction->PaymentStatus;
  344. $this->txtPaymentStatus->MaxLength = PaypalTransaction::PaymentStatusMaxLength;
  345. return $this->txtPaymentStatus;
  346. }
  347. /**
  348. * Create and setup QLabel lblPaymentStatus
  349. * @param string $strControlId optional ControlId to use
  350. * @return QLabel
  351. */
  352. public function lblPaymentStatus_Create($strControlId = null) {
  353. $this->lblPaymentStatus = new QLabel($this->objParentObject, $strControlId);
  354. $this->lblPaymentStatus->Name = QApplication::Translate('Payment Status');
  355. $this->lblPaymentStatus->Text = $this->objPaypalTransaction->PaymentStatus;
  356. return $this->lblPaymentStatus;
  357. }
  358. /**
  359. * Create and setup QTextBox txtAckReturned
  360. * @param string $strControlId optional ControlId to use
  361. * @return QTextBox
  362. */
  363. public function txtAckReturned_Create($strControlId = null) {
  364. $this->txtAckReturned = new QTextBox($this->objParentObject, $strControlId);
  365. $this->txtAckReturned->Name = QApplication::Translate('Ack Returned');
  366. $this->txtAckReturned->Text = $this->objPaypalTransaction->AckReturned;
  367. $this->txtAckReturned->MaxLength = PaypalTransaction::AckReturnedMaxLength;
  368. return $this->txtAckReturned;
  369. }
  370. /**
  371. * Create and setup QLabel lblAckReturned
  372. * @param string $strControlId optional ControlId to use
  373. * @return QLabel
  374. */
  375. public function lblAckReturned_Create($strControlId = null) {
  376. $this->lblAckReturned = new QLabel($this->objParentObject, $strControlId);
  377. $this->lblAckReturned->Name = QApplication::Translate('Ack Returned');
  378. $this->lblAckReturned->Text = $this->objPaypalTransaction->AckReturned;
  379. return $this->lblAckReturned;
  380. }
  381. /**
  382. * Create and setup QTextBox txtApiAction
  383. * @param string $strControlId optional ControlId to use
  384. * @return QTextBox
  385. */
  386. public function txtApiAction_Create($strControlId = null) {
  387. $this->txtApiAction = new QTextBox($this->objParentObject, $strControlId);
  388. $this->txtApiAction->Name = QApplication::Translate('Api Action');
  389. $this->txtApiAction->Text = $this->objPaypalTransaction->ApiAction;
  390. $this->txtApiAction->MaxLength = PaypalTransaction::ApiActionMaxLength;
  391. return $this->txtApiAction;
  392. }
  393. /**
  394. * Create and setup QLabel lblApiAction
  395. * @param string $strControlId optional ControlId to use
  396. * @return QLabel
  397. */
  398. public function lblApiAction_Create($strControlId = null) {
  399. $this->lblApiAction = new QLabel($this->objParentObject, $strControlId);
  400. $this->lblApiAction->Name = QApplication::Translate('Api Action');
  401. $this->lblApiAction->Text = $this->objPaypalTransaction->ApiAction;
  402. return $this->lblApiAction;
  403. }
  404. /**
  405. * Create and setup QDateTimePicker calTimeStamp
  406. * @param string $strControlId optional ControlId to use
  407. * @return QDateTimePicker
  408. */
  409. public function calTimeStamp_Create($strControlId = null) {
  410. $this->calTimeStamp = new QDateTimePicker($this->objParentObject, $strControlId);
  411. $this->calTimeStamp->Name = QApplication::Translate('Time Stamp');
  412. $this->calTimeStamp->DateTime = $this->objPaypalTransaction->TimeStamp;
  413. $this->calTimeStamp->DateTimePickerType = QDateTimePickerType::DateTime;
  414. return $this->calTimeStamp;
  415. }
  416. /**
  417. * Create and setup QLabel lblTimeStamp
  418. * @param string $strControlId optional ControlId to use
  419. * @param string $strDateTimeFormat optional DateTimeFormat to use
  420. * @return QLabel
  421. */
  422. public function lblTimeStamp_Create($strControlId = null, $strDateTimeFormat = null) {
  423. $this->lblTimeStamp = new QLabel($this->objParentObject, $strControlId);
  424. $this->lblTimeStamp->Name = QApplication::Translate('Time Stamp');
  425. $this->strTimeStampDateTimeFormat = $strDateTimeFormat;
  426. $this->lblTimeStamp->Text = $this->objPaypalTransaction->TimeStamp->__toString($strDateTimeFormat);
  427. return $this->lblTimeStamp;
  428. }
  429. protected $strTimeStampDateTimeFormat;
  430. /**
  431. * Create and setup QTextBox txtApiVersion
  432. * @param string $strControlId optional ControlId to use
  433. * @return QTextBox
  434. */
  435. public function txtApiVersion_Create($strControlId = null) {
  436. $this->txtApiVersion = new QTextBox($this->objParentObject, $strControlId);
  437. $this->txtApiVersion->Name = QApplication::Translate('Api Version');
  438. $this->txtApiVersion->Text = $this->objPaypalTransaction->ApiVersion;
  439. $this->txtApiVersion->MaxLength = PaypalTransaction::ApiVersionMaxLength;
  440. return $this->txtApiVersion;
  441. }
  442. /**
  443. * Create and setup QLabel lblApiVersion
  444. * @param string $strControlId optional ControlId to use
  445. * @return QLabel
  446. */
  447. public function lblApiVersion_Create($strControlId = null) {
  448. $this->lblApiVersion = new QLabel($this->objParentObject, $strControlId);
  449. $this->lblApiVersion->Name = QApplication::Translate('Api Version');
  450. $this->lblApiVersion->Text = $this->objPaypalTransaction->ApiVersion;
  451. return $this->lblApiVersion;
  452. }
  453. /**
  454. * Create and setup QTextBox txtMessages
  455. * @param string $strControlId optional ControlId to use
  456. * @return QTextBox
  457. */
  458. public function txtMessages_Create($strControlId = null) {
  459. $this->txtMessages = new QTextBox($this->objParentObject, $strControlId);
  460. $this->txtMessages->Name = QApplication::Translate('Messages');
  461. $this->txtMessages->Text = $this->objPaypalTransaction->Messages;
  462. $this->txtMessages->TextMode = QTextMode::MultiLine;
  463. return $this->txtMessages;
  464. }
  465. /**
  466. * Create and setup QLabel lblMessages
  467. * @param string $strControlId optional ControlId to use
  468. * @return QLabel
  469. */
  470. public function lblMessages_Create($strControlId = null) {
  471. $this->lblMessages = new QLabel($this->objParentObject, $strControlId);
  472. $this->lblMessages->Name = QApplication::Translate('Messages');
  473. $this->lblMessages->Text = $this->objPaypalTransaction->Messages;
  474. return $this->lblMessages;
  475. }
  476. /**
  477. * Create and setup QFloatTextBox txtAmount
  478. * @param string $strControlId optional ControlId to use
  479. * @return QFloatTextBox
  480. */
  481. public function txtAmount_Create($strControlId = null) {
  482. $this->txtAmount = new QFloatTextBox($this->objParentObject, $strControlId);
  483. $this->txtAmount->Name = QApplication::Translate('Amount');
  484. $this->txtAmount->Text = $this->objPaypalTransaction->Amount;
  485. return $this->txtAmount;
  486. }
  487. /**
  488. * Create and setup QLabel lblAmount
  489. * @param string $strControlId optional ControlId to use
  490. * @param string $strFormat optional sprintf format to use
  491. * @return QLabel
  492. */
  493. public function lblAmount_Create($strControlId = null, $strFormat = null) {
  494. $this->lblAmount = new QLabel($this->objParentObject, $strControlId);
  495. $this->lblAmount->Name = QApplication::Translate('Amount');
  496. $this->lblAmount->Text = $this->objPaypalTransaction->Amount;
  497. $this->lblAmount->Format = $strFormat;
  498. return $this->lblAmount;
  499. }
  500. /**
  501. * Create and setup QFloatTextBox txtPpFee
  502. * @param string $strControlId optional ControlId to use
  503. * @return QFloatTextBox
  504. */
  505. public function txtPpFee_Create($strControlId = null) {
  506. $this->txtPpFee = new QFloatTextBox($this->objParentObject, $strControlId);
  507. $this->txtPpFee->Name = QApplication::Translate('Pp Fee');
  508. $this->txtPpFee->Text = $this->objPaypalTransaction->PpFee;
  509. return $this->txtPpFee;
  510. }
  511. /**
  512. * Create and setup QLabel lblPpFee
  513. * @param string $strControlId optional ControlId to use
  514. * @param string $strFormat optional sprintf format to use
  515. * @return QLabel
  516. */
  517. public function lblPpFee_Create($strControlId = null, $strFormat = null) {
  518. $this->lblPpFee = new QLabel($this->objParentObject, $strControlId);
  519. $this->lblPpFee->Name = QApplication::Translate('Pp Fee');
  520. $this->lblPpFee->Text = $this->objPaypalTransaction->PpFee;
  521. $this->lblPpFee->Format = $strFormat;
  522. return $this->lblPpFee;
  523. }
  524. /**
  525. * Create and setup QIntegerTextBox txtPaymentMethodId
  526. * @param string $strControlId optional ControlId to use
  527. * @return QIntegerTextBox
  528. */
  529. public function txtPaymentMethodId_Create($strControlId = null) {
  530. $this->txtPaymentMethodId = new QIntegerTextBox($this->objParentObject, $strControlId);
  531. $this->txtPaymentMethodId->Name = QApplication::Translate('Payment Method Id');
  532. $this->txtPaymentMethodId->Text = $this->objPaypalTransaction->PaymentMethodId;
  533. $this->txtPaymentMethodId->Required = true;
  534. return $this->txtPaymentMethodId;
  535. }
  536. /**
  537. * Create and setup QLabel lblPaymentMethodId
  538. * @param string $strControlId optional ControlId to use
  539. * @param string $strFormat optional sprintf format to use
  540. * @return QLabel
  541. */
  542. public function lblPaymentMethodId_Create($strControlId = null, $strFormat = null) {
  543. $this->lblPaymentMethodId = new QLabel($this->objParentObject, $strControlId);
  544. $this->lblPaymentMethodId->Name = QApplication::Translate('Payment Method Id');
  545. $this->lblPaymentMethodId->Text = $this->objPaypalTransaction->PaymentMethodId;
  546. $this->lblPaymentMethodId->Required = true;
  547. $this->lblPaymentMethodId->Format = $strFormat;
  548. return $this->lblPaymentMethodId;
  549. }
  550. /**
  551. * Refresh this MetaControl with Data from the local PaypalTransaction object.
  552. * @param boolean $blnReload reload PaypalTransaction from the database
  553. * @return void
  554. */
  555. public function Refresh($blnReload = false) {
  556. if ($blnReload)
  557. $this->objPaypalTransaction->Reload();
  558. if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objPaypalTransaction->Id;
  559. if ($this->lstOrder) {
  560. $this->lstOrder->RemoveAllItems();
  561. if (!$this->blnEditMode)
  562. $this->lstOrder->AddItem(QApplication::Translate('- Select One -'), null);
  563. $objOrderArray = Order::LoadAll();
  564. if ($objOrderArray) foreach ($objOrderArray as $objOrder) {
  565. $objListItem = new QListItem($objOrder->__toString(), $objOrder->Id);
  566. if (($this->objPaypalTransaction->Order) && ($this->objPaypalTransaction->Order->Id == $objOrder->Id))
  567. $objListItem->Selected = true;
  568. $this->lstOrder->AddItem($objListItem);
  569. }
  570. }
  571. if ($this->lblOrderId) $this->lblOrderId->Text = ($this->objPaypalTransaction->Order) ? $this->objPaypalTransaction->Order->__toString() : null;
  572. if ($this->txtCorrelationId) $this->txtCorrelationId->Text = $this->objPaypalTransaction->CorrelationId;
  573. if ($this->lblCorrelationId) $this->lblCorrelationId->Text = $this->objPaypalTransaction->CorrelationId;
  574. if ($this->txtTransactionId) $this->txtTransactionId->Text = $this->objPaypalTransaction->TransactionId;
  575. if ($this->lblTransactionId) $this->lblTransactionId->Text = $this->objPaypalTransaction->TransactionId;
  576. if ($this->txtPpToken) $this->txtPpToken->Text = $this->objPaypalTransaction->PpToken;
  577. if ($this->lblPpToken) $this->lblPpToken->Text = $this->objPaypalTransaction->PpToken;
  578. if ($this->txtPayerId) $this->txtPayerId->Text = $this->objPaypalTransaction->PayerId;
  579. if ($this->lblPayerId) $this->lblPayerId->Text = $this->objPaypalTransaction->PayerId;
  580. if ($this->txtPayerStatus) $this->txtPayerStatus->Text = $this->objPaypalTransaction->PayerStatus;
  581. if ($this->lblPayerStatus) $this->lblPayerStatus->Text = $this->objPaypalTransaction->PayerStatus;
  582. if ($this->txtPaymentStatus) $this->txtPaymentStatus->Text = $this->objPaypalTransaction->PaymentStatus;
  583. if ($this->lblPaymentStatus) $this->lblPaymentStatus->Text = $this->objPaypalTransaction->PaymentStatus;
  584. if ($this->txtAckReturned) $this->txtAckReturned->Text = $this->objPaypalTransaction->AckReturned;
  585. if ($this->lblAckReturned) $this->lblAckReturned->Text = $this->objPaypalTransaction->AckReturned;
  586. if ($this->txtApiAction) $this->txtApiAction->Text = $this->objPaypalTransaction->ApiAction;
  587. if ($this->lblApiAction) $this->lblApiAction->Text = $this->objPaypalTransaction->ApiAction;
  588. if ($this->calTimeStamp) $this->calTimeStamp->DateTime = $this->objPaypalTransaction->TimeStamp;
  589. if ($this->lblTimeStamp) $this->lblTimeStamp->Text = $this->objPaypalTransaction->TimeStamp->__toString($this->strTimeStampDateTimeFormat);
  590. if ($this->txtApiVersion) $this->txtApiVersion->Text = $this->objPaypalTransaction->ApiVersion;
  591. if ($this->lblApiVersion) $this->lblApiVersion->Text = $this->objPaypalTransaction->ApiVersion;
  592. if ($this->txtMessages) $this->txtMessages->Text = $this->objPaypalTransaction->Messages;
  593. if ($this->lblMessages) $this->lblMessages->Text = $this->objPaypalTransaction->Messages;
  594. if ($this->txtAmount) $this->txtAmount->Text = $this->objPaypalTransaction->Amount;
  595. if ($this->lblAmount) $this->lblAmount->Text = $this->objPaypalTransaction->Amount;
  596. if ($this->txtPpFee) $this->txtPpFee->Text = $this->objPaypalTransaction->PpFee;
  597. if ($this->lblPpFee) $this->lblPpFee->Text = $this->objPaypalTransaction->PpFee;
  598. if ($this->txtPaymentMethodId) $this->txtPaymentMethodId->Text = $this->objPaypalTransaction->PaymentMethodId;
  599. if ($this->lblPaymentMethodId) $this->lblPaymentMethodId->Text = $this->objPaypalTransaction->PaymentMethodId;
  600. }
  601. ///////////////////////////////////////////////
  602. // PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
  603. ///////////////////////////////////////////////
  604. ///////////////////////////////////////////////
  605. // PUBLIC PAYPALTRANSACTION OBJECT MANIPULATORS
  606. ///////////////////////////////////////////////
  607. /**
  608. * This will save this object's PaypalTransaction instance,
  609. * updating only the fields which have had a control created for it.
  610. */
  611. public function SavePaypalTransaction() {
  612. try {
  613. // Update any fields for controls that have been created
  614. if ($this->lstOrder) $this->objPaypalTransaction->OrderId = $this->lstOrder->SelectedValue;
  615. if ($this->txtCorrelationId) $this->objPaypalTransaction->CorrelationId = $this->txtCorrelationId->Text;
  616. if ($this->txtTransactionId) $this->objPaypalTransaction->TransactionId = $this->txtTransactionId->Text;
  617. if ($this->txtPpToken) $this->objPaypalTransaction->PpToken = $this->txtPpToken->Text;
  618. if ($this->txtPayerId) $this->objPaypalTransaction->PayerId = $this->txtPayerId->Text;
  619. if ($this->txtPayerStatus) $this->objPaypalTransaction->PayerStatus = $this->txtPayerStatus->Text;
  620. if ($this->txtPaymentStatus) $this->objPaypalTransaction->PaymentStatus = $this->txtPaymentStatus->Text;
  621. if ($this->txtAckReturned) $this->objPaypalTransaction->AckReturned = $this->txtAckReturned->Text;
  622. if ($this->txtApiAction) $this->objPaypalTransaction->ApiAction = $this->txtApiAction->Text;
  623. if ($this->calTimeStamp) $this->objPaypalTransaction->TimeStamp = $this->calTimeStamp->DateTime;
  624. if ($this->txtApiVersion) $this->objPaypalTransaction->ApiVersion = $this->txtApiVersion->Text;
  625. if ($this->txtMessages) $this->objPaypalTransaction->Messages = $this->txtMessages->Text;
  626. if ($this->txtAmount) $this->objPaypalTransaction->Amount = $this->txtAmount->Text;
  627. if ($this->txtPpFee) $this->objPaypalTransaction->PpFee = $this->txtPpFee->Text;
  628. if ($this->txtPaymentMethodId) $this->objPaypalTransaction->PaymentMethodId = $this->txtPaymentMethodId->Text;
  629. // Update any UniqueReverseReferences (if any) for controls that have been created for it
  630. // Save the PaypalTransaction object
  631. $this->objPaypalTransaction->Save();
  632. // Finally, update any ManyToManyReferences (if any)
  633. } catch (QCallerException $objExc) {
  634. $objExc->IncrementOffset();
  635. throw $objExc;
  636. }
  637. }
  638. /**
  639. * This will DELETE this object's PaypalTransaction instance from the database.
  640. * It will also unassociate itself from any ManyToManyReferences.
  641. */
  642. public function DeletePaypalTransaction() {
  643. $this->objPaypalTransaction->Delete();
  644. }
  645. ///////////////////////////////////////////////
  646. // PUBLIC GETTERS and SETTERS
  647. ///////////////////////////////////////////////
  648. /**
  649. * Override method to perform a property "Get"
  650. * This will get the value of $strName
  651. *
  652. * @param string $strName Name of the property to get
  653. * @return mixed
  654. */
  655. public function __get($strName) {
  656. switch ($strName) {
  657. // General MetaControlVariables
  658. case 'PaypalTransaction': return $this->objPaypalTransaction;
  659. case 'TitleVerb': return $this->strTitleVerb;
  660. case 'EditMode': return $this->blnEditMode;
  661. // Controls that point to PaypalTransaction fields -- will be created dynamically if not yet created
  662. case 'IdControl':
  663. if (!$this->lblId) return $this->lblId_Create();
  664. return $this->lblId;
  665. case 'IdLabel':
  666. if (!$this->lblId) return $this->lblId_Create();
  667. return $this->lblId;
  668. case 'OrderIdControl':
  669. if (!$this->lstOrder) return $this->lstOrder_Create();
  670. return $this->lstOrder;
  671. case 'OrderIdLabel':
  672. if (!$this->lblOrderId) return $this->lblOrderId_Create();
  673. return $this->lblOrderId;
  674. case 'CorrelationIdControl':
  675. if (!$this->txtCorrelationId) return $this->txtCorrelationId_Create();
  676. return $this->txtCorrelationId;
  677. case 'CorrelationIdLabel':
  678. if (!$this->lblCorrelationId) return $this->lblCorrelationId_Create();
  679. return $this->lblCorrelationId;
  680. case 'TransactionIdControl':
  681. if (!$this->txtTransactionId) return $this->txtTransactionId_Create();
  682. return $this->txtTransactionId;
  683. case 'TransactionIdLabel':
  684. if (!$this->lblTransactionId) return $this->lblTransactionId_Create();
  685. return $this->lblTransactionId;
  686. case 'PpTokenControl':
  687. if (!$this->txtPpToken) return $this->txtPpToken_Create();
  688. return $this->txtPpToken;
  689. case 'PpTokenLabel':
  690. if (!$this->lblPpToken) return $this->lblPpToken_Create();
  691. return $this->lblPpToken;
  692. case 'PayerIdControl':
  693. if (!$this->txtPayerId) return $this->txtPayerId_Create();
  694. return $this->txtPayerId;
  695. case 'PayerIdLabel':
  696. if (!$this->lblPayerId) return $this->lblPayerId_Create();
  697. return $this->lblPayerId;
  698. case 'PayerStatusControl':
  699. if (!$this->txtPayerStatus) return $this->txtPayerStatus_Create();
  700. return $this->txtPayerStatus;
  701. case 'PayerStatusLabel':
  702. if (!$this->lblPayerStatus) return $this->lblPayerStatus_Create();
  703. return $this->lblPayerStatus;
  704. case 'PaymentStatusControl':
  705. if (!$this->txtPaymentStatus) return $this->txtPaymentStatus_Create();
  706. return $this->txtPaymentStatus;
  707. case 'PaymentStatusLabel':
  708. if (!$this->lblPaymentStatus) return $this->lblPaymentStatus_Create();
  709. return $this->lblPaymentStatus;
  710. case 'AckReturnedControl':
  711. if (!$this->txtAckReturned) return $this->txtAckReturned_Create();
  712. return $this->txtAckReturned;
  713. case 'AckReturnedLabel':
  714. if (!$this->lblAckReturned) return $this->lblAckReturned_Create();
  715. return $this->lblAckReturned;
  716. case 'ApiActionControl':
  717. if (!$this->txtApiAction) return $this->txtApiAction_Create();
  718. return $this->txtApiAction;
  719. case 'ApiActionLabel':
  720. if (!$this->lblApiAction) return $this->lblApiAction_Create();
  721. return $this->lblApiAction;
  722. case 'TimeStampControl':
  723. if (!$this->calTimeStamp) return $this->calTimeStamp_Create();
  724. return $this->calTimeStamp;
  725. case 'TimeStampLabel':
  726. if (!$this->lblTimeStamp) return $this->lblTimeStamp_Create();
  727. return $this->lblTimeStamp;
  728. case 'ApiVersionControl':
  729. if (!$this->txtApiVersion) return $this->txtApiVersion_Create();
  730. return $this->txtApiVersion;
  731. case 'ApiVersionLabel':
  732. if (!$this->lblApiVersion) return $this->lblApiVersion_Create();
  733. return $this->lblApiVersion;
  734. case 'MessagesControl':
  735. if (!$this->txtMessages) return $this->txtMessages_Create();
  736. return $this->txtMessages;
  737. case 'MessagesLabel':
  738. if (!$this->lblMessages) return $this->lblMessages_Create();
  739. return $this->lblMessages;
  740. case 'AmountControl':
  741. if (!$this->txtAmount) return $this->txtAmount_Create();
  742. return $this->txtAmount;
  743. case 'AmountLabel':
  744. if (!$this->lblAmount) return $this->lblAmount_Create();
  745. return $this->lblAmount;
  746. case 'PpFeeControl':
  747. if (!$this->txtPpFee) return $this->txtPpFee_Create();
  748. return $this->txtPpFee;
  749. case 'PpFeeLabel':
  750. if (!$this->lblPpFee) return $this->lblPpFee_Create();
  751. return $this->lblPpFee;
  752. case 'PaymentMethodIdControl':
  753. if (!$this->txtPaymentMethodId) return $this->txtPaymentMethodId_Create();
  754. return $this->txtPaymentMethodId;
  755. case 'PaymentMethodIdLabel':
  756. if (!$this->lblPaymentMethodId) return $this->lblPaymentMethodId_Create();
  757. return $this->lblPaymentMethodId;
  758. default:
  759. try {
  760. return parent::__get($strName);
  761. } catch (QCallerException $objExc) {
  762. $objExc->IncrementOffset();
  763. throw $objExc;
  764. }
  765. }
  766. }
  767. /**
  768. * Override method to perform a property "Set"
  769. * This will set the property $strName to be $mixValue
  770. *
  771. * @param string $strName Name of the property to set
  772. * @param string $mixValue New value of the property
  773. * @return mixed
  774. */
  775. public function __set($strName, $mixValue) {
  776. try {
  777. switch ($strName) {
  778. // Controls that point to PaypalTransaction fields
  779. case 'IdControl':
  780. return ($this->lblId = QType::Cast($mixValue, 'QControl'));
  781. case 'OrderIdControl':
  782. return ($this->lstOrder = QType::Cast($mixValue, 'QControl'));
  783. case 'CorrelationIdControl':
  784. return ($this->txtCorrelationId = QType::Cast($mixValue, 'QControl'));
  785. case 'TransactionIdControl':
  786. return ($this->txtTransactionId = QType::Cast($mixValue, 'QControl'));
  787. case 'PpTokenControl':
  788. return ($this->txtPpToken = QType::Cast($mixValue, 'QControl'));
  789. case 'PayerIdControl':
  790. return ($this->txtPayerId = QType::Cast($mixValue, 'QControl'));
  791. case 'PayerStatusControl':
  792. return ($this->txtPayerStatus = QType::Cast($mixValue, 'QControl'));
  793. case 'PaymentStatusControl':
  794. return ($this->txtPaymentStatus = QType::Cast($mixValue, 'QControl'));
  795. case 'AckReturnedControl':
  796. return ($this->txtAckReturned = QType::Cast($mixValue, 'QControl'));
  797. case 'ApiActionControl':
  798. return ($this->txtApiAction = QType::Cast($mixValue, 'QControl'));
  799. case 'TimeStampControl':
  800. return ($this->calTimeStamp = QType::Cast($mixValue, 'QControl'));
  801. case 'ApiVersionControl':
  802. return ($this->txtApiVersion = QType::Cast($mixValue, 'QControl'));
  803. case 'MessagesControl':
  804. return ($this->txtMessages = QType::Cast($mixValue, 'QControl'));
  805. case 'AmountControl':
  806. return ($this->txtAmount = QType::Cast($mixValue, 'QControl'));
  807. case 'PpFeeControl':
  808. return ($this->txtPpFee = QType::Cast($mixValue, 'QControl'));
  809. case 'PaymentMethodIdControl':
  810. return ($this->txtPaymentMethodId = QType::Cast($mixValue, 'QControl'));
  811. default:
  812. return parent::__set($strName, $mixValue);
  813. }
  814. } catch (QCallerException $objExc) {
  815. $objExc->IncrementOffset();
  816. throw $objExc;
  817. }
  818. }
  819. }
  820. ?>