PHP Class LazyRecord\Metadata

Inheritance: implements ArrayAcces\ArrayAccess, implements IteratorAggregat\IteratorAggregate
Mostrar archivo Open project: corneltek/lazyrecord Class Usage Examples

Public Properties

Property Type Description
$connection PDO connection object
$driver QueryDriver from SQLBuilder

Public Methods

Method Description
__construct ( PDO $connection, BaseDriver $driver ) Users can store different metadata in the different data sources.
createWithDataSource ( $dsId )
getAttribute ( string $key ) Get an attribute value from the database source.
getIterator ( ) : ArrayIterator Get iterator for the key-value pair data.
getKeyValues ( )
getKeys ( )
getValues ( )
getVersion ( ) : integer Get the current version number from the key-value store.
hasAttribute ( string $key ) Check if a key exists in the database.
init ( ) This method initialize the metadata table if needed.
offsetExists ( string $key ) Check if a key exists.
offsetGet ( string $key )
offsetSet ( string $key, string $value ) Set a value with a key.
offsetUnset ( string $key )
removeAttribute ( string $key ) Remove an attribute from the database source.
setAttribute ( string $key, string $value ) Set an attribute.

Method Details

__construct() public method

This constructor requires the first parameter to be the data source Id to initialize the metadata object.
public __construct ( PDO $connection, BaseDriver $driver )
$connection PDO
$driver SQLBuilder\Driver\BaseDriver

createWithDataSource() public static method

public static createWithDataSource ( $dsId )

getAttribute() public method

Get an attribute value from the database source.
public getAttribute ( string $key )
$key string

getIterator() public method

Please note this method does not cache the meta data, if you call this method, this method will do another SQL query to fetch all the attribute

getKeyValues() public method

public getKeyValues ( )

getKeys() public method

public getKeys ( )

getValues() public method

public getValues ( )

getVersion() public method

Get the current version number from the key-value store.
public getVersion ( ) : integer
return integer version number

hasAttribute() public method

Check if a key exists in the database.
public hasAttribute ( string $key )
$key string

init() public method

This method initialize the metadata table if needed.
public init ( )

offsetExists() public method

Check if a key exists.
public offsetExists ( string $key )
$key string

offsetGet() public method

public offsetGet ( string $key )
$key string

offsetSet() public method

Set a value with a key.
public offsetSet ( string $key, string $value )
$key string the key
$value string the value

offsetUnset() public method

public offsetUnset ( string $key )
$key string

removeAttribute() public method

Remove an attribute from the database source.
public removeAttribute ( string $key )
$key string

setAttribute() public method

Set an attribute.
public setAttribute ( string $key, string $value )
$key string
$value string

Property Details

$connection public_oe property

PDO connection object
public $connection

$driver public_oe property

QueryDriver from SQLBuilder
public $driver