PHP Class Clockwork\Storage\SqlStorage

Inheritance: extends Storage
Show file Open project: itsgoingd/clockwork Class Usage Examples

Protected Properties

Property Type Description
$needs_serialization List of Request keys that need to be serialized before they can be stored in database
$pdo PDO instance
$table Name of the table with Clockwork requests metadata

Public Methods

Method Description
__construct ( $dsn, $table = 'clockwork', $username = null, $password = null ) Return a new storage, takes PDO object or DSN and optionally a table name and database credentials as arguments
initialize ( ) Create the Clockwork metadata table if it doesn't exist
retrieve ( $id = null, $last = null ) Retrieve a request specified by id argument, if second argument is specified, array of requests from id to last will be returned
store ( Request $request ) Store the request in the database

Protected Methods

Method Description
createRequestFromData ( $data )

Method Details

__construct() public method

Return a new storage, takes PDO object or DSN and optionally a table name and database credentials as arguments
public __construct ( $dsn, $table = 'clockwork', $username = null, $password = null )

createRequestFromData() protected method

protected createRequestFromData ( $data )

initialize() public method

Create the Clockwork metadata table if it doesn't exist
public initialize ( )

retrieve() public method

Retrieve a request specified by id argument, if second argument is specified, array of requests from id to last will be returned
public retrieve ( $id = null, $last = null )

store() public method

Store the request in the database
public store ( Request $request )
$request Clockwork\Request\Request

Property Details

$needs_serialization protected property

List of Request keys that need to be serialized before they can be stored in database
protected $needs_serialization

$pdo protected property

PDO instance
protected $pdo

$table protected property

Name of the table with Clockwork requests metadata
protected $table