/** * Default / simple DataBinder for this Meta DataGrid. This can easily be overridden * by calling SetDataBinder() on this DataGrid with another DataBinder of your choice. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). */ public function MetaDataBinder() { // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = Articlecategory::CountAll(); } // Setup the $objClauses Array $objClauses = array(); // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from Articlecategory, given the clauses above $this->DataSource = Articlecategory::LoadAll($objClauses); }
private function lstSearchIndex_Create() { $this->lstSearchIndex = new QListBox($this); $this->lstSearchIndex->Name = QApplication::Translate('Search Index'); $this->lstSearchIndex->AddItem(QApplication::Translate('- Select One -'), null); $objArticleCategoryObjectArray = Articlecategory::LoadAll(); if ($objArticleCategoryObjectArray) { foreach ($objArticleCategoryObjectArray as $objArticleCategoryObject) { $objListItem = new QListItem($objArticleCategoryObject->__toString(), $objArticleCategoryObject->Id); $this->lstSearchIndex->AddItem($objListItem, $objArticleCategoryObject->Id); } } }
/** * Refresh this MetaControl with Data from the local Articlecore object. * @param boolean $blnReload reload Articlecore from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objArticlecore->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objArticlecore->Id; } } if ($this->txtAsin) { $this->txtAsin->Text = $this->objArticlecore->Asin; } if ($this->lblAsin) { $this->lblAsin->Text = $this->objArticlecore->Asin; } if ($this->txtDetailPageURL) { $this->txtDetailPageURL->Text = $this->objArticlecore->DetailPageURL; } if ($this->lblDetailPageURL) { $this->lblDetailPageURL->Text = $this->objArticlecore->DetailPageURL; } if ($this->txtBinding) { $this->txtBinding->Text = $this->objArticlecore->Binding; } if ($this->lblBinding) { $this->lblBinding->Text = $this->objArticlecore->Binding; } if ($this->txtTitle) { $this->txtTitle->Text = $this->objArticlecore->Title; } if ($this->lblTitle) { $this->lblTitle->Text = $this->objArticlecore->Title; } if ($this->lstProductGroupObject) { $this->lstProductGroupObject->RemoveAllItems(); $this->lstProductGroupObject->AddItem(QApplication::Translate('- Select One -'), null); $objProductGroupObjectArray = Articlecategory::LoadAll(); if ($objProductGroupObjectArray) { foreach ($objProductGroupObjectArray as $objProductGroupObject) { $objListItem = new QListItem($objProductGroupObject->__toString(), $objProductGroupObject->Id); if ($this->objArticlecore->ProductGroupObject && $this->objArticlecore->ProductGroupObject->Id == $objProductGroupObject->Id) { $objListItem->Selected = true; } $this->lstProductGroupObject->AddItem($objListItem); } } } if ($this->lblProductGroup) { $this->lblProductGroup->Text = $this->objArticlecore->ProductGroupObject ? $this->objArticlecore->ProductGroupObject->__toString() : null; } if ($this->txtImageURL) { $this->txtImageURL->Text = $this->objArticlecore->ImageURL; } if ($this->lblImageURL) { $this->lblImageURL->Text = $this->objArticlecore->ImageURL; } }