PHP Класс Comment, ProcessWire

Наследование: extends DatabaseObject
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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