PHP Class PrivateBin\Model\Paste

Model of a PrivateBin paste.
Inheritance: extends AbstractModel
Mostrar archivo Open project: privatebin/privatebin Class Usage Examples

Public Methods

Method Description
delete ( ) : void Delete the paste.
exists ( ) : boolean Test if paste exists in store.
get ( ) : stdClass Get paste data.
getComment ( string $parentId, string $commentId = null ) : Comment Get a comment, optionally a specific instance.
getComments ( ) : array Get all comments, if any.
getDeleteToken ( ) : string Generate the "delete" token.
isBurnafterreading ( ) : boolean Check if paste is of burn-after-reading type.
isOpendiscussion ( ) : boolean Check if paste has discussions enabled.
setAttachment ( string $attachment ) : void Set paste's attachment.
setAttachmentName ( string $attachmentname ) : void Set paste's attachment name.
setBurnafterreading ( string $burnafterreading = '1' ) : void Set paste's burn-after-reading type.
setExpiration ( string $expiration ) : void Set paste expiration.
setFormatter ( string $format ) : void Set paste's format.
setOpendiscussion ( string $opendiscussion = '1' ) : void Set paste's discussion state.
store ( ) : void Store the paste's data.

Method Details

delete() public method

Delete the paste.
public delete ( ) : void
return void

exists() public method

Test if paste exists in store.
public exists ( ) : boolean
return boolean

get() public method

Get paste data.
public get ( ) : stdClass
return stdClass

getComment() public method

Get a comment, optionally a specific instance.
public getComment ( string $parentId, string $commentId = null ) : Comment
$parentId string
$commentId string
return Comment

getComments() public method

Get all comments, if any.
public getComments ( ) : array
return array

getDeleteToken() public method

The token is the hmac of the pastes ID signed with the server salt. The paste can be deleted by calling: http://example.com/privatebin/?pasteid=&deletetoken=
public getDeleteToken ( ) : string
return string

isBurnafterreading() public method

Check if paste is of burn-after-reading type.
public isBurnafterreading ( ) : boolean
return boolean

isOpendiscussion() public method

Check if paste has discussions enabled.
public isOpendiscussion ( ) : boolean
return boolean

setAttachment() public method

Set paste's attachment.
public setAttachment ( string $attachment ) : void
$attachment string
return void

setAttachmentName() public method

Set paste's attachment name.
public setAttachmentName ( string $attachmentname ) : void
$attachmentname string
return void

setBurnafterreading() public method

Set paste's burn-after-reading type.
public setBurnafterreading ( string $burnafterreading = '1' ) : void
$burnafterreading string
return void

setExpiration() public method

Set paste expiration.
public setExpiration ( string $expiration ) : void
$expiration string
return void

setFormatter() public method

Set paste's format.
public setFormatter ( string $format ) : void
$format string
return void

setOpendiscussion() public method

Set paste's discussion state.
public setOpendiscussion ( string $opendiscussion = '1' ) : void
$opendiscussion string
return void

store() public method

Store the paste's data.
public store ( ) : void
return void