Posted on Monday 9th July 2018
DataStore in its current version works only with the filesystem, which although not scalable for larger datasets, can be of use for simpler systems.
DataStore is the evolution of a class called Entity from (https://webpi.chris-shaw.com) Entity was a raw class to standardise how the WebPi software would interact with data stored within the filesystem
$payload = [
'id_entity' => 'testId',
'test' => 'case'
];
$dataStore = new DataStore('exampleID');
$dataStore>create($payload);
$dataStore = new DataStore('exampleID');
$dataStore>getValue('fieldname');
$dataStore = new DataStore('exampleID');
$dataStore>getValue('field', 'value');
$dataStore = new DataStore('exampleID');
$dataStore>delete();
$filters = [
['field','=','value'],
['field','>','value']
];
$search = new DataStore();
$results = $search->search();
The preferred method is using composer (https://getcomposer.org/) and can be insalled using the following command
composer require christopher-paul-shaw/datastore
You can also clone the repository from github
git clone git@github.com:christopher-paul-shaw/DataStore.git