Model for threads.

Models don't share that much, so most implementations will be adding methods onto this class. This class simply provides helper methods for common actions.

package XenForo_Thread

 Methods

Constructor.

__construct() 
Inherited

Use create() statically unless you know what you're doing.

inherited_from \XenForo_Model::__construct()

Adds a join to the set of fetch options.

addFetchOptionJoin(array $fetchOptions, integer $join) 
Inherited

Join should be one of the constants.

inherited_from \XenForo_Model::addFetchOptionJoin()

Parameters

$fetchOptions

array

$join

integer

Adds the canInlineMod value to the provided thread and returns the specific list of inline mod actions that are allowed on this thread.

addInlineModOptionToThread(array $thread, array $forum, array $nodePermissions, array $viewingUser) : array

Parameters

$thread

array

Thread info

$forum

array

Forum the thread is in

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

arrayList of allowed inline mod actions, format: [action] => true

Adds the equivalent of a limit clause using position-based limits.

addPositionLimit(string $table, integer $limit, integer $offset, string $column) : string
Inherited

It no limit value is specified, nothing will be returned.

This must be added within a WHERE clause. If a clause is required, it will begin with "AND", so ensure there is a condition before it.

inherited_from \XenForo_Model::addPositionLimit()

Parameters

$table

string

Name of the table alias to prefix. May be blank for no table reference.

$limit

integer

Number of records to limit to; ignored if <= 0

$offset

integer

Offset from the start of the records. 0+

$column

string

Name of the column that is storing the position

Returns

stringPosition limit clause if needed

Ensures that a valid cut-off operator is passed.

assertValidCutOffOperator(string $operator) 
Inherited

inherited_from \XenForo_Model::assertValidCutOffOperator()

Parameters

$operator

string

Determines if the thread's discussion_state can be altered to a new value.

canAlterThreadState(array $thread, array $forum, string $state, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$state

string

(intended new discussion_state)

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be approved/unapproved with the given permissions.

canApproveUnapproveThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be deleted with the given permissions.

canDeleteThread(array $thread, array $forum, $deleteType, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check viewing permissions.

Parameters

$thread

array

$forum

array

$deleteType

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the poll in the given thread can be edited.

canEditPoll(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be edited with the given permissions.

canEditThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

Info about the thread

$forum

array

Info about the forum the thread is in

$errorPhraseKey

string

Returned phrase key for a specific error

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread title be edited with the given permissions.

canEditThreadTitle(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

Info about the thread

$forum

array

Info about the forum the thread is in

$errorPhraseKey

string

Returned phrase key for a specific error

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be locked/unlocked with the given permissions.

canLockUnlockThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be merged with another with the given permissions.

canMergeThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be moved with the given permissions.

canMoveThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if a user can reply to the thread using Quick Reply.

canQuickReply(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions) : boolean

Note that this always assumes the visitor!

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

Returns

boolean

Determines if a new reply can be posted in the specified thread, with the given permissions.

canReplyToThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

Returned phrase key for a specific error

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be stuck/unstuck with the given permissions.

canStickUnstickThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be undeleted with the given permissions.

canUndeleteThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Checks whether a user can view attachments in a thread

canViewAttachmentsInThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

array

$viewingUser

array

Returns

boolean

Checks whether a user can view deleted posts in a thread

canViewDeletedPosts(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

array

$viewingUser

array

Returns

boolean

Determines if the specified user can view IP addresses

canViewIps(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Checks whether a user can view moderated posts in a thread

canViewModeratedPosts(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

array

$viewingUser

array

Returns

boolean

Determines if the thread can be viewed with the given permissions.

canViewThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check forum viewing permissions.

Parameters

$thread

array

Info about the thread

$forum

array

Info about the forum the thread is in

$errorPhraseKey

string

Returned phrase key for a specific error

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be viewed with the given permissions.

canViewThreadAndContainer(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This will check that any parent container can be viewed as well.

Parameters

$thread

array

Info about the thread

$forum

array

Info about the forum the thread is in

$errorPhraseKey

string

Returned phrase key for a specific error

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the poll in the given thread can be voted on.

canVoteOnPoll(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check if the user has already voted on the poll.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if the thread can be watched with the given permissions.

canWatchThread(array $thread, array $forum, string $errorPhraseKey, array $nodePermissions, array $viewingUser) : boolean

This does not check thread viewing permissions.

Parameters

$thread

array

$forum

array

$errorPhraseKey

string

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Gets the count of threads with the specified criteria.

countThreads(array $conditions) : integer

Parameters

$conditions

array

Conditions to apply to the fetching

Returns

integer

Gets the count of threads in the specified forum.

countThreadsInForum(integer $forumId, array $conditions) : integer

Parameters

$forumId

integer

$conditions

array

Conditions to apply to the fetching

Returns

integer

Factory method to get the named model.

create(string $class) : \XenForo_Model
Inherited

The class must exist or be autoloadable or an exception will be thrown.

inherited_from \XenForo_Model::create()

Parameters

$class

string

Class to load

Returns

Helper to delete the specified thread, via a soft or hard delete.

deleteThread(integer $threadId, string $deleteType, array $options) : \XenForo_DataWriter_Discussion_Thread

Parameters

$threadId

integer

ID of the thread to delete

$deleteType

string

Type of deletion (soft or hard)

$options

array

Deletion options. Currently unused.

Returns

\XenForo_DataWriter_Discussion_ThreadThe DW used to delete the thread

Fetches results from the database with each row keyed according to preference.

fetchAllKeyed(string $sql, string $key, mixed $bind, string $nullPrefix) : array
Inherited

The 'key' parameter provides the column name with which to key the result. For example, calling fetchAllKeyed('SELECT item_id, title, date FROM table', 'item_id') would result in an array keyed by item_id: [$itemId] => array('item_id' => $itemId, 'title' => $title, 'date' => $date)

Note that the specified key must exist in the query result, or it will be ignored.

inherited_from \XenForo_Model::fetchAllKeyed()

Parameters

$sql

string

SQL to execute

$key

string

Column with which to key the results array

$bind

mixed

Parameters for the SQL

$nullPrefix

string

If the key is null, prefix the counter with this

Returns

array

Gets a list of SQL conditions in the format for a clause.

getConditionsForClause(array $sqlConditions) : string
Inherited

This always returns a value that can be used in a clause such as WHERE.

inherited_from \XenForo_Model::getConditionsForClause()

Parameters

$sqlConditions

array

Returns

string

Gets the specified field from a content type, if specified for that type.

getContentTypeField(string $contentType, string $fieldName) : string | false
Inherited

inherited_from \XenForo_Model::getContentTypeField()

Parameters

$contentType

string

$fieldName

string

Returns

stringfalse

Gets the value of the specified field for each content type that has that field.

getContentTypesWithField(string $fieldName) : array
Inherited

inherited_from \XenForo_Model::getContentTypesWithField()

Parameters

$fieldName

string

Returns

arrayFormat: [content type] => field value

Gets the date of the earliest posted thread in the database

getEarliestThreadDate() : integer

Returns

integer

Returns the last few page numbers of a thread

getLastPageNumbers(integer $replyCount) : array | boolean

Parameters

$replyCount

integer

Returns

arrayboolean

Gets the thread with the most recent post in the specified forum.

getLastUpdatedThreadInForum(integer $forumId, array $fetchOptions) : array | false

Doesn't include redirects.

Parameters

$forumId

integer

$fetchOptions

array

Collection of options that relate to fetching

Returns

arrayfalse

Get the maximum thread read timestamp based on when the thread/forum has been read.

getMaxThreadReadDate(array $thread, array $forum) : integer

Parameters

$thread

array

$forum

array

Returns

integerRead timestamp (may be 0)

Gets the specified model object from the cache.

getModelFromCache(string $class) : \XenForo_Model
Inherited

If it does not exist, it will be instantiated.

inherited_from \XenForo_Model::getModelFromCache()

Parameters

$class

string

Name of the class to load

Returns

Gets an array of the node IDs in which the specified threads reside

getNodeIdsFromThreads(array $threads) : array

Parameters

$threads

array

Returns

array

Gets the order by clause for an SQL query.

getOrderByClause(array $choices, array $fetchOptions, string $defaultOrderSql) : string
Inherited

inherited_from \XenForo_Model::getOrderByClause()

Parameters

$choices

array

$fetchOptions

array

$defaultOrderSql

string

Returns

stringOrder by clause or empty string

Gets permission-based conditions that apply to thread fetching functions.

getPermissionBasedThreadFetchConditions(array $forum, array $nodePermissions, array $viewingUser) : array

Parameters

$forum

array

Forum the threads will belong to

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

arrayKeys: deleted (boolean), moderated (boolean or integer, if can only view single user's)

Gets all sticky threads in a particular forum.

getStickyThreadsInForum(integer $forumId, array $conditions, array $fetchOptions) : array

Parameters

$forumId

integer

$conditions

$fetchOptions

array

Collection of options that relate to fetching

Returns

arrayFormat: [thread id] => info

Returns a thread record based

getThreadById(integer $threadId, array $fetchOptions) : array | false

Parameters

$threadId

integer

$fetchOptions

array

Collection of options related to fetching

Returns

arrayfalse

Gets thread IDs in the specified range.

getThreadIdsInRange(integer $start, integer $limit) : array

The IDs returned will be those immediately after the "start" value (not including the start), up to the specified limit.

Parameters

$start

integer

IDs greater than this will be returned

$limit

integer

Number of posts to return

Returns

arrayList of IDs

Use the 'thread_is_watched' info in a thread array to get the watch state text

getThreadWatchStateFromThread(array $thread, boolean $useDefaultIfNotWatching, array $viewingUser) : string

Parameters

$thread

array

$useDefaultIfNotWatching

boolean

$viewingUser

array

Returns

string

Gets threads that match the given conditions.

getThreads(array $conditions, array $fetchOptions) : array

Parameters

$conditions

array

Conditions to apply to the fetching

$fetchOptions

array

Collection of options that relate to fetching

Returns

arrayFormat: [thread id] => info

From a list of thread IDs, gets info about the threads and the forums the threads are in.

getThreadsAndParentData(array $threadIds, integer $permissionCombinationId) : array

If a permission combination ID is passed, the forums will retrieve permission info.

Parameters

$threadIds

array

List of thread Ids

$permissionCombinationId

integer

Permission combination ID that will be retrieved with the forums, into nodePermissions.

Returns

arrayFormat: [0] => list of threads, [1] => list of forums

Gets the named threads.

getThreadsByIds(array $threadIds, array $fetchOptions) : array

Parameters

$threadIds

array

$fetchOptions

array

Collection of options related to fetching

Returns

arrayFormat: [thread id] => info

Gets threads that belong to the specified forum.

getThreadsInForum(integer $forumId, array $conditions, array $fetchOptions) : array

Parameters

$forumId

integer

$conditions

array

Conditions to apply to the fetching

$fetchOptions

array

Collection of options that relate to fetching

Returns

arrayFormat: [thread id] => info

Gets the IDs of threads that the specified user has not read.

getUnreadThreadIds(integer $userId, array $fetchOptions) : array

Doesn't not work for guests. Doesn't include deleted.

Parameters

$userId

integer

$fetchOptions

array

Fetching options; limit only

Returns

arrayList of thread IDs

Get the time when a user has marked the given thread as read.

getUserThreadReadDate(integer $userId, integer $threadId) : integer | null

Parameters

$userId

integer

$threadId

integer

Returns

integernullNull if guest; timestamp otherwise

Determines if a thread can have a thread preview

hasPreview(array $thread, array $forum, array $nodePermissions, array $viewingUser) : boolean

Parameters

$thread

array

(expects first_post_id and discussion_type indeces)

$forum

array

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

boolean

Determines if a thread is deleted (based on discussion_state)

isDeleted(array $thread) : boolean

Parameters

$thread

array

Returns

boolean

Determines if a thread is moderated (based on discussion_state)

isModerated(array $thread) : boolean

Parameters

$thread

array

Returns

boolean

Determines if a thread is new / unread

isNew(array $thread, array $forum) : boolean

Parameters

$thread

array

(expects thread_read_date or forum_read_date, discussion_type and last_post_date indeces)

$forum

Returns

boolean

Determines if a thread is a redirect (based on discussion_type)

isRedirect(array $thread) : boolean

Parameters

$thread

array

Returns

boolean

Determines if a thread is visible (based on discussion_state)

isVisible(array $thread) : boolean

Parameters

$thread

array

Returns

boolean

Applies a limit clause to the provided query if a limit value is specified.

limitQueryResults(string $query, integer $limit, integer $offset) : string
Inherited

If the limit value is 0 or less, no clause is applied.

inherited_from \XenForo_Model::limitQueryResults()

Parameters

$query

string

SQL query to run

$limit

integer

Number of records to limit to; ignored if <= 0

$offset

integer

Offset from the start of the records. 0+

Returns

stringQuery with limit applied if necessary

Logs the viewing of a thread.

logThreadView(integer $threadId) 

Parameters

$threadId

integer

Marks the given thread as read up to a certain point (usually the most recent post read).

markThreadRead(array $thread, array $forum, integer $readDate, array $viewingUser) : boolean

Thread must have thread_read_date key. (Forum should have forum_read_date key.)

Parameters

$thread

array

Thread info

$forum

array

Forum info

$readDate

integer

Timestamp to mark

$viewingUser

arraynull

Returns

booleanTrue if marked as read

Merge multiple threads into a single thread

mergeThreads(array $threads, integer $targetThreadId, array $options) : boolean | array

Parameters

$threads

array

$targetThreadId

integer

$options

array

Returns

booleanarrayFalse if failure, otherwise thread array of merged thread

Modifies the count of posts a user has made in a thread.

modifyThreadUserPostCount(integer $threadId, integer $userId, integer $modifyValue) 

Parameters

$threadId

integer

$userId

integer

$modifyValue

integer

How to modify the count (eg, 1 or -1)

Prepares the limit-related fetching options that can be applied to various queries.

prepareLimitFetchOptions(array $fetchOptions) : array
Inherited

Includes: limit, offset, page, and perPage.

inherited_from \XenForo_Model::prepareLimitFetchOptions()

Parameters

$fetchOptions

array

Unprepared options

Returns

arrayLimit options; keys: limit, offset

Prepares state related fetch limits, based on the list of conditions.

prepareStateLimitFromConditions(array $fetchOptions, string $table, string $stateField, string $userField) : string
Inherited

Looks for keys "deleted" and "moderated".

inherited_from \XenForo_Model::prepareStateLimitFromConditions()

Parameters

$fetchOptions

array

$table

string

Name of the table to prefix the state and user fields with

$stateField

string

Name of the field that holds the state

$userField

string

Name of the field that holds the user ID

Returns

stringSQL condition to limit state

Prepares a thread for display, generally within the context of a specific forum.

prepareThread(array $thread, array $forum, array $nodePermissions, array $viewingUser) : array

Parameters

$thread

array

Thread to prepare

$forum

array

Forum thread is in

$nodePermissions

arraynull

$viewingUser

arraynull

Returns

arrayPrepared version of thread

Prepares a collection of thread fetching related conditions into an SQL clause

prepareThreadConditions(array $conditions, array $fetchOptions) : string

Parameters

$conditions

array

List of conditions

$fetchOptions

array

Modifiable set of fetch options (may have joins pushed on to it)

Returns

stringSQL clause (at least 1=1)

Checks the 'join' key of the incoming array for the presence of the FETCH_x bitfields in this class and returns SQL snippets to join the specified tables if required

prepareThreadFetchOptions(array $fetchOptions) : array

Parameters

$fetchOptions

array

containing a 'join' integer key build from this class's FETCH_x bitfields

Returns

arrayContaining selectFields, joinTables, orderClause keys. Example: selectFields = ', user.*, foo.title'; joinTables = ' INNER JOIN foo ON (foo.id = other.id) '; orderClause = ORDER BY x.y

Rebuilds the thread user post counters for a specific thread.

rebuildThreadUserPostCounters(integer $threadId, integer | null $userId) 

If a user ID is specified, the counters are only updated for that user.

Parameters

$threadId

integer

$userId

integernull

Replaces the thread counters in a specified thread with the given set.

replaceThreadUserPostCounters(integer $threadId, array $counters, integer | null $userId) 

Old post count records are removed. If a user ID is not null, only that user's post count record is removed, so the array is must only contain records for that user.

Parameters

$threadId

integer

$counters

array

[user id] => post count

$userId

integernull

Reset an entry or the entire local cache.

resetLocalCacheData($name) 
Inherited

This can be used if you know when some cached data has expired.

inherited_from \XenForo_Model::resetLocalCacheData()

Parameters

$name

Sets whether we're allowed to read values from the cache on a model-level.

setAllowCachedRead($allowCachedRead) 
Inherited

This may be controllable on an individual level basis, if the implementation allows it.

inherited_from \XenForo_Model::setAllowCachedRead()

Parameters

$allowCachedRead

boolean

Injects a local cache value.

setLocalCacheData(string $name, $value) 
Inherited

This should only be used if you know what you're doing or for testing purposes!

Note that you cannot get the existing data via the public interface. If you think you need the set data, use a new object. It defaults to empty. :)

inherited_from \XenForo_Model::setLocalCacheData()

Parameters

$name

string

$value

Standardizes a set of node permissions and a user ID to always have appropriate data.

standardizeNodePermissionsAndUserId(integer $nodeId, array | null $permissions, integer | null $userId) 
Inherited

If an invalid permission set or user ID is provided, the current visitor's will be used.

inherited_from \XenForo_Model::standardizeNodePermissionsAndUserId()

Parameters

$nodeId

integer

Node permissions are for

$permissions

arraynull

Permissions for node or null to use current visitor's permissions

$userId

integernull

User permissions belong to or null to use current visitor

Standardizes a permission combination and user ID to always have appropriate data.

standardizePermissionCombinationIdAndUserId(integer | null $permissionCombinationId, integer | null $userId) 
Inherited

If null, users current visitor's values.

inherited_from \XenForo_Model::standardizePermissionCombinationIdAndUserId()

Parameters

$permissionCombinationId

integernull

Permission combination ID or null to use current visitor

$userId

integernull

User permissions belong to or null to use current visitor

Standardizes a set of permissions and a user ID to always have appropriate data.

standardizePermissionsAndUserId(array | null $permissions, integer | null $userId) 
Inherited

If an invalid permission set or user ID is provided, the current visitor's will be used.

inherited_from \XenForo_Model::standardizePermissionsAndUserId()

Parameters

$permissions

arraynull

Global pPermissions or null to use current visitor's permissions

$userId

integernull

User permissions belong to or null to use current visitor

Standardizes a viewing user reference array.

standardizeViewingUserReference(array $viewingUser) 
Inherited

This array must contain all basic user info (preferably all user info) and include global permissions in a "permissions" key. If not an array or missing a user_id, the visitor's values will be used.

inherited_from \XenForo_Model::standardizeViewingUserReference()

Parameters

$viewingUser

arraynull

Standardizes the viewing user reference for the specific node.

standardizeViewingUserReferenceForNode(integer $nodeId, array $viewingUser, array $nodePermissions) 
Inherited

inherited_from \XenForo_Model::standardizeViewingUserReferenceForNode()

Parameters

$nodeId

integer

$viewingUser

arraynull

Viewing user; if null, use visitor

$nodePermissions

arraynull

Permissions for this node; if null, use visitor's

Helper to unserialize permissions in a list of items.

unserializePermissionsInList(array $items, string $serializedKey, string $targetKey) : array
Inherited

inherited_from \XenForo_Model::unserializePermissionsInList()

Parameters

$items

array

List of items

$serializedKey

string

Key where serialized permissions are

$targetKey

string

Key where unserialized permissions will go

Returns

arrayList of items with permissions unserialized

Updates thread views in bulk.

updateThreadViews() 

Helper method to get the cache object.

_getCache(boolean $forceCachedRead) : \Zend_Cache_Core | \Zend_Cache_Frontend | false
Inherited

If cache reads are disabled, this will return false.

inherited_from \XenForo_Model::_getCache()

Parameters

$forceCachedRead

boolean

If true, the global "allow cached read" value is ignored

Returns

\Zend_Cache_Core\Zend_Cache_Frontendfalse

Gets the data registry model.

_getDataRegistryModel() : \XenForo_Model_DataRegistry
Inherited

inherited_from \XenForo_Model::_getDataRegistryModel()

Returns

Helper method to get the database object.

_getDb() : \Zend_Db_Adapter_Abstract
Inherited

inherited_from \XenForo_Model::_getDb()

Returns

\Zend_Db_Adapter_Abstract

_getForumModel()

_getForumModel() : \XenForo_Model_Forum

Gets the named entry from the local cache.

_getLocalCacheData(string $name) : mixed
Inherited

inherited_from \XenForo_Model::_getLocalCacheData()

Parameters

$name

string

Returns

mixed

_getPostModel()

_getPostModel() : \XenForo_Model_Post

 Properties

 

Controls whether a cached read is allowed.

$_allowCachedRead : boolean
Inherited

If not, it should be retrieved from the source.

inherited_from \XenForo_Model::$$_allowCachedRead
 

Cache object

$_cache : \Zend_Cache_Core | \Zend_Cache_Frontend
Inherited

inherited_from \XenForo_Model::$$_cache
 

Database object

$_db : \Zend_Db_Adapter_Abstract
Inherited

inherited_from \XenForo_Model::$$_db
 

Stores local, instance-specific cached data for each model.

$_localCacheData : array
Inherited

This data is generally treated as canonical, even if {$_allowCachedRead} is false.

inherited_from \XenForo_Model::$$_localCacheData
 

Standard approach to caching other model objects for the lifetime of the model.

$_modelCache : array
Inherited

inherited_from \XenForo_Model::$$_modelCache

 Constants

 

FETCH_AVATAR

FETCH_AVATAR 

 

FETCH_DELETION_LOG

FETCH_DELETION_LOG 

 

FETCH_FIRSTPOST

FETCH_FIRSTPOST 

 

FETCH_FORUM

FETCH_FORUM 

 

FETCH_FORUM_OPTIONS

FETCH_FORUM_OPTIONS 

 

Constants to allow joins to extra tables in certain queries

FETCH_USER : integer: integer: integer: integer: integer