PHP Класс PrivateBin\Data\AbstractData

Abstract model for PrivateBin data access, implemented as a singleton.
Показать файл Открыть проект

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

Свойство Тип Описание
$_instance AbstractData singleton instance

Открытые методы

Метод Описание
create ( string $pasteid, array $paste ) : boolean Create a paste.
createComment ( string $pasteid, string $parentid, string $commentid, array $comment ) : boolean Create a comment in a paste.
delete ( string $pasteid ) : void Delete a paste and its discussion.
exists ( string $pasteid ) : boolean Test if a paste exists.
existsComment ( string $pasteid, string $parentid, string $commentid ) : boolean Test if a comment exists.
getInstance ( array $options ) : privatebin_abstract get instance of singleton
purge ( integer $batchsize ) : void Perform a purge of old pastes, at most the given batchsize is deleted.
read ( string $pasteid ) : stdClas\stdClass | false Read a paste.
readComments ( string $pasteid ) : array Read all comments of paste.

Защищенные методы

Метод Описание
__construct ( ) enforce singleton, disable constructor
_getExpiredPastes ( integer $batchsize ) : array Returns up to batch size number of paste ids that have expired
getOpenSlot ( array &$comments, integer | string $postdate ) : integer | string Get next free slot for comment from postdate.

Приватные методы

Метод Описание
__clone ( ) enforce singleton, disable cloning

Описание методов

__construct() защищенный Метод

Instantiate using {@link getInstance()}, privatebin is a singleton object.
protected __construct ( )

_getExpiredPastes() абстрактный защищенный Метод

Returns up to batch size number of paste ids that have expired
abstract protected _getExpiredPastes ( integer $batchsize ) : array
$batchsize integer
Результат array

create() абстрактный публичный Метод

Create a paste.
abstract public create ( string $pasteid, array $paste ) : boolean
$pasteid string
$paste array
Результат boolean

createComment() абстрактный публичный Метод

Create a comment in a paste.
abstract public createComment ( string $pasteid, string $parentid, string $commentid, array $comment ) : boolean
$pasteid string
$parentid string
$commentid string
$comment array
Результат boolean

delete() абстрактный публичный Метод

Delete a paste and its discussion.
abstract public delete ( string $pasteid ) : void
$pasteid string
Результат void

exists() абстрактный публичный Метод

Test if a paste exists.
abstract public exists ( string $pasteid ) : boolean
$pasteid string
Результат boolean

existsComment() абстрактный публичный Метод

Test if a comment exists.
abstract public existsComment ( string $pasteid, string $parentid, string $commentid ) : boolean
$pasteid string
$parentid string
$commentid string
Результат boolean

getInstance() публичный статический Метод

get instance of singleton
public static getInstance ( array $options ) : privatebin_abstract
$options array
Результат privatebin_abstract

getOpenSlot() защищенный Метод

Get next free slot for comment from postdate.
protected getOpenSlot ( array &$comments, integer | string $postdate ) : integer | string
$comments array
$postdate integer | string
Результат integer | string

purge() публичный Метод

Perform a purge of old pastes, at most the given batchsize is deleted.
public purge ( integer $batchsize ) : void
$batchsize integer
Результат void

read() абстрактный публичный Метод

Read a paste.
abstract public read ( string $pasteid ) : stdClas\stdClass | false
$pasteid string
Результат stdClas\stdClass | false

readComments() абстрактный публичный Метод

Read all comments of paste.
abstract public readComments ( string $pasteid ) : array
$pasteid string
Результат array

Описание свойств

$_instance защищенное статическое свойство

singleton instance
protected static AbstractData,PrivateBin\Data $_instance
Результат AbstractData