本文整理汇总了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;
}