本文整理汇总了PHP中Topic::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Topic::Load方法的具体用法?PHP Topic::Load怎么用?PHP Topic::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Topic
的用法示例。
在下文中一共展示了Topic::Load方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Reload
/**
* Reload this Topic 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 Topic object.');
}
// Reload the Object
$objReloaded = Topic::Load($this->intId);
// Update $this's local variables to match
$this->TopicLinkId = $objReloaded->TopicLinkId;
$this->strName = $objReloaded->strName;
$this->PersonId = $objReloaded->PersonId;
$this->dttLastPostDate = $objReloaded->dttLastPostDate;
$this->intMessageCount = $objReloaded->intMessageCount;
$this->intViewCount = $objReloaded->intViewCount;
}
示例2: lstTopicsAsRead_Update
protected function lstTopicsAsRead_Update()
{
if ($this->lstTopicsAsRead) {
$this->objPerson->UnassociateAllTopicsAsRead();
$objSelectedListItems = $this->lstTopicsAsRead->SelectedItems;
if ($objSelectedListItems) {
foreach ($objSelectedListItems as $objListItem) {
$this->objPerson->AssociateTopicAsRead(Topic::Load($objListItem->Value));
}
}
}
}
示例3: __get
/**
* Override method to perform a property "Get"
* This will get the value of $strName
*
* @param string $strName Name of the property to get
* @return mixed
*/
public function __get($strName)
{
switch ($strName) {
///////////////////
// Member Variables
///////////////////
case 'Id':
/**
* Gets the value for intId (Read-Only PK)
* @return integer
*/
return $this->intId;
case 'TopicId':
/**
* Gets the value for intTopicId (Not Null)
* @return integer
*/
return $this->intTopicId;
case 'TopicLinkId':
/**
* Gets the value for intTopicLinkId (Not Null)
* @return integer
*/
return $this->intTopicLinkId;
case 'PersonId':
/**
* Gets the value for intPersonId
* @return integer
*/
return $this->intPersonId;
case 'Message':
/**
* Gets the value for strMessage
* @return string
*/
return $this->strMessage;
case 'CompiledHtml':
/**
* Gets the value for strCompiledHtml
* @return string
*/
return $this->strCompiledHtml;
case 'ReplyNumber':
/**
* Gets the value for intReplyNumber (Not Null)
* @return integer
*/
return $this->intReplyNumber;
case 'PostDate':
/**
* Gets the value for dttPostDate (Not Null)
* @return QDateTime
*/
return $this->dttPostDate;
///////////////////
// Member Objects
///////////////////
///////////////////
// Member Objects
///////////////////
case 'Topic':
/**
* Gets the value for the Topic object referenced by intTopicId (Not Null)
* @return Topic
*/
try {
if (!$this->objTopic && !is_null($this->intTopicId)) {
$this->objTopic = Topic::Load($this->intTopicId);
}
return $this->objTopic;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'TopicLink':
/**
* Gets the value for the TopicLink object referenced by intTopicLinkId (Not Null)
* @return TopicLink
*/
try {
if (!$this->objTopicLink && !is_null($this->intTopicLinkId)) {
$this->objTopicLink = TopicLink::Load($this->intTopicLinkId);
}
return $this->objTopicLink;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'Person':
/**
* Gets the value for the Person object referenced by intPersonId
* @return Person
*/
//.........这里部分代码省略.........
示例4: LoginPerson
/**
* Logs in a Person/User
* @param Person $objPerson
* @return void
*/
public static function LoginPerson(Person $objPerson)
{
$_SESSION['intPersonId'] = $objPerson->Id;
QApplication::$Person = $objPerson;
// Mark any topics as viewed if applicable
if (array_key_exists('intViewedTopicArray', $_SESSION)) {
foreach ($_SESSION['intViewedTopicArray'] as $intTopicId => $blnValue) {
if ($blnValue) {
$objTopic = Topic::Load($intTopicId);
if ($objTopic && !$objTopic->IsPersonAsReadAssociated($objPerson)) {
$objTopic->AssociatePersonAsRead($objPerson);
}
}
}
}
QApplication::ClearViewedTopicArray();
}
示例5:
<?php
require '../../includes/prepend.inc.php';
$objTopic = Topic::Load(QApplication::PathInfo(0));
if (!$objTopic || $objTopic->TopicLink->TopicLinkTypeId != TopicLinkType::Forum) {
QApplication::Redirect('/');
} else {
QApplication::Redirect('/forums/forum.php/' . $objTopic->TopicLink->ForumId . '/' . $objTopic->Id);
}
示例6: SelectTopic
/**
* Action to Select a Topic to view
* @param integer $intTopicId the topic ID that we are now viewing
* @return void
*/
public function SelectTopic($intTopicId)
{
$this->objTopic = Topic::Load(QApplication::PathInfo(1));
// Validate the Topic, Itself
if (!$this->objTopic) {
return;
}
// For Search Queries: needs to be in the QueryHitArray
if (is_array($this->objQueryHitArray)) {
$blnFound = false;
foreach ($this->objQueryHitArray as $objHit) {
if ($objHit->db_id == $this->objTopic->Id) {
$blnFound = true;
}
}
if (!$blnFound) {
$this->objTopic = null;
}
// For Forum View: Topic must be part of the Forum
} else {
if ($this->objTopic->TopicLink->ForumId != $this->objForum->Id) {
$this->objTopic = null;
}
}
// Go ahead and set up other stuff if the Topic is set
if ($this->objTopic) {
$this->objTopic->MarkAsViewed();
$this->pnlMessages->SelectTopic($this->objTopic);
}
}
示例7: 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 TopicMetaControl
* @param integer $intId primary key value
* @param QMetaControlCreateType $intCreateType rules governing Topic object creation - defaults to CreateOrEdit
* @return TopicMetaControl
*/
public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
{
// Attempt to Load from PK Arguments
if (strlen($intId)) {
$objTopic = Topic::Load($intId);
// Topic was found -- return it!
if ($objTopic) {
return new TopicMetaControl($objParentObject, $objTopic);
} else {
if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
throw new QCallerException('Could not find a Topic object with PK arguments: ' . $intId);
}
}
// 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 TopicMetaControl($objParentObject, new Topic());
}