Documentation

Comment extends AbstractModel
in package

Comment

Model of a PrivateBin comment.

Table of Contents

Properties

$_conf  : Configuration
Configuration.
$_data  : array<string|int, mixed>
Instance data.
$_id  : string
Instance ID.
$_store  : AbstractData
Data storage.
$_paste  : Paste
Instance's parent.

Methods

__construct()  : mixed
Instance constructor.
delete()  : mixed
Delete the comment.
exists()  : bool
Test if comment exists in store.
get()  : array<string|int, mixed>
Get instance data.
getId()  : string
Get ID.
getParentId()  : string
Get parent ID.
getPaste()  : Paste
Get paste.
isValidId()  : bool
Validate ID.
setData()  : mixed
Set data and recalculate ID.
setId()  : mixed
Set ID.
setParentId()  : mixed
Set parent ID.
setPaste()  : mixed
Set paste.
store()  : mixed
Store the comment's data.
_sanitize()  : array<string|int, mixed>
Sanitizes data to conform with current configuration.
_validate()  : mixed
Validate data.

Properties

$_data

Instance data.

protected array<string|int, mixed> $_data = array('meta' => array())
Tags
access

protected

$_id

Instance ID.

protected string $_id = ''
Tags
access

protected

$_paste

Instance's parent.

private Paste $_paste
Tags
access

private

Methods

delete()

Delete the comment.

public delete() : mixed
Tags
access

public

throws
Exception

exists()

Test if comment exists in store.

public exists() : bool
Tags
access

public

Return values
bool

get()

Get instance data.

public get() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

getId()

Get ID.

public getId() : string
Tags
access

public

Return values
string

getParentId()

Get parent ID.

public getParentId() : string
Tags
access

public

Return values
string

getPaste()

Get paste.

public getPaste() : Paste
Tags
access

public

Return values
Paste

isValidId()

Validate ID.

public static isValidId(string $id) : bool
Parameters
$id : string
Tags
access

public

static
Return values
bool

setData()

Set data and recalculate ID.

public setData(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
access

public

throws
Exception

setId()

Set ID.

public setId(string $id) : mixed
Parameters
$id : string
Tags
access

public

throws
Exception

setParentId()

Set parent ID.

public setParentId(string $id) : mixed
Parameters
$id : string
Tags
access

public

throws
Exception

setPaste()

Set paste.

public setPaste(Paste $paste) : mixed
Parameters
$paste : Paste
Tags
access

public

throws
Exception

store()

Store the comment's data.

public store() : mixed
Tags
access

public

throws
Exception

_sanitize()

Sanitizes data to conform with current configuration.

protected _sanitize(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Tags
access

protected

Return values
array<string|int, mixed>

_validate()

Validate data.

protected _validate(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Tags
access

protected

throws
Exception

        
On this page

Search results