BearFramework\App\DataRepository

Data storage
BearFramework\App\DataRepository {

    
/* Methods */
    
public __construct ( [ array $options = [] ] )
    public 
self addEventListener string $name , callable $listener )
    public 
self append string $key string $content )
    public 
self delete string $key )
    public 
self deleteMetadata string $key string $name )
    public 
self dispatchEvent string $name [, mixed $details ] )
    public 
self duplicate string $sourceKey string $destinationKey )
    public 
bool exists string $key )
    public 
BearFramework\App\DataItem|null get string $key )
    public 
string getFilename string $key )
    public 
BearFramework\DataList|BearFramework\App\DataItem[] getList void )
    public 
string|null getMetadata string $key string $name )
    public 
string|null getValue string $key )
    public 
bool hasEventListeners string $name )
    public 
BearFramework\App\DataItem make ( [ string|null $key [, string|null $value ]] )
    public 
self removeEventListener string $name , callable $listener )
    public 
self rename string $sourceKey string $destinationKey )
    public 
self set BearFramework\App\DataItem $item )
    public 
self setDriver BearFramework\App\IDataDriver $driver )
    public 
self setMetadata string $key string $name string $value )
    public 
self setValue string $key string $value )
    public 
self useFileDriver string $dir )
    public 
self useNullDriver void )
    public 
bool validate string $key )

}
Methods
public __construct ( [ array $options = [] ] )
Constructs a new data repository.
public self addEventListener ( string $name , callable $listener )
Registers a new event listener.
public self append ( string $key , string $content )
Appends data to the data item's value specified. If the data item does not exist, it will be created.
public self delete ( string $key )
Deletes the data item specified and it's metadata.
public self deleteMetadata ( string $key , string $name )
Deletes metadata for the data item key specified.
public self dispatchEvent ( string $name [, mixed $details ] )
Calls the registered listeners (in order) for the event name specified.
public self duplicate ( string $sourceKey , string $destinationKey )
Creates a copy of the data item specified.
public bool exists ( string $key )
Returns TRUE if the data item exists. FALSE otherwise.
public BearFramework\App\DataItem|null get ( string $key )
Returns a stored data item or null if not found.
public string getFilename ( string $key )
Returns the filename of the data item specified.
Returns a list of all items in the data storage.
public string|null getMetadata ( string $key , string $name )
Retrieves metadata for the data item specified.
public string|null getValue ( string $key )
Returns the value of a stored data item or null if not found.
public bool hasEventListeners ( string $name )
Returns TRUE if there are registered event listeners for the name specified, FALSE otherwise.
public BearFramework\App\DataItem make ( [ string|null $key [, string|null $value ]] )
Constructs a new data item and returns it.
public self removeEventListener ( string $name , callable $listener )
Removes a registered event listener.
public self rename ( string $sourceKey , string $destinationKey )
Changes the key of the data item specified.
public self set ( BearFramework\App\DataItem $item )
Stores a data item.
Sets a new data driver.
public self setMetadata ( string $key , string $name , string $value )
Stores metadata for the data item specified.
public self setValue ( string $key , string $value )
Sets a new value of the item specified or creates a new item with the key and value specified.
public self useFileDriver ( string $dir )
Enables the file data driver using the directory specified.
public self useNullDriver ( void )
Enables a null data driver. No data is stored and no errors are thrown.
public bool validate ( string $key )
Checks if a data item key is valid.
Events
BearFramework\App\Data\GetListEvent getList
An event dispatched after a data items list is requested.
BearFramework\App\Data\ItemAppendEvent itemAppend
An event dispatched after a content is appended to a data value.
BearFramework\App\Data\ItemChangeEvent itemChange
An event dispatched after a data item is changed.
BearFramework\App\Data\ItemDeleteEvent itemDelete
An event dispatched after a data item is deleted.
BearFramework\App\Data\ItemDeleteMetadataEvent itemDeleteMetadata
An event dispatched after a data item metadata is deleted.
BearFramework\App\Data\ItemDuplicateEvent itemDuplicate
An event dispatched after a data item is duplicated.
BearFramework\App\Data\ItemExistsEvent itemExists
An event dispatched after a data item is checked for existence.
BearFramework\App\Data\ItemGetEvent itemGet
An event dispatched after a data item is requested.
BearFramework\App\Data\ItemGetMetadataEvent itemGetMetadata
An event dispatched after a data item metadata is requested.
BearFramework\App\Data\ItemGetValueEvent itemGetValue
An event dispatched after the value of a data item is requested.
BearFramework\App\Data\ItemRenameEvent itemRename
An event dispatched after a data item is renamed.
BearFramework\App\Data\ItemRequestEvent itemRequest
An event dispatched after a data item is requested.
BearFramework\App\Data\ItemSetEvent itemSet
An event dispatched after a data item is added or updated.
BearFramework\App\Data\ItemSetMetadataEvent itemSetMetadata
An event dispatched after a data item metadata is added or updated.
BearFramework\App\Data\ItemSetValueEvent itemSetValue
An event dispatched after the value of a data item is added or updated.
Details
Location: ~/src/App/DataRepository.php
The information on this page is created for version 1.1 of Bear Framework and may not be applicable for other versions of the framework.