__construct()
addFetchOptionJoin()
addPositionLimit()
applyThreadPrefix()
approveThreads()
assertValidCutOffOperator()
canApproveUnapproveThreads()
canApproveUnapproveThreadsData()
canDeleteThreads()
canDeleteThreadsData()
canEditThreads()
canEditThreadsData()
canLockUnlockThreads()
canLockUnlockThreadsData()
canMergeThreads()
canMergeThreadsData()
canMoveThreads()
canMoveThreadsData()
canStickUnstickThreads()
canStickUnstickThreadsData()
canUndeleteThreads()
canUndeleteThreadsData()
create()
deleteThreads()
fetchAllKeyed()
getConditionsForClause()
getContentTypeField()
getContentTypesWithField()
getModelFromCache()
getOrderByClause()
getThreadsAndParentData()
limitQueryResults()
lockThreads()
mergeThreads()
moveThreads()
prepareLimitFetchOptions()
prepareStateLimitFromConditions()
resetLocalCacheData()
setAllowCachedRead()
setLocalCacheData()
standardizeNodePermissionsAndUserId()
standardizePermissionCombinationIdAndUserId()
standardizePermissionsAndUserId()
standardizeViewingUserReference()
standardizeViewingUserReferenceForNode()
stickThreads()
unapproveThreads()
undeleteThreads()
unlockThreads()
unserializePermissionsInList()
unstickThreads()
_checkPermissionOnThreads()
_getCache()
_getDataRegistryModel()
_getDb()
_getForumFromThread()
_getForumModel()
_getLocalCacheData()
_getPrefixModel()
_getThreadModel()
_updateThreadsBulk()
_updateThreadsDiscussionState()
$enableLogging
$_allowCachedRead
$_cache
$_db
$_localCacheData
$_modelCache
Model to handle inline mod-style actions on threads.
Generally, these are simply bulk actions. They can be applied to other circumstances if desired.
package | XenForo_Thread |
---|
__construct()
Use create() statically unless you know what you're doing.
inherited_from | \XenForo_Model::__construct() |
---|
addFetchOptionJoin(array $fetchOptions, integer $join)
Join should be one of the constants.
inherited_from | \XenForo_Model::addFetchOptionJoin() |
---|
array
integer
addPositionLimit(string $table, integer $limit, integer $offset, string $column) : string
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() |
---|
string
Name of the table alias to prefix. May be blank for no table reference.
integer
Number of records to limit to; ignored if <= 0
integer
Offset from the start of the records. 0+
string
Name of the column that is storing the position
string
Position limit clause if neededapplyThreadPrefix(array $threadIds, integer $prefixId, array $unchangedThreadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
integer
ID of the thread prefix to apply
array
Array of thread IDs that were not updated by this action
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okapproveThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to approve
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okassertValidCutOffOperator(string $operator)
inherited_from | \XenForo_Model::assertValidCutOffOperator() |
---|
string
canApproveUnapproveThreads(array $threadIds, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canApproveUnapproveThreadsData(array $threads, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canApproveUnapproveThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canDeleteThreads(array $threadIds, string $deleteType, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
string
The type of deletion being requested (soft or hard)
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canDeleteThreadsData(array $threads, string $deleteType, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canDeleteThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
string
Type of deletion (soft or hard)
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canEditThreads(array $threadIds, string $errorKey, array | null $viewingUser) : boolean
array
List of thread IDs check
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canEditThreadsData(array $threads, array $forums, string $errorKey, array | null $viewingUser) : boolean
array
List of information about threads to be checked
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canLockUnlockThreads(array $threadIds, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canLockUnlockThreadsData(array $threads, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canLockUnlockThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canMergeThreads(array $threadIds, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canMergeThreadsData(array $threads, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canMergeThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canMoveThreads(array $threadIds, integer $targetNodeId, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
integer
ID of node where threads are being moved to. Use 0 if unknown.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canMoveThreadsData(array $threads, integer $targetNodeId, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canMoveThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
integer
ID of node where threads are being moved to. Use 0 if unknown.
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canStickUnstickThreads(array $threadIds, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canStickUnstickThreadsData(array $threads, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canStickUnstickThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canUndeleteThreads(array $threadIds, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs check
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
canUndeleteThreadsData(array $threads, array $forums, string $errorKey, array $viewingUser) : boolean
This is a slightly more "internal" version of the canUndeleteThreads() function, as the required data must already be retrieved.
array
List of information about threads to be checked
array
List of information about forums the threads are in; must include unserialized permissions in 'nodePermissions' key
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
create(string $class) : \XenForo_Model
The class must exist or be autoloadable or an exception will be thrown.
inherited_from | \XenForo_Model::create() |
---|
string
Class to load
deleteThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to delete
array
Options that control the delete. Supports deleteType (soft or hard).
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okfetchAllKeyed(string $sql, string $key, mixed $bind, string $nullPrefix) : array
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() |
---|
string
SQL to execute
string
Column with which to key the results array
mixed
Parameters for the SQL
string
If the key is null, prefix the counter with this
array
getConditionsForClause(array $sqlConditions) : string
This always returns a value that can be used in a clause such as WHERE.
inherited_from | \XenForo_Model::getConditionsForClause() |
---|
array
string
getContentTypeField(string $contentType, string $fieldName) : string | false
inherited_from | \XenForo_Model::getContentTypeField() |
---|
string
string
string
false
getContentTypesWithField(string $fieldName) : array
inherited_from | \XenForo_Model::getContentTypesWithField() |
---|
string
array
Format: [content type] => field valuegetModelFromCache(string $class) : \XenForo_Model
If it does not exist, it will be instantiated.
inherited_from | \XenForo_Model::getModelFromCache() |
---|
string
Name of the class to load
getOrderByClause(array $choices, array $fetchOptions, string $defaultOrderSql) : string
inherited_from | \XenForo_Model::getOrderByClause() |
---|
array
array
string
string
Order by clause or empty stringgetThreadsAndParentData(array $threadIds, array $viewingUser) : array
array
List of thread IDs
array
null
array
Format: [0] => list of threads, [1] => list of forumslimitQueryResults(string $query, integer $limit, integer $offset) : string
If the limit value is 0 or less, no clause is applied.
inherited_from | \XenForo_Model::limitQueryResults() |
---|
string
SQL query to run
integer
Number of records to limit to; ignored if <= 0
integer
Offset from the start of the records. 0+
string
Query with limit applied if necessarylockThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okmergeThreads(array $threadIds, integer $targetThreadId, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
integer
ID of the thread (in the list) that the merging will happen into
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okmoveThreads(array $threadIds, integer $targetNodeId, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
integer
ID of node where threads are being moved to. Use 0 if unknown.
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okprepareLimitFetchOptions(array $fetchOptions) : array
Includes: limit, offset, page, and perPage.
inherited_from | \XenForo_Model::prepareLimitFetchOptions() |
---|
array
Unprepared options
array
Limit options; keys: limit, offsetprepareStateLimitFromConditions(array $fetchOptions, string $table, string $stateField, string $userField) : string
Looks for keys "deleted" and "moderated".
inherited_from | \XenForo_Model::prepareStateLimitFromConditions() |
---|
array
string
Name of the table to prefix the state and user fields with
string
Name of the field that holds the state
string
Name of the field that holds the user ID
string
SQL condition to limit stateresetLocalCacheData($name)
This can be used if you know when some cached data has expired.
inherited_from | \XenForo_Model::resetLocalCacheData() |
---|
setAllowCachedRead($allowCachedRead)
This may be controllable on an individual level basis, if the implementation allows it.
inherited_from | \XenForo_Model::setAllowCachedRead() |
---|
boolean
setLocalCacheData(string $name, $value)
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() |
---|
string
standardizeNodePermissionsAndUserId(integer $nodeId, array | null $permissions, integer | null $userId)
If an invalid permission set or user ID is provided, the current visitor's will be used.
inherited_from | \XenForo_Model::standardizeNodePermissionsAndUserId() |
---|
integer
Node permissions are for
array
null
Permissions for node or null to use current visitor's permissions
integer
null
User permissions belong to or null to use current visitor
standardizePermissionCombinationIdAndUserId(integer | null $permissionCombinationId, integer | null $userId)
If null, users current visitor's values.
inherited_from | \XenForo_Model::standardizePermissionCombinationIdAndUserId() |
---|
integer
null
Permission combination ID or null to use current visitor
integer
null
User permissions belong to or null to use current visitor
standardizePermissionsAndUserId(array | null $permissions, integer | null $userId)
If an invalid permission set or user ID is provided, the current visitor's will be used.
inherited_from | \XenForo_Model::standardizePermissionsAndUserId() |
---|
array
null
Global pPermissions or null to use current visitor's permissions
integer
null
User permissions belong to or null to use current visitor
standardizeViewingUserReference(array $viewingUser)
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() |
---|
array
null
standardizeViewingUserReferenceForNode(integer $nodeId, array $viewingUser, array $nodePermissions)
inherited_from | \XenForo_Model::standardizeViewingUserReferenceForNode() |
---|
integer
array
null
Viewing user; if null, use visitor
array
null
Permissions for this node; if null, use visitor's
stickThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okunapproveThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to unapprove
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okundeleteThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to undelete
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okunlockThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were okunserializePermissionsInList(array $items, string $serializedKey, string $targetKey) : array
inherited_from | \XenForo_Model::unserializePermissionsInList() |
---|
array
List of items
string
Key where serialized permissions are
string
Key where unserialized permissions will go
array
List of items with permissions unserializedunstickThreads(array $threadIds, array $options, string $errorKey, array $viewingUser) : boolean
array
List of thread IDs to change
array
Options that control the action. Nothing supported at this time.
string
Modified by reference. If no permission, may include a key of a phrase that gives more info
array
null
boolean
True if permissions were ok_checkPermissionOnThreads(string $permissionMethod, array $threads, array $forums, string $errorKey, array $viewingUser) : boolean
True is returned only if the action is possible on all threads.
string
Name of the permission method to call in the thread model
array
List of threads to check
array
List of forums the threads are in
string
Returned by reference. Phrase key if an error occurs
array
null
boolean
_getCache(boolean $forceCachedRead) : \Zend_Cache_Core | \Zend_Cache_Frontend | false
If cache reads are disabled, this will return false.
inherited_from | \XenForo_Model::_getCache() |
---|
boolean
If true, the global "allow cached read" value is ignored
\Zend_Cache_Core
\Zend_Cache_Frontend
false
_getDb() : \Zend_Db_Adapter_Abstract
inherited_from | \XenForo_Model::_getDb() |
---|
\Zend_Db_Adapter_Abstract
_getForumFromThread(array $thread, array $forums) : array
array
Info about the thread
array
List of forums that the thread could belong to
array
Forum info_getLocalCacheData(string $name) : mixed
inherited_from | \XenForo_Model::_getLocalCacheData() |
---|
string
mixed
_updateThreadsBulk(array $threads, array $forums, array $updates, string $logAction)
array
List of threads to update
array
List of forums threads are in
array
Key-value pairs to update
string
If specified, this action will be logged with this action
_updateThreadsDiscussionState(array $threads, array $forums, string $newState, string | false $expectedOldState)
array
Information about the threads to update
array
Information about the forums that the threads are in
string
New message state (visible, moderated, deleted)
string
false
If specified, only updates if the old state matches
$enableLogging
$_allowCachedRead : boolean
If not, it should be retrieved from the source.
inherited_from | \XenForo_Model::$$_allowCachedRead |
---|
$_cache : \Zend_Cache_Core | \Zend_Cache_Frontend
inherited_from | \XenForo_Model::$$_cache |
---|
$_db : \Zend_Db_Adapter_Abstract
inherited_from | \XenForo_Model::$$_db |
---|
$_localCacheData : array
This data is generally treated as canonical, even if {$_allowCachedRead} is false.
inherited_from | \XenForo_Model::$$_localCacheData |
---|
$_modelCache : array
inherited_from | \XenForo_Model::$$_modelCache |
---|