PHP 클래스 PromotedContentModule, vanilla

- Posted by a certain role - Reached bestof status - Latest from a certain category
부터: 2.0.17.9
저자: Tim Gunter ([email protected])
상속: extends Gdn_Module
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$BodyLimit How many chars of Body to return.
$ContentType What type of content to fetch. One of: all, discussions, comments.
$Expiry How long do we cache in seconds.
$Group How often should we encapsulate content in groups. Groups of: n.
$Limit How much content should be fetched.
$Properties Whitelist of accepted parameters.
$Selection Parameters for the selector method.
$Selector How should we choose the content? - role Author's Role - rank Author's Rank - category Content's Category - score Content's Score - promoted
$TitleLimit How many chars of Title to return.

공개 메소드들

메소드 설명
__construct ( )
assetTarget ( ) : string Default asset target for this module.
getData ( ) Get data based on class properties.
load ( array $Parameters = [] ) Set class properties.
showComments ( ) : boolean Whether to display promoted comments.
showDiscussions ( ) : boolean Whether to display promoted discussions.
toString ( ) : string Render.
validate ( array $Parameters = [] ) : string | true Validate data to be used as class properties.

보호된 메소드들

메소드 설명
condense ( array &$Content, array $Limit ) Condense an interleaved content list down to the required size
joinCategory ( array &$Comments ) Attach CategoryID to Comments
processContent ( Array &$content ) Pre-process content into a uniform format for output
security ( array &$Content ) Strip out content that this user is not allowed to see
securityFilter ( $ContentItem ) : boolean Determine if we have permission to view this content.
selectByCategory ( array | integer $Parameters ) : array | false Select content based on its CategoryID.
selectByPromoted ( array $Parameters ) : array | false Selected content that passed the Promoted threshold.
selectByRank ( array | integer $Parameters ) : array | false Select content based on author RankID.
selectByRole ( array | integer $Parameters ) : array | false Select content based on author RoleID.
selectByScore ( array | integer $Parameters ) : array | false Select content based on its Score.
union ( string $Field, array $Sections ) : array Interleave two or more result arrays by a common field

메소드 상세

__construct() 공개 메소드

public __construct ( )

assetTarget() 공개 메소드

Default asset target for this module.
public assetTarget ( ) : string
리턴 string

condense() 보호된 메소드

Condense an interleaved content list down to the required size
protected condense ( array &$Content, array $Limit )
$Content array
$Limit array

getData() 공개 메소드

Get data based on class properties.
public getData ( )

joinCategory() 보호된 메소드

Attach CategoryID to Comments
protected joinCategory ( array &$Comments )
$Comments array

load() 공개 메소드

Set class properties.
public load ( array $Parameters = [] )
$Parameters array Use lowercase key names that map to class properties.

processContent() 보호된 메소드

Pre-process content into a uniform format for output
protected processContent ( Array &$content )
$content Array By reference

security() 보호된 메소드

Strip out content that this user is not allowed to see
protected security ( array &$Content )
$Content array Content array, by reference

securityFilter() 보호된 메소드

Determine if we have permission to view this content.
protected securityFilter ( $ContentItem ) : boolean
$ContentItem
리턴 boolean

selectByCategory() 보호된 메소드

Select content based on its CategoryID.
protected selectByCategory ( array | integer $Parameters ) : array | false
$Parameters array | integer
리턴 array | false

selectByPromoted() 보호된 메소드

This uses the Reactions caching system & options.
protected selectByPromoted ( array $Parameters ) : array | false
$Parameters array Not used.
리턴 array | false $Content

selectByRank() 보호된 메소드

Select content based on author RankID.
protected selectByRank ( array | integer $Parameters ) : array | false
$Parameters array | integer
리턴 array | false

selectByRole() 보호된 메소드

Select content based on author RoleID.
protected selectByRole ( array | integer $Parameters ) : array | false
$Parameters array | integer
리턴 array | false

selectByScore() 보호된 메소드

Select content based on its Score.
protected selectByScore ( array | integer $Parameters ) : array | false
$Parameters array | integer
리턴 array | false

showComments() 공개 메소드

Whether to display promoted comments.
public showComments ( ) : boolean
리턴 boolean

showDiscussions() 공개 메소드

Whether to display promoted discussions.
public showDiscussions ( ) : boolean
리턴 boolean

toString() 공개 메소드

Render.
public toString ( ) : string
리턴 string

union() 보호된 메소드

Interleave two or more result arrays by a common field
protected union ( string $Field, array $Sections ) : array
$Field string
$Sections array Array of result arrays
리턴 array

validate() 공개 메소드

Validate data to be used as class properties.
public validate ( array $Parameters = [] ) : string | true
$Parameters array .
리턴 string | true True on success or string (message) on error.

프로퍼티 상세

$BodyLimit 공개적으로 프로퍼티

How many chars of Body to return.
public $BodyLimit

$ContentType 공개적으로 프로퍼티

What type of content to fetch. One of: all, discussions, comments.
public $ContentType

$Expiry 공개적으로 프로퍼티

How long do we cache in seconds.
public $Expiry

$Group 공개적으로 프로퍼티

How often should we encapsulate content in groups. Groups of: n.
public $Group

$Limit 공개적으로 프로퍼티

How much content should be fetched.
public $Limit

$Properties 공개적으로 프로퍼티

Whitelist of accepted parameters.
public $Properties

$Selection 공개적으로 프로퍼티

Parameters for the selector method.
public $Selection

$Selector 공개적으로 프로퍼티

How should we choose the content? - role Author's Role - rank Author's Rank - category Content's Category - score Content's Score - promoted
public $Selector

$TitleLimit 공개적으로 프로퍼티

How many chars of Title to return.
public $TitleLimit