Post-specific attachment handler.

package XenForo_Attachment

 Methods

Constructor.

__construct() 
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::__construct()

Code to run after deleting an associated attachment.

attachmentPostDelete(array $attachment, \Zend_Db_Adapter_Abstract $db) 

This is only called when the attachment has been associated with particular content (not just uploaded unassociated).

see \global\XenForo_AttachmentHandler_Abstract::attachmentPostDelete()

Parameters

$attachment

array

Attachment that has been deleted

$db

\Zend_Db_Adapter_Abstract

DB object

Determines if the specified user can upload new attachments or manage existing ones.

canUploadAndManageAttachments(array $contentData, array $viewingUser) : boolean
Inherited

The content data may contain different type-specific values in different situations. Eg, when posting a thread, only the node_id is known; when posting a reply, the thread_id is know; when editing a post, the post_id is known.

inherited_from \XenForo_AttachmentHandler_Abstract::canUploadAndManageAttachments()

Parameters

$contentData

array

Type-specific params based on context

$viewingUser

arraynull

Viewing user array; null for visitor

Returns

boolean

Determines if the specified user can view the given attachment.

canViewAttachment(array $attachment, array $viewingUser) : boolean
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::canViewAttachment()

Parameters

$attachment

array

Attachment to view

$viewingUser

arraynull

Viewing user array; null for visitor

Returns

boolean

Get attachment constraints for the current attachment content type

getAttachmentConstraints() : array
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::getAttachmentConstraints()

Returns

array

Returns the maximum allowed attachments for this content type.

getAttachmentCountLimit() : integer | true
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::getAttachmentCountLimit()

Returns

integertrueIf true, there is no limit

Builds a content data array.

getContentDataFromContentId(integer $contentId) : array
Inherited

By default, this only contains only the primary content ID.

inherited_from \XenForo_AttachmentHandler_Abstract::getContentDataFromContentId()

Parameters

$contentId

integer

Returns

array

Gets the primary content ID from an array of content data, if provided.

getContentIdFromContentData(array $contentData) : integer
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::getContentIdFromContentData()

Parameters

$contentData

array

Type-specific content data

Returns

integer

Returns the phrase key of a phrase that names the content type managed by this handler.

getContentTypePhraseKey() : string
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::getContentTypePhraseKey()

Returns

string

Standardizes the viewing user array reference.

standardizeViewingUserReference(array $viewingUser) 
Inherited

inherited_from \XenForo_AttachmentHandler_Abstract::standardizeViewingUserReference()

Parameters

$viewingUser

arraynull

Viewing user array. Will be normalized.

Determines if attachments and be uploaded and managed in this context.

_canUploadAndManageAttachments(array $contentData, array $viewingUser) : boolean

The content data may contain different type-specific values in different situations. Eg, when posting a thread, only the node_id is known; when posting a reply, the thread_id is know; when editing a post, the post_id is known.

see \global\XenForo_AttachmentHandler_Abstract::_canUploadAndManageAttachments()

Parameters

$contentData

array

Type-specific params based on context

$viewingUser

array

Viewing user array

Returns

boolean

Determines if the specified attachment can be viewed.

_canViewAttachment(array $attachment, array $viewingUser) : boolean

see \global\XenForo_AttachmentHandler_Abstract::_canViewAttachment()

Parameters

$attachment

array

Attachment to view

$viewingUser

array

Viewing user array

Returns

boolean

_getContentRoute()

_getContentRoute() 

see \global\XenForo_AttachmentHandler_Abstract::_getContentRoute()

_getPostModel()

_getPostModel() : \XenForo_Model_Post

 Properties

 

Key of primary content in content data array.

$_contentIdKey : string

Must be overriden by children.

 

Route to get to a post

$_contentRoute : string

Example: posts use 'posts' Must be overriden by children.

 

Name of the phrase that describes the conversation_message content type

$_contentTypePhraseKey : string

Examples: 'post'; 'conversation_message' Must be overriden by children.

 

$_postModel

$_postModel