當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WikiPage::Load方法代碼示例

本文整理匯總了PHP中WikiPage::Load方法的典型用法代碼示例。如果您正苦於以下問題:PHP WikiPage::Load方法的具體用法?PHP WikiPage::Load怎麽用?PHP WikiPage::Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WikiPage的用法示例。


在下文中一共展示了WikiPage::Load方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Create

 /**
  * 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 WikiPageMetaControl
  * @param integer $intWikiVersionId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing WikiPage object creation - defaults to CreateOrEdit
  * @return WikiPageMetaControl
  */
 public static function Create($objParentObject, $intWikiVersionId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intWikiVersionId)) {
         $objWikiPage = WikiPage::Load($intWikiVersionId);
         // WikiPage was found -- return it!
         if ($objWikiPage) {
             return new WikiPageMetaControl($objParentObject, $objWikiPage);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a WikiPage object with PK arguments: ' . $intWikiVersionId);
             }
         }
         // 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 WikiPageMetaControl($objParentObject, new WikiPage());
 }
開發者ID:klucznik,項目名稱:qcodo-website,代碼行數:34,代碼來源:WikiPageMetaControlGen.class.php

示例2: SaveWikiVersion

 /**
  * This will save this object's WikiVersion instance,
  * updating only the fields which have had a control created for it.
  */
 public function SaveWikiVersion()
 {
     try {
         // Update any fields for controls that have been created
         if ($this->lstWikiItem) {
             $this->objWikiVersion->WikiItemId = $this->lstWikiItem->SelectedValue;
         }
         if ($this->txtVersionNumber) {
             $this->objWikiVersion->VersionNumber = $this->txtVersionNumber->Text;
         }
         if ($this->txtName) {
             $this->objWikiVersion->Name = $this->txtName->Text;
         }
         if ($this->lstPostedByPerson) {
             $this->objWikiVersion->PostedByPersonId = $this->lstPostedByPerson->SelectedValue;
         }
         if ($this->calPostDate) {
             $this->objWikiVersion->PostDate = $this->calPostDate->DateTime;
         }
         // Update any UniqueReverseReferences (if any) for controls that have been created for it
         if ($this->lstWikiFile) {
             $this->objWikiVersion->WikiFile = WikiFile::Load($this->lstWikiFile->SelectedValue);
         }
         if ($this->lstWikiImage) {
             $this->objWikiVersion->WikiImage = WikiImage::Load($this->lstWikiImage->SelectedValue);
         }
         if ($this->lstWikiItemAsCurrent) {
             $this->objWikiVersion->WikiItemAsCurrent = WikiItem::Load($this->lstWikiItemAsCurrent->SelectedValue);
         }
         if ($this->lstWikiPage) {
             $this->objWikiVersion->WikiPage = WikiPage::Load($this->lstWikiPage->SelectedValue);
         }
         // Save the WikiVersion object
         $this->objWikiVersion->Save();
         // Finally, update any ManyToManyReferences (if any)
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:44,代碼來源:WikiVersionMetaControlGen.class.php

示例3: Reload

 /**
  * Reload this WikiPage from the database.
  * @return void
  */
 public function Reload()
 {
     // Make sure we are actually Restored from the database
     if (!$this->__blnRestored) {
         throw new QCallerException('Cannot call Reload() on a new, unsaved WikiPage object.');
     }
     // Reload the Object
     $objReloaded = WikiPage::Load($this->intWikiVersionId);
     // Update $this's local variables to match
     $this->WikiVersionId = $objReloaded->WikiVersionId;
     $this->__intWikiVersionId = $this->intWikiVersionId;
     $this->strContent = $objReloaded->strContent;
     $this->strCompiledHtml = $objReloaded->strCompiledHtml;
     $this->intViewCount = $objReloaded->intViewCount;
 }
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:19,代碼來源:WikiPageGen.class.php


注:本文中的WikiPage::Load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。