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.

616 lines
28 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 ProductImage 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 ProductImage 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 ProductImageMetaControl
  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 ProductImage $ProductImage the actual ProductImage data class being edited
  19. * property QLabel $IdControl
  20. * property-read QLabel $IdLabel
  21. * property QListBox $ProductIdControl
  22. * property-read QLabel $ProductIdLabel
  23. * property QTextBox $TitleControl
  24. * property-read QLabel $TitleLabel
  25. * property QTextBox $AltTagControl
  26. * property-read QLabel $AltTagLabel
  27. * property QTextBox $DescriptionControl
  28. * property-read QLabel $DescriptionLabel
  29. * property QTextBox $UriControl
  30. * property-read QLabel $UriLabel
  31. * property QIntegerTextBox $XSizeControl
  32. * property-read QLabel $XSizeLabel
  33. * property QIntegerTextBox $YSizeControl
  34. * property-read QLabel $YSizeLabel
  35. * property QListBox $SizeTypeControl
  36. * property-read QLabel $SizeTypeLabel
  37. * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
  38. * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
  39. */
  40. class ProductImageMetaControlGen extends QBaseClass {
  41. // General Variables
  42. protected $objProductImage;
  43. protected $objParentObject;
  44. protected $strTitleVerb;
  45. protected $blnEditMode;
  46. // Controls that allow the editing of ProductImage's individual data fields
  47. protected $lblId;
  48. protected $lstProduct;
  49. protected $txtTitle;
  50. protected $txtAltTag;
  51. protected $txtDescription;
  52. protected $txtUri;
  53. protected $txtXSize;
  54. protected $txtYSize;
  55. protected $lstSizeTypeObject;
  56. // Controls that allow the viewing of ProductImage's individual data fields
  57. protected $lblProductId;
  58. protected $lblTitle;
  59. protected $lblAltTag;
  60. protected $lblDescription;
  61. protected $lblUri;
  62. protected $lblXSize;
  63. protected $lblYSize;
  64. protected $lblSizeType;
  65. // QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References
  66. // QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References
  67. /**
  68. * Main constructor. Constructor OR static create methods are designed to be called in either
  69. * a parent QPanel or the main QForm when wanting to create a
  70. * ProductImageMetaControl to edit a single ProductImage object within the
  71. * QPanel or QForm.
  72. *
  73. * This constructor takes in a single ProductImage object, while any of the static
  74. * create methods below can be used to construct based off of individual PK ID(s).
  75. *
  76. * @param mixed $objParentObject QForm or QPanel which will be using this ProductImageMetaControl
  77. * @param ProductImage $objProductImage new or existing ProductImage object
  78. */
  79. public function __construct($objParentObject, ProductImage $objProductImage) {
  80. // Setup Parent Object (e.g. QForm or QPanel which will be using this ProductImageMetaControl)
  81. $this->objParentObject = $objParentObject;
  82. // Setup linked ProductImage object
  83. $this->objProductImage = $objProductImage;
  84. // Figure out if we're Editing or Creating New
  85. if ($this->objProductImage->__Restored) {
  86. $this->strTitleVerb = QApplication::Translate('Edit');
  87. $this->blnEditMode = true;
  88. } else {
  89. $this->strTitleVerb = QApplication::Translate('Create');
  90. $this->blnEditMode = false;
  91. }
  92. }
  93. /**
  94. * Static Helper Method to Create using PK arguments
  95. * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  96. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  97. * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
  98. * edit, or if we are also allowed to create a new one, etc.
  99. *
  100. * @param mixed $objParentObject QForm or QPanel which will be using this ProductImageMetaControl
  101. * @param integer $intId primary key value
  102. * @param QMetaControlCreateType $intCreateType rules governing ProductImage object creation - defaults to CreateOrEdit
  103. * @return ProductImageMetaControl
  104. */
  105. public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  106. // Attempt to Load from PK Arguments
  107. if (strlen($intId)) {
  108. $objProductImage = ProductImage::Load($intId);
  109. // ProductImage was found -- return it!
  110. if ($objProductImage)
  111. return new ProductImageMetaControl($objParentObject, $objProductImage);
  112. // If CreateOnRecordNotFound not specified, throw an exception
  113. else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
  114. throw new QCallerException('Could not find a ProductImage object with PK arguments: ' . $intId);
  115. // If EditOnly is specified, throw an exception
  116. } else if ($intCreateType == QMetaControlCreateType::EditOnly)
  117. throw new QCallerException('No PK arguments specified');
  118. // If we are here, then we need to create a new record
  119. return new ProductImageMetaControl($objParentObject, new ProductImage());
  120. }
  121. /**
  122. * Static Helper Method to Create using PathInfo arguments
  123. *
  124. * @param mixed $objParentObject QForm or QPanel which will be using this ProductImageMetaControl
  125. * @param QMetaControlCreateType $intCreateType rules governing ProductImage object creation - defaults to CreateOrEdit
  126. * @return ProductImageMetaControl
  127. */
  128. public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  129. $intId = QApplication::PathInfo(0);
  130. return ProductImageMetaControl::Create($objParentObject, $intId, $intCreateType);
  131. }
  132. /**
  133. * Static Helper Method to Create using QueryString arguments
  134. *
  135. * @param mixed $objParentObject QForm or QPanel which will be using this ProductImageMetaControl
  136. * @param QMetaControlCreateType $intCreateType rules governing ProductImage object creation - defaults to CreateOrEdit
  137. * @return ProductImageMetaControl
  138. */
  139. public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  140. $intId = QApplication::QueryString('intId');
  141. return ProductImageMetaControl::Create($objParentObject, $intId, $intCreateType);
  142. }
  143. ///////////////////////////////////////////////
  144. // PUBLIC CREATE and REFRESH METHODS
  145. ///////////////////////////////////////////////
  146. /**
  147. * Create and setup QLabel lblId
  148. * @param string $strControlId optional ControlId to use
  149. * @return QLabel
  150. */
  151. public function lblId_Create($strControlId = null) {
  152. $this->lblId = new QLabel($this->objParentObject, $strControlId);
  153. $this->lblId->Name = QApplication::Translate('Id');
  154. if ($this->blnEditMode)
  155. $this->lblId->Text = $this->objProductImage->Id;
  156. else
  157. $this->lblId->Text = 'N/A';
  158. return $this->lblId;
  159. }
  160. /**
  161. * Create and setup QListBox lstProduct
  162. * @param string $strControlId optional ControlId to use
  163. * @return QListBox
  164. */
  165. public function lstProduct_Create($strControlId = null) {
  166. $this->lstProduct = new QListBox($this->objParentObject, $strControlId);
  167. $this->lstProduct->Name = QApplication::Translate('Product');
  168. $this->lstProduct->Required = true;
  169. if (!$this->blnEditMode)
  170. $this->lstProduct->AddItem(QApplication::Translate('- Select One -'), null);
  171. $objProductArray = Product::LoadAll();
  172. if ($objProductArray) foreach ($objProductArray as $objProduct) {
  173. $objListItem = new QListItem($objProduct->__toString(), $objProduct->Id);
  174. if (($this->objProductImage->Product) && ($this->objProductImage->Product->Id == $objProduct->Id))
  175. $objListItem->Selected = true;
  176. $this->lstProduct->AddItem($objListItem);
  177. }
  178. return $this->lstProduct;
  179. }
  180. /**
  181. * Create and setup QLabel lblProductId
  182. * @param string $strControlId optional ControlId to use
  183. * @return QLabel
  184. */
  185. public function lblProductId_Create($strControlId = null) {
  186. $this->lblProductId = new QLabel($this->objParentObject, $strControlId);
  187. $this->lblProductId->Name = QApplication::Translate('Product');
  188. $this->lblProductId->Text = ($this->objProductImage->Product) ? $this->objProductImage->Product->__toString() : null;
  189. $this->lblProductId->Required = true;
  190. return $this->lblProductId;
  191. }
  192. /**
  193. * Create and setup QTextBox txtTitle
  194. * @param string $strControlId optional ControlId to use
  195. * @return QTextBox
  196. */
  197. public function txtTitle_Create($strControlId = null) {
  198. $this->txtTitle = new QTextBox($this->objParentObject, $strControlId);
  199. $this->txtTitle->Name = QApplication::Translate('Title');
  200. $this->txtTitle->Text = $this->objProductImage->Title;
  201. $this->txtTitle->MaxLength = ProductImage::TitleMaxLength;
  202. return $this->txtTitle;
  203. }
  204. /**
  205. * Create and setup QLabel lblTitle
  206. * @param string $strControlId optional ControlId to use
  207. * @return QLabel
  208. */
  209. public function lblTitle_Create($strControlId = null) {
  210. $this->lblTitle = new QLabel($this->objParentObject, $strControlId);
  211. $this->lblTitle->Name = QApplication::Translate('Title');
  212. $this->lblTitle->Text = $this->objProductImage->Title;
  213. return $this->lblTitle;
  214. }
  215. /**
  216. * Create and setup QTextBox txtAltTag
  217. * @param string $strControlId optional ControlId to use
  218. * @return QTextBox
  219. */
  220. public function txtAltTag_Create($strControlId = null) {
  221. $this->txtAltTag = new QTextBox($this->objParentObject, $strControlId);
  222. $this->txtAltTag->Name = QApplication::Translate('Alt Tag');
  223. $this->txtAltTag->Text = $this->objProductImage->AltTag;
  224. $this->txtAltTag->MaxLength = ProductImage::AltTagMaxLength;
  225. return $this->txtAltTag;
  226. }
  227. /**
  228. * Create and setup QLabel lblAltTag
  229. * @param string $strControlId optional ControlId to use
  230. * @return QLabel
  231. */
  232. public function lblAltTag_Create($strControlId = null) {
  233. $this->lblAltTag = new QLabel($this->objParentObject, $strControlId);
  234. $this->lblAltTag->Name = QApplication::Translate('Alt Tag');
  235. $this->lblAltTag->Text = $this->objProductImage->AltTag;
  236. return $this->lblAltTag;
  237. }
  238. /**
  239. * Create and setup QTextBox txtDescription
  240. * @param string $strControlId optional ControlId to use
  241. * @return QTextBox
  242. */
  243. public function txtDescription_Create($strControlId = null) {
  244. $this->txtDescription = new QTextBox($this->objParentObject, $strControlId);
  245. $this->txtDescription->Name = QApplication::Translate('Description');
  246. $this->txtDescription->Text = $this->objProductImage->Description;
  247. $this->txtDescription->MaxLength = ProductImage::DescriptionMaxLength;
  248. return $this->txtDescription;
  249. }
  250. /**
  251. * Create and setup QLabel lblDescription
  252. * @param string $strControlId optional ControlId to use
  253. * @return QLabel
  254. */
  255. public function lblDescription_Create($strControlId = null) {
  256. $this->lblDescription = new QLabel($this->objParentObject, $strControlId);
  257. $this->lblDescription->Name = QApplication::Translate('Description');
  258. $this->lblDescription->Text = $this->objProductImage->Description;
  259. return $this->lblDescription;
  260. }
  261. /**
  262. * Create and setup QTextBox txtUri
  263. * @param string $strControlId optional ControlId to use
  264. * @return QTextBox
  265. */
  266. public function txtUri_Create($strControlId = null) {
  267. $this->txtUri = new QTextBox($this->objParentObject, $strControlId);
  268. $this->txtUri->Name = QApplication::Translate('Uri');
  269. $this->txtUri->Text = $this->objProductImage->Uri;
  270. $this->txtUri->MaxLength = ProductImage::UriMaxLength;
  271. return $this->txtUri;
  272. }
  273. /**
  274. * Create and setup QLabel lblUri
  275. * @param string $strControlId optional ControlId to use
  276. * @return QLabel
  277. */
  278. public function lblUri_Create($strControlId = null) {
  279. $this->lblUri = new QLabel($this->objParentObject, $strControlId);
  280. $this->lblUri->Name = QApplication::Translate('Uri');
  281. $this->lblUri->Text = $this->objProductImage->Uri;
  282. return $this->lblUri;
  283. }
  284. /**
  285. * Create and setup QIntegerTextBox txtXSize
  286. * @param string $strControlId optional ControlId to use
  287. * @return QIntegerTextBox
  288. */
  289. public function txtXSize_Create($strControlId = null) {
  290. $this->txtXSize = new QIntegerTextBox($this->objParentObject, $strControlId);
  291. $this->txtXSize->Name = QApplication::Translate('X Size');
  292. $this->txtXSize->Text = $this->objProductImage->XSize;
  293. return $this->txtXSize;
  294. }
  295. /**
  296. * Create and setup QLabel lblXSize
  297. * @param string $strControlId optional ControlId to use
  298. * @param string $strFormat optional sprintf format to use
  299. * @return QLabel
  300. */
  301. public function lblXSize_Create($strControlId = null, $strFormat = null) {
  302. $this->lblXSize = new QLabel($this->objParentObject, $strControlId);
  303. $this->lblXSize->Name = QApplication::Translate('X Size');
  304. $this->lblXSize->Text = $this->objProductImage->XSize;
  305. $this->lblXSize->Format = $strFormat;
  306. return $this->lblXSize;
  307. }
  308. /**
  309. * Create and setup QIntegerTextBox txtYSize
  310. * @param string $strControlId optional ControlId to use
  311. * @return QIntegerTextBox
  312. */
  313. public function txtYSize_Create($strControlId = null) {
  314. $this->txtYSize = new QIntegerTextBox($this->objParentObject, $strControlId);
  315. $this->txtYSize->Name = QApplication::Translate('Y Size');
  316. $this->txtYSize->Text = $this->objProductImage->YSize;
  317. return $this->txtYSize;
  318. }
  319. /**
  320. * Create and setup QLabel lblYSize
  321. * @param string $strControlId optional ControlId to use
  322. * @param string $strFormat optional sprintf format to use
  323. * @return QLabel
  324. */
  325. public function lblYSize_Create($strControlId = null, $strFormat = null) {
  326. $this->lblYSize = new QLabel($this->objParentObject, $strControlId);
  327. $this->lblYSize->Name = QApplication::Translate('Y Size');
  328. $this->lblYSize->Text = $this->objProductImage->YSize;
  329. $this->lblYSize->Format = $strFormat;
  330. return $this->lblYSize;
  331. }
  332. /**
  333. * Create and setup QListBox lstSizeTypeObject
  334. * @param string $strControlId optional ControlId to use
  335. * @return QListBox
  336. */
  337. public function lstSizeTypeObject_Create($strControlId = null) {
  338. $this->lstSizeTypeObject = new QListBox($this->objParentObject, $strControlId);
  339. $this->lstSizeTypeObject->Name = QApplication::Translate('Size Type Object');
  340. $this->lstSizeTypeObject->AddItem(QApplication::Translate('- Select One -'), null);
  341. foreach (ImageSizeType::$NameArray as $intId => $strValue)
  342. $this->lstSizeTypeObject->AddItem(new QListItem($strValue, $intId, $this->objProductImage->SizeType == $intId));
  343. return $this->lstSizeTypeObject;
  344. }
  345. /**
  346. * Create and setup QLabel lblSizeType
  347. * @param string $strControlId optional ControlId to use
  348. * @return QLabel
  349. */
  350. public function lblSizeType_Create($strControlId = null) {
  351. $this->lblSizeType = new QLabel($this->objParentObject, $strControlId);
  352. $this->lblSizeType->Name = QApplication::Translate('Size Type Object');
  353. $this->lblSizeType->Text = ($this->objProductImage->SizeType) ? ImageSizeType::$NameArray[$this->objProductImage->SizeType] : null;
  354. return $this->lblSizeType;
  355. }
  356. /**
  357. * Refresh this MetaControl with Data from the local ProductImage object.
  358. * @param boolean $blnReload reload ProductImage from the database
  359. * @return void
  360. */
  361. public function Refresh($blnReload = false) {
  362. if ($blnReload)
  363. $this->objProductImage->Reload();
  364. if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objProductImage->Id;
  365. if ($this->lstProduct) {
  366. $this->lstProduct->RemoveAllItems();
  367. if (!$this->blnEditMode)
  368. $this->lstProduct->AddItem(QApplication::Translate('- Select One -'), null);
  369. $objProductArray = Product::LoadAll();
  370. if ($objProductArray) foreach ($objProductArray as $objProduct) {
  371. $objListItem = new QListItem($objProduct->__toString(), $objProduct->Id);
  372. if (($this->objProductImage->Product) && ($this->objProductImage->Product->Id == $objProduct->Id))
  373. $objListItem->Selected = true;
  374. $this->lstProduct->AddItem($objListItem);
  375. }
  376. }
  377. if ($this->lblProductId) $this->lblProductId->Text = ($this->objProductImage->Product) ? $this->objProductImage->Product->__toString() : null;
  378. if ($this->txtTitle) $this->txtTitle->Text = $this->objProductImage->Title;
  379. if ($this->lblTitle) $this->lblTitle->Text = $this->objProductImage->Title;
  380. if ($this->txtAltTag) $this->txtAltTag->Text = $this->objProductImage->AltTag;
  381. if ($this->lblAltTag) $this->lblAltTag->Text = $this->objProductImage->AltTag;
  382. if ($this->txtDescription) $this->txtDescription->Text = $this->objProductImage->Description;
  383. if ($this->lblDescription) $this->lblDescription->Text = $this->objProductImage->Description;
  384. if ($this->txtUri) $this->txtUri->Text = $this->objProductImage->Uri;
  385. if ($this->lblUri) $this->lblUri->Text = $this->objProductImage->Uri;
  386. if ($this->txtXSize) $this->txtXSize->Text = $this->objProductImage->XSize;
  387. if ($this->lblXSize) $this->lblXSize->Text = $this->objProductImage->XSize;
  388. if ($this->txtYSize) $this->txtYSize->Text = $this->objProductImage->YSize;
  389. if ($this->lblYSize) $this->lblYSize->Text = $this->objProductImage->YSize;
  390. if ($this->lstSizeTypeObject) $this->lstSizeTypeObject->SelectedValue = $this->objProductImage->SizeType;
  391. if ($this->lblSizeType) $this->lblSizeType->Text = ($this->objProductImage->SizeType) ? ImageSizeType::$NameArray[$this->objProductImage->SizeType] : null;
  392. }
  393. ///////////////////////////////////////////////
  394. // PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
  395. ///////////////////////////////////////////////
  396. ///////////////////////////////////////////////
  397. // PUBLIC PRODUCTIMAGE OBJECT MANIPULATORS
  398. ///////////////////////////////////////////////
  399. /**
  400. * This will save this object's ProductImage instance,
  401. * updating only the fields which have had a control created for it.
  402. */
  403. public function SaveProductImage() {
  404. try {
  405. // Update any fields for controls that have been created
  406. if ($this->lstProduct) $this->objProductImage->ProductId = $this->lstProduct->SelectedValue;
  407. if ($this->txtTitle) $this->objProductImage->Title = $this->txtTitle->Text;
  408. if ($this->txtAltTag) $this->objProductImage->AltTag = $this->txtAltTag->Text;
  409. if ($this->txtDescription) $this->objProductImage->Description = $this->txtDescription->Text;
  410. if ($this->txtUri) $this->objProductImage->Uri = $this->txtUri->Text;
  411. if ($this->txtXSize) $this->objProductImage->XSize = $this->txtXSize->Text;
  412. if ($this->txtYSize) $this->objProductImage->YSize = $this->txtYSize->Text;
  413. if ($this->lstSizeTypeObject) $this->objProductImage->SizeType = $this->lstSizeTypeObject->SelectedValue;
  414. // Update any UniqueReverseReferences (if any) for controls that have been created for it
  415. // Save the ProductImage object
  416. $this->objProductImage->Save();
  417. // Finally, update any ManyToManyReferences (if any)
  418. } catch (QCallerException $objExc) {
  419. $objExc->IncrementOffset();
  420. throw $objExc;
  421. }
  422. }
  423. /**
  424. * This will DELETE this object's ProductImage instance from the database.
  425. * It will also unassociate itself from any ManyToManyReferences.
  426. */
  427. public function DeleteProductImage() {
  428. $this->objProductImage->Delete();
  429. }
  430. ///////////////////////////////////////////////
  431. // PUBLIC GETTERS and SETTERS
  432. ///////////////////////////////////////////////
  433. /**
  434. * Override method to perform a property "Get"
  435. * This will get the value of $strName
  436. *
  437. * @param string $strName Name of the property to get
  438. * @return mixed
  439. */
  440. public function __get($strName) {
  441. switch ($strName) {
  442. // General MetaControlVariables
  443. case 'ProductImage': return $this->objProductImage;
  444. case 'TitleVerb': return $this->strTitleVerb;
  445. case 'EditMode': return $this->blnEditMode;
  446. // Controls that point to ProductImage fields -- will be created dynamically if not yet created
  447. case 'IdControl':
  448. if (!$this->lblId) return $this->lblId_Create();
  449. return $this->lblId;
  450. case 'IdLabel':
  451. if (!$this->lblId) return $this->lblId_Create();
  452. return $this->lblId;
  453. case 'ProductIdControl':
  454. if (!$this->lstProduct) return $this->lstProduct_Create();
  455. return $this->lstProduct;
  456. case 'ProductIdLabel':
  457. if (!$this->lblProductId) return $this->lblProductId_Create();
  458. return $this->lblProductId;
  459. case 'TitleControl':
  460. if (!$this->txtTitle) return $this->txtTitle_Create();
  461. return $this->txtTitle;
  462. case 'TitleLabel':
  463. if (!$this->lblTitle) return $this->lblTitle_Create();
  464. return $this->lblTitle;
  465. case 'AltTagControl':
  466. if (!$this->txtAltTag) return $this->txtAltTag_Create();
  467. return $this->txtAltTag;
  468. case 'AltTagLabel':
  469. if (!$this->lblAltTag) return $this->lblAltTag_Create();
  470. return $this->lblAltTag;
  471. case 'DescriptionControl':
  472. if (!$this->txtDescription) return $this->txtDescription_Create();
  473. return $this->txtDescription;
  474. case 'DescriptionLabel':
  475. if (!$this->lblDescription) return $this->lblDescription_Create();
  476. return $this->lblDescription;
  477. case 'UriControl':
  478. if (!$this->txtUri) return $this->txtUri_Create();
  479. return $this->txtUri;
  480. case 'UriLabel':
  481. if (!$this->lblUri) return $this->lblUri_Create();
  482. return $this->lblUri;
  483. case 'XSizeControl':
  484. if (!$this->txtXSize) return $this->txtXSize_Create();
  485. return $this->txtXSize;
  486. case 'XSizeLabel':
  487. if (!$this->lblXSize) return $this->lblXSize_Create();
  488. return $this->lblXSize;
  489. case 'YSizeControl':
  490. if (!$this->txtYSize) return $this->txtYSize_Create();
  491. return $this->txtYSize;
  492. case 'YSizeLabel':
  493. if (!$this->lblYSize) return $this->lblYSize_Create();
  494. return $this->lblYSize;
  495. case 'SizeTypeControl':
  496. if (!$this->lstSizeTypeObject) return $this->lstSizeTypeObject_Create();
  497. return $this->lstSizeTypeObject;
  498. case 'SizeTypeLabel':
  499. if (!$this->lblSizeType) return $this->lblSizeType_Create();
  500. return $this->lblSizeType;
  501. default:
  502. try {
  503. return parent::__get($strName);
  504. } catch (QCallerException $objExc) {
  505. $objExc->IncrementOffset();
  506. throw $objExc;
  507. }
  508. }
  509. }
  510. /**
  511. * Override method to perform a property "Set"
  512. * This will set the property $strName to be $mixValue
  513. *
  514. * @param string $strName Name of the property to set
  515. * @param string $mixValue New value of the property
  516. * @return mixed
  517. */
  518. public function __set($strName, $mixValue) {
  519. try {
  520. switch ($strName) {
  521. // Controls that point to ProductImage fields
  522. case 'IdControl':
  523. return ($this->lblId = QType::Cast($mixValue, 'QControl'));
  524. case 'ProductIdControl':
  525. return ($this->lstProduct = QType::Cast($mixValue, 'QControl'));
  526. case 'TitleControl':
  527. return ($this->txtTitle = QType::Cast($mixValue, 'QControl'));
  528. case 'AltTagControl':
  529. return ($this->txtAltTag = QType::Cast($mixValue, 'QControl'));
  530. case 'DescriptionControl':
  531. return ($this->txtDescription = QType::Cast($mixValue, 'QControl'));
  532. case 'UriControl':
  533. return ($this->txtUri = QType::Cast($mixValue, 'QControl'));
  534. case 'XSizeControl':
  535. return ($this->txtXSize = QType::Cast($mixValue, 'QControl'));
  536. case 'YSizeControl':
  537. return ($this->txtYSize = QType::Cast($mixValue, 'QControl'));
  538. case 'SizeTypeControl':
  539. return ($this->lstSizeTypeObject = QType::Cast($mixValue, 'QControl'));
  540. default:
  541. return parent::__set($strName, $mixValue);
  542. }
  543. } catch (QCallerException $objExc) {
  544. $objExc->IncrementOffset();
  545. throw $objExc;
  546. }
  547. }
  548. }
  549. ?>