I know that ORM and redis is weird enough but. My redis server is a storage (not temporary). So I discovered some queries and commands but now I want to know how to use it in best way. As everybody know ORM is good enough (ActiveRecord, Doctrine2, etc.). So give me your thoughts how to create model and use it with redis db.
My thoughts is to create some abstract class that will load (predis) and work with it BUT I have no idea how to make checker\manager of 'columns' (yes I know that redis has not such things as columns), simple example, we call this one
hset('user:id_111', 'username'. 'admin')
hset('user:id_111', 'password'. 'pass')
hset('user:id_111', 'email'. 'some@mail.com')
hset('user:id_111', 'confirmed'. '1')
After that we should have model that will return all method we need (they will be writted manually)
$oModel->getUserName();
$oModel->getPassword();
$oModel->getEmail();
$oModel->getConfirmed();
So now question is of calling queries, basically in abstract model we should create Predis\Client() but hey, it will be created in EACH model (is it bad?)!
Also do we have check ALL vars\values when changing data in model, simple example what should we do on incorrect data? Exception or simply not saving model and save error in model?
Any ideas\thoughts you have, please share.
PS: no need code, enough will be description how you see this one