当前位置: 首页>>代码示例>>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;未经允许,请勿转载。