PHP 클래스 PrivateBin\Data\AbstractData

Abstract model for PrivateBin data access, implemented as a singleton.
파일 보기 프로젝트 열기: privatebin/privatebin

보호된 프로퍼티들

프로퍼티 타입 설명
$_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