PHP 클래스 Comment, ProcessWire

상속: extends DatabaseObject
파일 보기 프로젝트 열기: ryancramerdesign/ProcessWire 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_parent null Cached parent from parent() method
$field null | Field Field this comment is for
$loaded boolean Is this comment finished loading?
$page null | Page Page this comment lives on
$prevStatus integer | null Previous Comment status, when it has been changed

공개 메소드들

메소드 설명
__construct ( ) Construct a Comment and set defaults
__toString ( ) String value of a Comment is it's database ID
children ( ) : CommentArray Return children comments, if applicable
cleanCommentString ( $str ) Clean a comment string by issuing several filters
get ( $key )
getField ( )
getFormatted ( $key ) : mixed | null | Page | string Same as get() but with output formatting applied
getGravatar ( string $email, string $rating = 'g', string $imageset = 'mm', integer $size = 80 ) : string Returns a URL to this user's gravatar image (static version, use non-static gravatar() function unless you specifically need static)
getPage ( )
gravatar ( string $rating = 'g', string $imageset = 'mm', integer $size = 80 ) : string Returns a URL to this user's gravatar image
isApproved ( ) Returns true if the comment is approved and thus appearing on the site
parent ( ) : Comment | null Return the parent comment, if applicable
renderStars ( array $options = [] ) : string Render stars markup
set ( $key, $value )
setField ( Field $field )
setIsLoaded ( $loaded )
setPage ( Page $page )

메소드 상세

__construct() 공개 메소드

Construct a Comment and set defaults
public __construct ( )

__toString() 공개 메소드

String value of a Comment is it's database ID
public __toString ( )

children() 공개 메소드

Return children comments, if applicable
public children ( ) : CommentArray
리턴 CommentArray

cleanCommentString() 공개 메소드

Clean a comment string by issuing several filters
public cleanCommentString ( $str )

get() 공개 메소드

public get ( $key )

getField() 공개 메소드

public getField ( )

getFormatted() 공개 메소드

Note that we won't apply this to get() when $page->outputFormatting is active in order for backwards compatibility with older installations.
public getFormatted ( $key ) : mixed | null | Page | string
$key
리턴 mixed | null | Page | string

getGravatar() 공개 정적인 메소드

Returns a URL to this user's gravatar image (static version, use non-static gravatar() function unless you specifically need static)
public static getGravatar ( string $email, string $rating = 'g', string $imageset = 'mm', integer $size = 80 ) : string
$email string
$rating string Gravatar rating, one of [ g | pg | r | x ], default is g.
$imageset string Gravatar default imageset, one of [ 404 | mm | identicon | monsterid | wavatar | retro | blank ], default is mm.
$size integer Gravatar image size, default is 80.
리턴 string

getPage() 공개 메소드

public getPage ( )

gravatar() 공개 메소드

Returns a URL to this user's gravatar image
public gravatar ( string $rating = 'g', string $imageset = 'mm', integer $size = 80 ) : string
$rating string Gravatar rating, one of [ g | pg | r | x ], default is g.
$imageset string Gravatar default imageset, one of [ 404 | mm | identicon | monsterid | wavatar | retro | blank ], default is mm.
$size integer Gravatar image size, default is 80.
리턴 string

isApproved() 공개 메소드

Returns true if the comment is approved and thus appearing on the site
public isApproved ( )

parent() 공개 메소드

Return the parent comment, if applicable
public parent ( ) : Comment | null
리턴 Comment | null

renderStars() 공개 메소드

Render stars markup
public renderStars ( array $options = [] ) : string
$options array See CommentArray::renderStars for $options
리턴 string

set() 공개 메소드

public set ( $key, $value )

setField() 공개 메소드

public setField ( Field $field )
$field Field

setIsLoaded() 공개 메소드

public setIsLoaded ( $loaded )

setPage() 공개 메소드

public setPage ( Page $page )
$page Page

프로퍼티 상세

$_parent 보호되어 있는 프로퍼티

Cached parent from parent() method
protected null $_parent
리턴 null

$field 보호되어 있는 프로퍼티

Field this comment is for
protected null|Field $field
리턴 null | Field

$loaded 보호되어 있는 프로퍼티

Is this comment finished loading?
protected bool $loaded
리턴 boolean

$page 보호되어 있는 프로퍼티

Page this comment lives on
protected null|Page $page
리턴 null | Page

$prevStatus 보호되어 있는 프로퍼티

Previous Comment status, when it has been changed
protected int|null $prevStatus
리턴 integer | null