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


PHP Topic::Save方法代碼示例

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


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

示例1: PostTopic

 /**
  * This will post a new Topic for this forum along with the topic's first / initial message.
  * 
  * @param string $strTitle
  * @param string $strMessageText
  * @param Person $objPerson
  * @param QDateTime $dttPostDate
  * @return Topic
  */
 public function PostTopic($strTitle, $strFirstMessageText, Person $objPerson, QDateTime $dttPostDate = null)
 {
     $objTopic = new Topic();
     $objTopic->TopicLink = $this->TopicLink;
     $objTopic->Name = $strTitle;
     $objTopic->Person = $objPerson;
     $objTopic->Save();
     $objTopic->PostMessage($strFirstMessageText, $objPerson, $dttPostDate);
     return $objTopic;
 }
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:19,代碼來源:Forum.class.php

示例2: CreateTopicAndTopicLink

 /**
  * Creates the Topic and TopicLink for this Package object.
  * @param Person $objPerson person who created this package who will be credited with creating the linked topic
  * @return Topic
  */
 public function CreateTopicAndTopicLink(Person $objPerson)
 {
     $objTopicLink = new TopicLink();
     $objTopicLink->TopicLinkTypeId = TopicLinkType::Package;
     $objTopicLink->Package = $this;
     $objTopicLink->Save();
     $objTopic = new Topic();
     $objTopic->TopicLink = $objTopicLink;
     $objTopic->Name = $this->strName;
     $objTopic->Person = $objPerson;
     $objTopic->Save();
     return $objTopic;
 }
開發者ID:klucznik,項目名稱:qcodo-website,代碼行數:18,代碼來源:Package.class.php

示例3: CreateTopicAndTopicLink

 /**
  * Creates the Topic and TopicLink for this Issue object.
  * @return Topic
  */
 public function CreateTopicAndTopicLink()
 {
     $objTopicLink = new TopicLink();
     $objTopicLink->TopicLinkTypeId = TopicLinkType::Issue;
     $objTopicLink->Issue = $this;
     $objTopicLink->Save();
     $objTopic = new Topic();
     $objTopic->TopicLink = $objTopicLink;
     $objTopic->Name = $this->strTitle;
     $objTopic->Person = $this->PostedByPerson;
     $objTopic->Save();
     return $objTopic;
 }
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:17,代碼來源:Issue.class.php

示例4: Topic

$intNewTopicLinkIdArray[3547] = 7;
$intNewTopicLinkIdArray[3455] = 7;
$intNewTopicLinkIdArray[3242] = 7;
$intNewTopicLinkIdArray[3244] = 7;
$objResult = $objDb->query('SELECT * FROM topic ORDER BY id');
while (QDataGen::DisplayWhileTask('Migrating Topics', $objResult->num_rows)) {
    $objRow = $objResult->fetch_array();
    $objTopic = new Topic();
    if (array_key_exists(intval($objRow['id']), $intNewTopicLinkIdArray)) {
        $objTopic->TopicLinkId = $intNewTopicLinkIdArray[intval($objRow['id'])];
    } else {
        $objTopic->TopicLinkId = $objRow['forum_id'] - 1;
    }
    $objTopic->Name = $objRow['name'];
    $objTopic->PersonId = $objRow['person_id'];
    $objTopic->Save();
    if ($objTopic->Id != $objRow['id']) {
        Topic::GetDatabase()->NonQuery('UPDATE topic SET id=' . $objRow['id'] . ' WHERE id=' . $objTopic->Id);
        Topic::GetDatabase()->NonQuery('ALTER TABLE topic AUTO_INCREMENT=' . ($objTopic->Id + 1));
    }
}
$objResult = $objDb->query('SELECT * FROM message ORDER BY id');
while (QDataGen::DisplayWhileTask('Migrating Messages', $objResult->num_rows)) {
    $objRow = $objResult->fetch_array();
    $objMessage = new Message();
    $objMessage->TopicLinkId = $objRow['forum_id'] - 1;
    $objMessage->TopicId = $objRow['topic_id'];
    $objMessage->PersonId = $objRow['person_id'];
    $objMessage->ReplyNumber = Message::QueryCount(QQ::Equal(QQN::Message()->TopicId, $objRow['topic_id'])) + 1;
    $objMessage->PostDate = new QDateTime($objRow['post_date']);
    $strContent = $objRow['message'];
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:31,代碼來源:migrator.cli.php

示例5: CreateTopicAndTopicLink

 /**
  * Creates the Topic and TopicLink for this Issue object.
  * @return Topic
  */
 protected function CreateTopicAndTopicLink()
 {
     $objTopicLink = new TopicLink();
     $objTopicLink->TopicLinkTypeId = TopicLinkType::WikiItem;
     $objTopicLink->WikiItem = $this;
     $objTopicLink->Save();
     $objTopic = new Topic();
     $objTopic->TopicLink = $objTopicLink;
     $objTopic->Name = $this->CurrentName;
     $objTopic->Person = $this->CurrentPostedByPerson;
     $objTopic->Save();
     return $objTopic;
 }
開發者ID:qcodo,項目名稱:qcodo-website,代碼行數:17,代碼來源:WikiItem.class.php


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