PHP Class LazyRecord\Metadata

Inheritance: implements ArrayAcces\ArrayAccess, implements IteratorAggregat\IteratorAggregate
Afficher le fichier Open project: corneltek/lazyrecord Class Usage Examples

Méthodes publiques

Свойство Type Description
$connection PDO connection object
$driver QueryDriver from SQLBuilder

Méthodes publiques

Méthode 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 méthode

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 méthode

public static createWithDataSource ( $dsId )

getAttribute() public méthode

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

getIterator() public méthode

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
public getIterator ( ) : ArrayIterator
Résultat ArrayIterator

getKeyValues() public méthode

public getKeyValues ( )

getKeys() public méthode

public getKeys ( )

getValues() public méthode

public getValues ( )

getVersion() public méthode

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

hasAttribute() public méthode

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

init() public méthode

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

offsetExists() public méthode

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

offsetGet() public méthode

public offsetGet ( string $key )
$key string

offsetSet() public méthode

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

offsetUnset() public méthode

public offsetUnset ( string $key )
$key string

removeAttribute() public méthode

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

setAttribute() public méthode

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