PHP Class Comment, ProcessWire

Inheritance: extends DatabaseObject
Afficher le fichier Open project: ryancramerdesign/ProcessWire Class Usage Examples

Protected Properties

Свойство Type Description
$_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

Méthodes publiques

Méthode Description
__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 )

Method Details

__construct() public méthode

Construct a Comment and set defaults
public __construct ( )

__toString() public méthode

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

children() public méthode

Return children comments, if applicable
public children ( ) : CommentArray
Résultat CommentArray

cleanCommentString() public méthode

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

get() public méthode

public get ( $key )

getField() public méthode

public getField ( )

getFormatted() public méthode

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
Résultat mixed | null | Page | string

getGravatar() public static méthode

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.
Résultat string

getPage() public méthode

public getPage ( )

gravatar() public méthode

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.
Résultat string

isApproved() public méthode

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

parent() public méthode

Return the parent comment, if applicable
public parent ( ) : Comment | null
Résultat Comment | null

renderStars() public méthode

Render stars markup
public renderStars ( array $options = [] ) : string
$options array See CommentArray::renderStars for $options
Résultat string

set() public méthode

public set ( $key, $value )

setField() public méthode

public setField ( Field $field )
$field Field

setIsLoaded() public méthode

public setIsLoaded ( $loaded )

setPage() public méthode

public setPage ( Page $page )
$page Page

Property Details

$_parent protected_oe property

Cached parent from parent() method
protected null $_parent
Résultat null

$field protected_oe property

Field this comment is for
protected null|Field $field
Résultat null | Field

$loaded protected_oe property

Is this comment finished loading?
protected bool $loaded
Résultat boolean

$page protected_oe property

Page this comment lives on
protected null|Page $page
Résultat null | Page

$prevStatus protected_oe property

Previous Comment status, when it has been changed
protected int|null $prevStatus
Résultat integer | null