PHP Class Flintstone\Flintstone

Afficher le fichier Open project: fire015/flintstone Class Usage Examples

Protected Properties

Свойство Type Description
$config Config Config class.
$database Database Database class.

Méthodes publiques

Méthode Description
__construct ( Database | string $database, Config | array $config ) Constructor.
delete ( string $key ) Delete a key from the database.
flush ( ) Flush the database.
get ( string $key ) : mixed Get a key from the database.
getAll ( ) : array Get all data from the database.
getConfig ( ) : Config Get the config.
getDatabase ( ) : Database Get the database.
getKeys ( ) : array Get all keys from the database.
set ( string $key, mixed $data ) Set a key in the database.
setConfig ( Config $config ) Set the config.
setDatabase ( Database $database ) Set the database.

Méthodes protégées

Méthode Description
decodeData ( string $data ) : mixed Decode a string into data.
encodeData ( mixed $data ) : string Encode data into a string.
getDataFromLine ( string $line, string $key ) : string | boolean Retrieve data from a given line for a specific key.
getKeyFromLine ( string $line ) : string Retrieve key from a given line.
getLinePieces ( string $line ) : array Retrieve the pieces from a given line.
getLineString ( string $key, mixed $data ) : string Get the line string to write.
replace ( string $key, mixed $data ) Replace a key in the database.
validateData ( mixed $data ) Check the data type is valid.
validateKey ( string $key ) Validate the key.

Method Details

__construct() public méthode

Constructor.
public __construct ( Database | string $database, Config | array $config )
$database Database | string
$config Config | array

decodeData() protected méthode

Decode a string into data.
protected decodeData ( string $data ) : mixed
$data string
Résultat mixed

delete() public méthode

Delete a key from the database.
public delete ( string $key )
$key string

encodeData() protected méthode

Encode data into a string.
protected encodeData ( mixed $data ) : string
$data mixed
Résultat string

flush() public méthode

Flush the database.
public flush ( )

get() public méthode

Get a key from the database.
public get ( string $key ) : mixed
$key string
Résultat mixed

getAll() public méthode

Get all data from the database.
public getAll ( ) : array
Résultat array

getConfig() public méthode

Get the config.
public getConfig ( ) : Config
Résultat Config

getDataFromLine() protected méthode

Retrieve data from a given line for a specific key.
protected getDataFromLine ( string $line, string $key ) : string | boolean
$line string
$key string
Résultat string | boolean

getDatabase() public méthode

Get the database.
public getDatabase ( ) : Database
Résultat Database

getKeyFromLine() protected méthode

Retrieve key from a given line.
protected getKeyFromLine ( string $line ) : string
$line string
Résultat string

getKeys() public méthode

Get all keys from the database.
public getKeys ( ) : array
Résultat array

getLinePieces() protected méthode

Retrieve the pieces from a given line.
protected getLinePieces ( string $line ) : array
$line string
Résultat array

getLineString() protected méthode

Get the line string to write.
protected getLineString ( string $key, mixed $data ) : string
$key string
$data mixed
Résultat string

replace() protected méthode

Replace a key in the database.
protected replace ( string $key, mixed $data )
$key string
$data mixed

set() public méthode

Set a key in the database.
public set ( string $key, mixed $data )
$key string
$data mixed

setConfig() public méthode

Set the config.
public setConfig ( Config $config )
$config Config

setDatabase() public méthode

Set the database.
public setDatabase ( Database $database )
$database Database

validateData() protected méthode

Check the data type is valid.
protected validateData ( mixed $data )
$data mixed the data

validateKey() protected méthode

Validate the key.
protected validateKey ( string $key )
$key string

Property Details

$config protected_oe property

Config class.
protected Config,flintstone $config
Résultat Config

$database protected_oe property

Database class.
protected Database,flintstone $database
Résultat Database