function category_unique_title($str) { $this->form_validation->set_message('category_unique_title', 'Es existier bereits eine Kategorie mit diesem Titel.'); $articlecategory = new Articlecategory(); $articlecategory->where('title', $str)->get(); if ($articlecategory->exists()) { return FALSE; } return TRUE; }
/** * Create and setup QListBox lstReferenceIdObject * @param string $strControlId optional ControlId to use * @return QListBox */ public function lstReferenceIDObject_Create($strControlId = null) { $this->lstReferenceIDObject = new QListBox($this->objParentObject, $strControlId); $this->lstReferenceIDObject->Name = QApplication::Translate('Reference Id Object'); $this->lstReferenceIDObject->Required = true; if (!$this->blnEditMode) { $this->lstReferenceIDObject->AddItem(QApplication::Translate('- Select One -'), null); } $productgroupid = Articlecategory::QuerySingle(QQ::Equal(QQN::Articlecategory()->AmazonCode, 'DVD')); $objReferenceIDObjectArray = Articlecore::LoadArrayByProductGroup($productgroupid->Id); if ($objReferenceIDObjectArray) { foreach ($objReferenceIDObjectArray as $objReferenceIDObject) { $objListItem = new QListItem($objReferenceIDObject->__toString(), $objReferenceIDObject->Id); if ($this->objArticlemovies->ReferenceIDObject && $this->objArticlemovies->ReferenceIDObject->Id == $objReferenceIDObject->Id) { $objListItem->Selected = true; } $this->lstReferenceIDObject->AddItem($objListItem); } } return $this->lstReferenceIDObject; }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this ArticlecategoryMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing Articlecategory object creation - defaults to CreateOrEdit * @return ArticlecategoryMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objArticlecategory = Articlecategory::Load($intId); // Articlecategory was found -- return it! if ($objArticlecategory) { return new ArticlecategoryMetaControl($objParentObject, $objArticlecategory); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a Articlecategory object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new ArticlecategoryMetaControl($objParentObject, new Articlecategory()); }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, Articlecategory::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }
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); } } }
/** * 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); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit(Article $article) { $ArticleCategories = Articlecategory::lists('name', 'id'); return view('userArticle.edit', compact('article', 'ArticleCategories')); }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objProductGroupObject) { $objObject->objProductGroupObject = Articlecategory::GetSoapObjectFromObject($objObject->objProductGroupObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->intProductGroup = null; } } return $objObject; }
/** * 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; } }