PHP Class Pheasant\Database\Mysqli\SequencePool

Show file Open project: lox/pheasant

Public Methods

Method Description
__construct ( $connection, $startId = 1 ) Constructor
_nextSequence ( $sequence ) Called within a transaction, gets the next sequence value
clear ( ) Clears either the whole pool
close ( ) Closes a connection
current ( $sequence ) Returns the current integer in the sequence
delete ( $sequence ) Deletes a given sequence from the pool
initialize ( ) Creates the sequence table if it doesn't exist
next ( $sequence ) Returns the next integer in the sequence

Private Methods

Method Description
_lockSequence ( $sequence ) Locks the sequence, creates it if needed and returns the current value

Method Details

__construct() public method

Constructor
public __construct ( $connection, $startId = 1 )

_nextSequence() public method

Called within a transaction, gets the next sequence value
public _nextSequence ( $sequence )

clear() public method

Clears either the whole pool
public clear ( )

close() public method

Closes a connection
public close ( )

current() public method

Returns the current integer in the sequence
public current ( $sequence )

delete() public method

Deletes a given sequence from the pool
public delete ( $sequence )

initialize() public method

Creates the sequence table if it doesn't exist
public initialize ( )

next() public method

Returns the next integer in the sequence
public next ( $sequence )