PHP Class Bravo3\Orm\Drivers\Filesystem\FilesystemDriver

When using any I/O driver that works with actual files, it is important to use the FilesystemKeyScheme else file manipulations will have unexpected results.
Inheritance: implements Bravo3\Orm\Drivers\DriverInterface, use trait Bravo3\Orm\Traits\DebugTrait, use trait Bravo3\Orm\Drivers\Common\StandardIdValidatorTrait
Afficher le fichier Open project: bravo3/orm

Protected Properties

Свойство Type Description
$unit_of_work Bravo3\Orm\Drivers\Common\UnitOfWork
$worker_pool Bravo3\Orm\Drivers\Common\WorkerPool

Méthodes publiques

Méthode Description
__construct ( Bravo3\Orm\Drivers\Filesystem\Io\IoDriverInterface $io_driver )
addMultiValueIndex ( string $key, string | array $value ) : void Add one or many values to a list index
addRef ( string $key, Ref $ref ) : void Add a ref to an entity
addSortedIndex ( string $key, mixed $score, string $value ) : void Add or update an item in a sorted index
clearMultiValueIndex ( string $key ) : void Clear all values from a set index
clearRefs ( string $key ) : void Clear all refs from an entity (delete a ref list)
clearSingleValueIndex ( string $key ) : string Clear the value of a key-value index
clearSortedIndex ( string $key ) : void Clear an entire sorted index
debugLog ( string $msg ) : void Create a debug log
delete ( string $key ) : void Delete a primitive document
flush ( ) : void Execute the current unit of work
getMultiValueIndex ( string $key ) : string[] Get a list of all values on a set index
getPreferredKeyScheme ( ) : Bravo3\Orm\KeySchemes\KeySchemeInterface Get the drivers preferred key scheme
getRefs ( string $key ) : Ref[] Get all refs to an entity
getSingleValueIndex ( string $key ) : string | null Get the value of a key-value index
getSortedIndex ( string $key, boolean $reverse = false, integer $start = null, integer $stop = null ) : string[] Get a range of values in a sorted index
getSortedIndexSize ( string $key ) : integer Get the size of a sorted index, without any filters applied
persist ( string $key, SerialisedData $data, integer $ttl = null ) : void Persist some primitive data
purge ( ) : void Purge the current unit of work, clearing any unexecuted commands
removeMultiValueIndex ( string $key, string | array $value ) : void Remove one or more values from a set index
removeRef ( string $key, Ref $ref ) : void Remove a ref from an entity
removeSortedIndex ( string $key, string $value ) : void Remove an item from a sorted index
retrieve ( string $key ) : SerialisedData Retrieve an object
scan ( string $key ) : string[] Scan key-value indices and return the value of all matching keys
setSingleValueIndex ( string $key, string $value ) : void Set a key-value index

Méthodes protégées

Méthode Description
createWorkerPool ( Bravo3\Orm\Drivers\Filesystem\Io\IoDriverInterface $io_driver ) Create a worker pool with all workers registered

Method Details

__construct() public méthode

public __construct ( Bravo3\Orm\Drivers\Filesystem\Io\IoDriverInterface $io_driver )
$io_driver Bravo3\Orm\Drivers\Filesystem\Io\IoDriverInterface Filesystem IO driver

addMultiValueIndex() public méthode

Add one or many values to a list index
public addMultiValueIndex ( string $key, string | array $value ) : void
$key string
$value string | array
Résultat void

addRef() public méthode

Add a ref to an entity
public addRef ( string $key, Ref $ref ) : void
$key string Entity ref key
$ref Bravo3\Orm\Drivers\Common\Ref Reference to add
Résultat void

addSortedIndex() public méthode

Add or update an item in a sorted index
public addSortedIndex ( string $key, mixed $score, string $value ) : void
$key string
$score mixed
$value string
Résultat void

clearMultiValueIndex() public méthode

Clear all values from a set index
public clearMultiValueIndex ( string $key ) : void
$key string
Résultat void

clearRefs() public méthode

Clear all refs from an entity (delete a ref list)
public clearRefs ( string $key ) : void
$key string
Résultat void

clearSingleValueIndex() public méthode

Clear the value of a key-value index
public clearSingleValueIndex ( string $key ) : string
$key string
Résultat string

clearSortedIndex() public méthode

Clear an entire sorted index
public clearSortedIndex ( string $key ) : void
$key string
Résultat void

createWorkerPool() protected méthode

Create a worker pool with all workers registered
protected createWorkerPool ( Bravo3\Orm\Drivers\Filesystem\Io\IoDriverInterface $io_driver )
$io_driver Bravo3\Orm\Drivers\Filesystem\Io\IoDriverInterface

debugLog() public méthode

Create a debug log
public debugLog ( string $msg ) : void
$msg string
Résultat void

delete() public méthode

Delete a primitive document
public delete ( string $key ) : void
$key string
Résultat void

flush() public méthode

Execute the current unit of work
public flush ( ) : void
Résultat void

getMultiValueIndex() public méthode

If the key does not exist, an empty array should be returned.
public getMultiValueIndex ( string $key ) : string[]
$key string
Résultat string[]

getPreferredKeyScheme() public méthode

Get the drivers preferred key scheme
public getPreferredKeyScheme ( ) : Bravo3\Orm\KeySchemes\KeySchemeInterface
Résultat Bravo3\Orm\KeySchemes\KeySchemeInterface

getRefs() public méthode

Get all refs to an entity
public getRefs ( string $key ) : Ref[]
$key string Entity ref key
Résultat Bravo3\Orm\Drivers\Common\Ref[]

getSingleValueIndex() public méthode

If the key does not exist, null should be returned.
public getSingleValueIndex ( string $key ) : string | null
$key string
Résultat string | null

getSortedIndex() public méthode

If $start/$stop are === null, they are assumed to be the start/end of the entire set.
public getSortedIndex ( string $key, boolean $reverse = false, integer $start = null, integer $stop = null ) : string[]
$key string
$reverse boolean
$start integer
$stop integer
Résultat string[]

getSortedIndexSize() public méthode

Get the size of a sorted index, without any filters applied
public getSortedIndexSize ( string $key ) : integer
$key string
Résultat integer

persist() public méthode

Persist some primitive data
public persist ( string $key, SerialisedData $data, integer $ttl = null ) : void
$key string
$data Bravo3\Orm\Drivers\Common\SerialisedData
$ttl integer
Résultat void

purge() public méthode

Purge the current unit of work, clearing any unexecuted commands
public purge ( ) : void
Résultat void

removeMultiValueIndex() public méthode

Remove one or more values from a set index
public removeMultiValueIndex ( string $key, string | array $value ) : void
$key string
$value string | array
Résultat void

removeRef() public méthode

If the reference does not exist, no action is taken.
public removeRef ( string $key, Ref $ref ) : void
$key string Entity ref key
$ref Bravo3\Orm\Drivers\Common\Ref Reference to remove
Résultat void

removeSortedIndex() public méthode

Remove an item from a sorted index
public removeSortedIndex ( string $key, string $value ) : void
$key string
$value string
Résultat void

retrieve() public méthode

Retrieve an object
public retrieve ( string $key ) : SerialisedData
$key string
Résultat Bravo3\Orm\Drivers\Common\SerialisedData

scan() public méthode

Scan key-value indices and return the value of all matching keys
public scan ( string $key ) : string[]
$key string
Résultat string[]

setSingleValueIndex() public méthode

Set a key-value index
public setSingleValueIndex ( string $key, string $value ) : void
$key string
$value string
Résultat void

Property Details

$unit_of_work protected_oe property

protected UnitOfWork,Bravo3\Orm\Drivers\Common $unit_of_work
Résultat Bravo3\Orm\Drivers\Common\UnitOfWork

$worker_pool protected_oe property

protected WorkerPool,Bravo3\Orm\Drivers\Common $worker_pool
Résultat Bravo3\Orm\Drivers\Common\WorkerPool