本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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'];
示例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;
}